Skip to content

Commit c84054f

Browse files
committed
MC-4409: Convert UpdateProductAttributeEntityTest to MFTF
- Adding "waitForPageLoad" action to the Action Group. - Adding clean up steps to the "after" block of the Test. - Fixing the name of the "createData" reference. There is a camel-casing issue with the original name.
1 parent 29c858f commit c84054f

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@
6262
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/>
6363
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
6464
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
65+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
6566
</actionGroup>
6667
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest">
@@ -17,6 +18,7 @@
1718
<severity value="CRITICAL"/>
1819
<group value="mtf_migrated"/>
1920
</annotations>
21+
2022
<before>
2123
<!-- Create product attribute with 2 options -->
2224
<createData entity="productDropDownAttributeNotSearchable" stepKey="attribute"/>
@@ -26,44 +28,58 @@
2628
<createData entity="productAttributeOption2" stepKey="option2">
2729
<requiredEntity createDataKey="attribute"/>
2830
</createData>
31+
2932
<!-- Create product attribute set -->
3033
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
3134
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
3235
</before>
36+
<after>
37+
<actionGroup ref="logout" stepKey="logout"/>
38+
</after>
39+
3340
<!-- Filter product attribute set by attribute set name -->
3441
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
3542
<actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName">
3643
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
3744
</actionGroup>
45+
3846
<!-- Assert created attribute in an unassigned attributes -->
3947
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/>
48+
4049
<!-- Assign attribute in the group -->
4150
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
4251
<argument name="group" value="Product Details"/>
4352
<argument name="attribute" value="$$attribute.attribute_code$$"/>
4453
</actionGroup>
4554
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
4655
<actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/>
56+
4757
<!-- Go to Product Attribute Grid page -->
4858
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
4959
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$$attribute.attribute_code$$" stepKey="fillAttrCodeField" />
5060
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
5161
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" />
62+
5263
<!-- Change attribute property: Frontend Label -->
5364
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel"/>
65+
5466
<!-- Change attribute property: Use in Search >Yes -->
5567
<scrollToTopOfPage stepKey="scrollToTabs"/>
5668
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
5769
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" stepKey="waitTabLoad"/>
5870
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="seeInSearch"/>
71+
5972
<!-- Change attribute property: Visible In Advanced Search >No -->
6073
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" stepKey="waitTabLoad2"/>
6174
<selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="No" stepKey="dontSeeInAdvancedSearch"/>
75+
6276
<!-- Save the new product attributes -->
6377
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/>
6478
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
79+
6580
<!-- Flash cache -->
6681
<magentoCLI command="cache:flush" stepKey="flushCache"/>
82+
6783
<!-- Go to store's advanced catalog search page -->
6884
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
6985
<dontSeeElement selector="{{StorefrontCatalogSearchAdvancedFormSection.AttributeByCode('$$attribute.attribute_code$$')}}" stepKey="dontSeeAttribute"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest">
@@ -17,53 +18,68 @@
1718
<severity value="CRITICAL"/>
1819
<group value="mtf_migrated"/>
1920
</annotations>
21+
2022
<before>
2123
<!-- Create a multiple select product attribute with two options -->
22-
<createData entity="productAttributeMultiSelectTwoOptionsNotSearchable" stepKey="attribute"/>
24+
<createData entity="productAttributeMultiselectTwoOptionsNotSearchable" stepKey="attribute"/>
2325
<createData entity="productAttributeOption1" stepKey="option1">
2426
<requiredEntity createDataKey="attribute"/>
2527
</createData>
2628
<createData entity="productAttributeOption2" stepKey="option2">
2729
<requiredEntity createDataKey="attribute"/>
2830
</createData>
31+
2932
<!-- Create product attribute set -->
3033
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
3134
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
3235
</before>
36+
<after>
37+
<actionGroup ref="logout" stepKey="logout"/>
38+
</after>
39+
3340
<!-- Filter product attribute set by attribute set name -->
3441
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/>
3542
<actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName">
3643
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
3744
</actionGroup>
45+
3846
<!-- Assert created attribute in an unassigned attributes -->
3947
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/>
48+
4049
<!-- Assign attribute in the group -->
4150
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup">
4251
<argument name="group" value="Product Details"/>
4352
<argument name="attribute" value="$$attribute.attribute_code$$"/>
4453
</actionGroup>
4554
<see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
4655
<actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/>
56+
4757
<!-- Go to Product Attribute Grid page -->
4858
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
4959
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$$attribute.attribute_code$$" stepKey="fillAttrCodeField" />
5060
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
5161
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="chooseFirstRow" />
62+
5263
<!-- Change attribute property: Frontend Label -->
5364
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel"/>
65+
5466
<!-- Change attribute property: Use in Search >Yes -->
5567
<scrollToTopOfPage stepKey="scrollToTabs"/>
5668
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
5769
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" stepKey="waitTabLoad"/>
5870
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="seeInSearch"/>
71+
5972
<!-- Change attribute property: Visible In Advanced Search >No -->
6073
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" stepKey="waitTabLoad2"/>
6174
<selectOption selector="{{AdvancedAttributePropertiesSection.VisibleInAdvancedSearch}}" userInput="No" stepKey="dontSeeInAdvancedSearch"/>
75+
6276
<!-- Save the new product attributes -->
6377
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSave"/>
6478
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
79+
6580
<!-- Flash cache -->
6681
<magentoCLI command="cache:flush" stepKey="flushCache"/>
82+
6783
<!-- Go to store's advanced catalog search page -->
6884
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
6985
<dontSeeElement selector="{{StorefrontCatalogSearchAdvancedFormSection.AttributeByCode('$$attribute.attribute_code$$')}}" stepKey="dontSeeAttribute"/>

0 commit comments

Comments
 (0)