Skip to content

Commit 8727096

Browse files
authored
ENGCOM-9260: Replace repetitive actions with Action Groups in AdminConfigurableProductOutOfStockAndDeleteCombinationTest and AdminConfigurableProductOutOfStockTestDeleteChildrenTest #34113
2 parents 26e21cb + d22a9f7 commit 8727096

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockAndDeleteCombinationTest.xml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,28 @@
8686
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
8787
</after>
8888

89-
<!-- Check to make sure that the configurable product shows up as in stock -->
90-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>
91-
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
92-
<see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/>
89+
<!-- Check to make sure that the configurable product shows up as in stock --><!--<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>-->
90+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage"/>
91+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad"/>
92+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock">
93+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
94+
<argument name="productName" value="$createConfigProduct.name$"/>
95+
<argument name="stockStatus" value="IN STOCK"/>
96+
</actionGroup>
9397

9498
<!-- Delete the first simple product -->
9599
<actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup">
96100
<argument name="sku" value="{{ApiSimpleOne.sku}}"/>
97101
</actionGroup>
98102

99103
<!-- Check to make sure that the configurable product shows up as in stock -->
100-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage2"/>
101-
<waitForPageLoad stepKey="waitForStoreFrontLoad2"/>
102-
<see stepKey="checkForOutOfStock2" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/>
104+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage2"/>
105+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad2"/>
106+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock2">
107+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
108+
<argument name="productName" value="$createConfigProduct.name$"/>
109+
<argument name="stockStatus" value="IN STOCK"/>
110+
</actionGroup>
103111

104112
<!-- Find the second simple product that we just created using the product grid and go to its page-->
105113
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage2"/>
@@ -115,8 +123,12 @@
115123
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct2"/>
116124

117125
<!-- Check to make sure that the configurable product shows up as out of stock -->
118-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage3"/>
119-
<waitForPageLoad stepKey="waitForStoreFrontLoad3"/>
120-
<see stepKey="checkForOutOfStock3" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="OUT OF STOCK"/>
126+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage3"/>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad3"/>
128+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock3">
129+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
130+
<argument name="productName" value="$createConfigProduct.name$"/>
131+
<argument name="stockStatus" value="OUT OF STOCK"/>
132+
</actionGroup>
121133
</test>
122134
</tests>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockTestDeleteChildrenTest.xml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,40 @@
8686
</after>
8787

8888
<!-- Check to make sure that the configurable product shows up as in stock -->
89-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>
90-
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
91-
<see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage"/>
90+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad"/>
91+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock">
92+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
93+
<argument name="productName" value="$createConfigProduct.name$"/>
94+
<argument name="stockStatus" value="IN STOCK"/>
95+
</actionGroup>
9296

9397
<!-- Delete the first simple product -->
9498
<actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup">
9599
<argument name="sku" value="{{ApiSimpleOne.sku}}"/>
96100
</actionGroup>
97101

98102
<!-- Check to make sure that the configurable product shows up as in stock -->
99-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage2"/>
100-
<waitForPageLoad stepKey="waitForStoreFrontLoad2"/>
101-
<see stepKey="checkForOutOfStock2" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/>
103+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage2"/>
104+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad2"/>
105+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock2">
106+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
107+
<argument name="productName" value="$createConfigProduct.name$"/>
108+
<argument name="stockStatus" value="IN STOCK"/>
109+
</actionGroup>
102110

103111
<!-- Delete the second simple product -->
104112
<actionGroup stepKey="deleteProduct2" ref="DeleteProductBySkuActionGroup">
105113
<argument name="sku" value="{{ApiSimpleTwo.sku}}"/>
106114
</actionGroup>
107115

108116
<!-- Check to make sure that the configurable product shows up as out of stock -->
109-
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage3"/>
110-
<waitForPageLoad stepKey="waitForStoreFrontLoad3"/>
111-
<see stepKey="checkForOutOfStock3" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="OUT OF STOCK"/>
117+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigProductPage3"/>
118+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontLoad3"/>
119+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkForOutOfStock3">
120+
<argument name="productUrlKey" value="$createConfigProduct.custom_attributes[url_key]$"/>
121+
<argument name="productName" value="$createConfigProduct.name$"/>
122+
<argument name="stockStatus" value="OUT OF STOCK"/>
123+
</actionGroup>
112124
</test>
113125
</tests>

0 commit comments

Comments
 (0)