Skip to content

Commit 9551196

Browse files
committed
refactoring the test
1 parent d3f202a commit 9551196

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,28 @@
1717
<testCaseId value="MAGETWO-89910"/>
1818
<group value="product"/>
1919
</annotations>
20-
<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"/>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
25+
</after>
26+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/>
27+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
28+
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillName">
29+
<argument name="product" value="SimpleProduct"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice">
32+
<argument name="price" value="0"/>
33+
</actionGroup>
2534
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
26-
<amOnPage url="{{StorefrontProductPage.url(SimpleProduct.name)}}" stepKey="viewProduct"/>
27-
<waitForPageLoad stepKey="wait2"/>
28-
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.00" stepKey="seeZeroPrice"/>
35+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="viewProduct">
36+
<argument name="productUrl" value="{{SimpleProduct.name}}"/>
37+
</actionGroup>
38+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait2"/>
39+
<actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="seeZeroPrice">
40+
<argument name="productName" value="{{SimpleProduct.name}}"/>
41+
<argument name="expectedPrice" value="$0.00"/>
42+
</actionGroup>
2943
</test>
3044
</tests>

0 commit comments

Comments
 (0)