Skip to content

Commit

Permalink
ENGCOM-8943: Replace repetitive actions with Action Groups in AdminCr…
Browse files Browse the repository at this point in the history
…eateSimpleProductZeroPriceTest #32295

 - Merge Pull Request #32295 from kate-kyzyma/magento2:Refactoring-AdminCreateSimpleProductZeroPriceTest
 - Merged commits:
   1. 9551196
   2. cc8f978
   3. febd90d
   4. ddfc87a
   5. 7882098
   6. 3dc6542
   7. 99cc467
   8. f6c11b3
  • Loading branch information
magento-engcom-team committed Apr 22, 2021
2 parents 3f697e0 + f6c11b3 commit f6d6688
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
<group value="product"/>
</annotations>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/>
<waitForPageLoad stepKey="wait1"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="0" stepKey="fillPrice"/>
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToCreateProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
<actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillName">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
<actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice">
<argument name="price" value="0"/>
</actionGroup>
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSave"/>
<amOnPage url="{{StorefrontProductPage.url(SimpleProduct.urlKey)}}" stepKey="viewProduct"/>
<waitForPageLoad stepKey="wait2"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.00" stepKey="seeZeroPrice"/>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="viewProduct">
<argument name="productUrl" value="{{SimpleProduct.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait2"/>
<actionGroup ref="StorefrontAssertUpdatedProductPriceInStorefrontProductPageActionGroup" stepKey="seeZeroPrice">
<argument name="productName" value="{{SimpleProduct.name}}"/>
<argument name="expectedPrice" value="$0.00"/>
</actionGroup>
</test>
</tests>

0 comments on commit f6d6688

Please sign in to comment.