Skip to content

Commit

Permalink
Merge pull request #3655 from magento-pangolin/mtf-eol-pr
Browse files Browse the repository at this point in the history
[pangolins] Convert MTF tests to MFTF tests
  • Loading branch information
okolesnyk authored Feb 8, 2019
2 parents f6876dd + 54b0ed8 commit fb9e645
Show file tree
Hide file tree
Showing 112 changed files with 5,054 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@
<data key="attribute_code">price_view</data>
<data key="value">0</data>
</entity>
<entity name="CustomAttributeFixWeight" type="custom_attribute">
<data key="attribute_code">weight_type</data>
<data key="value">1</data>
</entity>
<entity name="CustomAttributeFixSku" type="custom_attribute">
<data key="attribute_code">sku_type</data>
<data key="value">1</data>
</entity>
</entities>
16 changes: 16 additions & 0 deletions app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@
<data key="fixedPriceFormatted">$10.00</data>
<data key="defaultAttribute">Default</data>
</entity>
<entity name="FixedBundleProduct" type="product2">
<data key="name" unique="suffix">FixedBundleProduct</data>
<data key="sku" unique="suffix">fixed-bundle-product</data>
<data key="type_id">bundle</data>
<data key="attribute_set_id">4</data>
<data key="price">1.23</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">fixed-bundle-product</data>
<requiredEntity type="custom_attribute">CustomAttributeCategoryIds</requiredEntity>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixWeight</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixSku</requiredEntity>
</entity>
<entity name="ApiBundleProduct" type="product2">
<data key="name" unique="suffix">Api Bundle Product</data>
<data key="sku" unique="suffix">api-bundle-product</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminDeleteBundleDynamicProductTest">
<annotations>
<features value="Bundle"/>
<stories value="Delete products"/>
<title value="Delete Bundle Dynamic Product"/>
<description value="Admin should be able to delete a bundle dynamic product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-11016"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="ApiBundleProductPriceViewRange" stepKey="createDynamicBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName">
<argument name="product" value="$$createDynamicBundleProduct$$"/>
</actionGroup>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/>
<!-- Verify product on Product Page -->
<amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
<!-- Search for the product by sku -->
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createDynamicBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
<waitForPageLoad stepKey="waitForSearchButton"/>
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForSearchResults"/>
<!-- Should not see any search results -->
<dontSee userInput="$$createDynamicBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
<!-- Go to the category page that we created in the before block -->
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
<!-- Should not see the product -->
<dontSee userInput="$$createDynamicBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/>
<see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminDeleteBundleFixedProductTest">
<annotations>
<features value="Bundle"/>
<stories value="Delete products"/>
<title value="Delete Bundle Fixed Product"/>
<description value="Admin should be able to delete a bundle fixed product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-11017"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="FixedBundleProduct" stepKey="createFixedBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName">
<argument name="product" value="$$createFixedBundleProduct$$"/>
</actionGroup>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/>
<!-- Verify product on Product Page -->
<amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
<!-- Search for the product by sku -->
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createFixedBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
<waitForPageLoad stepKey="waitForSearchButton"/>
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForSearchResults"/>
<!-- Should not see any search results -->
<dontSee userInput="$$createFixedBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
<!-- Go to the category page that we created in the before block -->
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
<!-- Should not see the product -->
<dontSee userInput="$$createFixedBundleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/>
<see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@

<click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomOptionsSection"/>
<click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/>
<fillField userInput="option1" selector="{{AdminProductCustomizableOptionsSection.optionTitleInput}}" stepKey="fillOptionTitle"/>
<fillField selector="{{AdminProductCustomizableOptionsSection.optionTitleInput('0')}}" userInput="option1" stepKey="fillOptionTitle"/>
<click selector="{{AdminProductCustomizableOptionsSection.optionTypeOpenDropDown}}" stepKey="openTypeDropDown"/>
<click selector="{{AdminProductCustomizableOptionsSection.optionTypeTextField}}" stepKey="selectTypeTextField"/>
<fillField userInput="20" selector="{{AdminProductCustomizableOptionsSection.maxCharactersInput}}" stepKey="fillMaxChars"/>
Expand Down Expand Up @@ -235,7 +235,7 @@
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
<checkOption selector="{{AdminProductModalSlideGridSection.productRowCheckboxBySku(sku)}}" stepKey="selectProduct"/>
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,48 @@
<argument name="ProductAttribute"/>
</arguments>
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}"
userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/>
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/>
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}"
stepKey="waitForSuccessMessage"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
</actionGroup>
<!-- Delete product attribute by Attribute Code -->
<actionGroup name="deleteProductAttributeByAttributeCode">
<arguments>
<argument name="ProductAttributeCode" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
<waitForPageLoad stepKey="waitForPageLoad2" />
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/>
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
</actionGroup>
<!--Filter product attribute by Attribute Code -->
<actionGroup name="filterProductAttributeByAttributeCode">
<arguments>
<argument name="ProductAttributeCode" type="string"/>
</arguments>
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/>
<waitForPageLoad stepKey="waitForUserInput"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
</actionGroup>
<!--Filter product attribute by Default Label -->
<actionGroup name="filterProductAttributeByDefaultLabel">
<arguments>
<argument name="productAttributeLabel" type="string"/>
</arguments>
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{productAttributeLabel}}" stepKey="setDefaultLabel"/>
<waitForPageLoad stepKey="waitForUserInput"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/>
<click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/>
</actionGroup>
<!-- Filter By Attribute Label -->
<actionGroup name="filterProductAttributeByAttributeLabel">
<arguments>
<argument name="productAttributeLabel" type="string"/>
</arguments>
<fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabel"/>
<waitForPageLoad stepKey="waitForUserInput"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
</actionGroup>

<!-- Filter product grid by sku, name -->
<actionGroup name="filterProductGridBySkuAndName">
<arguments>
<argument name="product" defaultValue="_defaultProduct"/>
</arguments>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
</actionGroup>

<!--Delete a product by filtering grid and using delete action-->
<actionGroup name="deleteProductUsingProductGrid">
<arguments>
Expand All @@ -155,6 +167,7 @@
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<argument name="productOption"/>
<argument name="productOption2"/>
</arguments>

<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>

Expand Down Expand Up @@ -48,10 +47,9 @@
<fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/>
<click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/>
<click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/>
<waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPrice}}" stepKey="waitForElements"/>
<fillField selector="{{AdminProductCustomizableOptionsSection.optionPrice}}" userInput="{{option.price}}" stepKey="fillPrice"/>
<selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/>
<fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/>
<waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPrice('0')}}" stepKey="waitForElements"/>
<fillField selector="{{AdminProductCustomizableOptionsSection.optionPrice('0')}}" userInput="{{option.price}}" stepKey="fillPrice"/>
<selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType('0')}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/>
<fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions('0')}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/>
</actionGroup>

</actionGroups>
Loading

0 comments on commit fb9e645

Please sign in to comment.