Skip to content

Commit 0c767f1

Browse files
ENGCOM-8943: Replace repetitive actions with Action Groups in AdminCreateSimpleProductZeroPriceTest #32295
2 parents a36dba0 + f6d6688 commit 0c767f1

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@
1818
<group value="product"/>
1919
</annotations>
2020
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
21-
<amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/>
22-
<waitForPageLoad stepKey="wait1"/>
23-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/>
24-
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="0" stepKey="fillPrice"/>
21+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/>
22+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
23+
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillName">
24+
<argument name="product" value="SimpleProduct"/>
25+
</actionGroup>
26+
<actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice">
27+
<argument name="price" value="0"/>
28+
</actionGroup>
2529
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
26-
<amOnPage url="{{StorefrontProductPage.url(SimpleProduct.urlKey)}}" stepKey="viewProduct"/>
27-
<waitForPageLoad stepKey="wait2"/>
28-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.00" stepKey="seeZeroPrice"/>
30+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="viewProduct">
31+
<argument name="productUrl" value="{{SimpleProduct.urlKey}}"/>
32+
</actionGroup>
33+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait2"/>
34+
<actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="seeZeroPrice">
35+
<argument name="productName" value="{{SimpleProduct.name}}"/>
36+
<argument name="expectedPrice" value="$0.00"/>
37+
</actionGroup>
2938
</test>
3039
</tests>

0 commit comments

Comments
 (0)