Skip to content

Commit f1a0edf

Browse files
ENGCOM-8931: Replace repetitive actions with Action Groups in AdminConfigurableProductRemoveAnOptionTest #32465
- Merge Pull Request #32465 from kate-kyzyma/magento2:refactoring-AdminConfigurableProductRemoveAnOptionTest - Merged commits: 1. 3831d41 2. 1ba52ff 3. 134e715 4. 49ecc2a 5. 4600758
2 parents d2155b3 + 4600758 commit f1a0edf

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,31 @@
7575
</after>
7676

7777
<!--check storefront for both options-->
78-
<amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront1"/>
79-
<waitForPageLoad stepKey="wait1"/>
80-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/>
81-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/>
78+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront1">
79+
<argument name="product" value="$createConfigProduct$"/>
80+
</actionGroup>
81+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
82+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption1Storefront">
83+
<argument name="productAttributeOption" value="option1"/>
84+
</actionGroup>
85+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Storefront">
86+
<argument name="productAttributeOption" value="option2"/>
87+
</actionGroup>
8288

8389
<!--check admin for both options-->
8490
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
8591
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToEditPage">
8692
<argument name="productId" value="$$createConfigProduct.id$$"/>
8793
</actionGroup>
8894
<waitForPageLoad stepKey="wait2"/>
89-
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="seeOption1Admin"/>
90-
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct2.name$$" stepKey="seeOption2Admin"/>
95+
<actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption1Admin">
96+
<argument name="attribute" value="name_container"/>
97+
<argument name="value" value="$$createConfigChildProduct1.name$$"/>
98+
</actionGroup>
99+
<actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption2Admin">
100+
<argument name="attribute" value="name_container"/>
101+
<argument name="value" value="$$createConfigChildProduct2.name$$"/>
102+
</actionGroup>
91103

92104
<!--remove an option-->
93105
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/>
@@ -98,9 +110,13 @@
98110
<dontSee selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="dontSeeOption1Admin"/>
99111

100112
<!--check storefront for one option-->
101-
<amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront2"/>
102-
<waitForPageLoad stepKey="wait4"/>
113+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront2">
114+
<argument name="product" value="$createConfigProduct$"/>
115+
</actionGroup>
116+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/>
103117
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/>
104-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/>
118+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again">
119+
<argument name="productAttributeOption" value="option2"/>
120+
</actionGroup>
105121
</test>
106122
</tests>

0 commit comments

Comments
 (0)