Skip to content

Commit d98c3c1

Browse files
ENGCOM-8971: Replace repetitive actions with Action Groups in AdminCreateSimpleProductNegativePriceTest #32467
2 parents 3c2cd9f + 7a9b5a8 commit d98c3c1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
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="-42" 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+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillName"/>
24+
<actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillPrice">
25+
<argument name="productName" value="{{SimpleProduct.name}}"/>
26+
<argument name="productSku" value="{{SimpleProduct.sku}}"/>
27+
<argument name="productPrice" value="-42"/>
28+
<argument name="productQuantity" value="{{SimpleProduct.quantity}}"/>
29+
<argument name="productStatus" value="{{SimpleProduct.status}}"/>
30+
<argument name="productWeight" value="{{SimpleProduct.weight}}"/>
31+
</actionGroup>
2532
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
26-
<see selector="{{AdminProductFormSection.priceFieldError}}" userInput="Please enter a number 0 or greater in this field." stepKey="seePriceValidationError"/>
33+
<actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="seePriceValidationError">
34+
<argument name="errorMessage" value="Please enter a number 0 or greater in this field."/>
35+
</actionGroup>
2736
</test>
2837
</tests>

0 commit comments

Comments
 (0)