Skip to content

Commit

Permalink
ENGCOM-8931: Replace repetitive actions with Action Groups in AdminCo…
Browse files Browse the repository at this point in the history
…nfigurableProductRemoveAnOptionTest #32465
  • Loading branch information
gabrieldagama committed Apr 26, 2021
2 parents 94822ca + f1a0edf commit 97aaf29
Showing 1 changed file with 25 additions and 9 deletions.
Expand Up @@ -75,19 +75,31 @@
</after>

<!--check storefront for both options-->
<amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront1"/>
<waitForPageLoad stepKey="wait1"/>
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="seeOption1Storefront"/>
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/>
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront1">
<argument name="product" value="$createConfigProduct$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption1Storefront">
<argument name="productAttributeOption" value="option1"/>
</actionGroup>
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Storefront">
<argument name="productAttributeOption" value="option2"/>
</actionGroup>

<!--check admin for both options-->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToEditPage">
<argument name="productId" value="$$createConfigProduct.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="wait2"/>
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="seeOption1Admin"/>
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct2.name$$" stepKey="seeOption2Admin"/>
<actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption1Admin">
<argument name="attribute" value="name_container"/>
<argument name="value" value="$$createConfigChildProduct1.name$$"/>
</actionGroup>
<actionGroup ref="AssertAdminChildProductDataOnParentProductEditPageActionGroup" stepKey="seeOption2Admin">
<argument name="attribute" value="name_container"/>
<argument name="value" value="$$createConfigChildProduct2.name$$"/>
</actionGroup>

<!--remove an option-->
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('1')}}" stepKey="clickToExpandActions"/>
Expand All @@ -98,9 +110,13 @@
<dontSee selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="$$createConfigChildProduct1.name$$" stepKey="dontSeeOption1Admin"/>

<!--check storefront for one option-->
<amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="amOnStorefront2"/>
<waitForPageLoad stepKey="wait4"/>
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnStorefront2">
<argument name="product" value="$createConfigProduct$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait4"/>
<dontSee selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option1" stepKey="dontSeeOption1InStorefront"/>
<see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Again"/>
<actionGroup ref="AssertStorefrontProductAttributeOptionVisibleActionGroup" stepKey="seeOption2Again">
<argument name="productAttributeOption" value="option2"/>
</actionGroup>
</test>
</tests>

0 comments on commit 97aaf29

Please sign in to comment.