Skip to content

Commit

Permalink
ENGCOM-8941: Replace repetitive actions with Action Groups in Storefr…
Browse files Browse the repository at this point in the history
…ontConfigurableProductOptionsTest #32133

 - Merge Pull Request #32133 from kate-kyzyma/magento2:Refactoring-StorefrontConfigurableProductOptionsTest
 - Merged commits:
   1. 6fb3cff
   2. abb0c86
   3. 3efbaa8
  • Loading branch information
magento-engcom-team committed Aug 18, 2021
2 parents 7e364fd + 3efbaa8 commit fca8474
Showing 1 changed file with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,36 @@
</after>

<!-- Verify configurable product options in storefront product view -->
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/>
<waitForPageLoad stepKey="wait"/>
<see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/>
<selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/>
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="amOnConfigurableProductPage">
<argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait"/>
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeProductName">
<argument name="productName" value="{{_defaultProduct.name}}"/>
</actionGroup>
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption1">
<argument name="attributeLabel" value="{{colorProductAttribute.default_label}}"/>
<argument name="optionLabel" value="{{colorProductAttribute1.name}}"/>
</actionGroup>
<dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/>
<see userInput="1.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice1"/>
<selectOption userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/>
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice1">
<argument name="productPrice" value="1.00"/>
</actionGroup>
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2">
<argument name="attributeLabel" value="{{colorProductAttribute.default_label}}"/>
<argument name="optionLabel" value="{{colorProductAttribute2.name}}"/>
</actionGroup>
<dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/>
<see userInput="2.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/>
<selectOption userInput="{{colorProductAttribute3.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption3"/>
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice2">
<argument name="productPrice" value="2.00"/>
</actionGroup>
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption3">
<argument name="attributeLabel" value="{{colorProductAttribute.default_label}}"/>
<argument name="optionLabel" value="{{colorProductAttribute3.name}}"/>
</actionGroup>
<dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel3"/>
<see userInput="3.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice3"/>
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeProductPrice3">
<argument name="productPrice" value="3.00"/>
</actionGroup>
</test>
</tests>

0 comments on commit fca8474

Please sign in to comment.