Skip to content

Commit 2d2a20a

Browse files
committed
Refactoring some tests
1 parent ac88ad9 commit 2d2a20a

File tree

5 files changed

+72
-20
lines changed

5 files changed

+72
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductAttributeOptionNotVisibleActionGroup">
12+
<arguments>
13+
<argument name="productAttributeOption" type="string"/>
14+
</arguments>
15+
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{productAttributeOption}}" stepKey="doNotSeeProductAttributeOption"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,21 @@
7878
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/>
7979

8080
<!-- Verify that the added option is present in the storefront -->
81-
<amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="amOnStorefrontPage"/>
82-
<waitForPageLoad stepKey="waitForStorefrontPage"/>
83-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>
84-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/>
85-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/>
86-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute4.name}}" stepKey="seeInDropDown4"/>
81+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="amOnStorefrontPage">
82+
<argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/>
83+
</actionGroup>
84+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPage"/>
85+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown1">
86+
<argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/>
87+
</actionGroup>
88+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2">
89+
<argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/>
90+
</actionGroup>
91+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3">
92+
<argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/>
93+
</actionGroup>
94+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown4">
95+
<argument name="productAttributeOption" value="{{colorProductAttribute4.name}}"/>
96+
</actionGroup>
8797
</test>
8898
</tests>

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,16 @@
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
<!--go to admin and disable an option-->
8490
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
@@ -91,9 +97,15 @@
9197
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
9298

9399
<!--check storefront for one option-->
94-
<amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront2"/>
95-
<waitForPageLoad stepKey="wait4"/>
96-
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/>
97-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/>
100+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront2">
101+
<argument name="product" value="$createConfigProduct$"/>
102+
</actionGroup>
103+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/>
104+
<actionGroup ref="AssertStorefrontProductAttributeOptionNotVisibleActionGroup" stepKey="dontSeeOption1InStorefront">
105+
<argument name="productAttributeOption" value="option1"/>
106+
</actionGroup>
107+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again">
108+
<argument name="productAttributeOption" value="option2"/>
109+
</actionGroup>
98110
</test>
99111
</tests>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@
114114
<argument name="product" value="$createConfigProduct$"/>
115115
</actionGroup>
116116
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/>
117-
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/>
117+
<actionGroup ref="AssertStorefrontProductAttributeOptionNotVisibleActionGroup" stepKey="dontSeeOption1InStorefront">
118+
<argument name="productAttributeOption" value="option1"/>
119+
</actionGroup>
118120
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again">
119121
<argument name="productAttributeOption" value="option2"/>
120122
</actionGroup>

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,21 @@
6464
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/>
6565

6666
<!-- Verify that the removed option is not present in the storefront -->
67-
<amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="amOnStorefrontPage"/>
68-
<waitForPageLoad stepKey="waitForStorefrontPage"/>
69-
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>
70-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeInDropDown2"/>
71-
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute3.name}}" stepKey="seeInDropDown3"/>
67+
<!--<amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="amOnStorefrontPage"/>-->
68+
<!--<waitForPageLoad stepKey="waitForStorefrontPage"/>-->
69+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="amOnStorefrontPage">
70+
<argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/>
71+
</actionGroup>
72+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPage"/>
73+
<!--<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeInDropDown1"/>-->
74+
<actionGroup ref="AssertStorefrontProductAttributeOptionNotVisibleActionGroup" stepKey="seeInDropDown1">
75+
<argument name="productAttributeOption" value="{{colorProductAttribute1.name}}"/>
76+
</actionGroup>
77+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown2">
78+
<argument name="productAttributeOption" value="{{colorProductAttribute2.name}}"/>
79+
</actionGroup>
80+
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeInDropDown3">
81+
<argument name="productAttributeOption" value="{{colorProductAttribute3.name}}"/>
82+
</actionGroup>
7283
</test>
7384
</tests>

0 commit comments

Comments
 (0)