Skip to content

Replace repetitive actions with Action Groups in StorefrontConfigurableProductGridViewTest and StorefrontConfigurableProductListViewTest #34051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@
</after>

<!-- Verify the storefront category grid view -->
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/>
<waitForPageLoad stepKey="wait1"/>
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="amOnCategoryPage1">
<argument name="category" value="$$createCategory$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
<seeElement selector="{{StorefrontCategoryMainSection.productImage}}" stepKey="seePhoto"/>
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{_defaultProduct.name}}" stepKey="seeName"/>
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeName">
<argument name="productName" value="{{_defaultProduct.name}}"/>
</actionGroup>
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref(_defaultProduct.urlKey)}}" stepKey="seeNameLink"/>
<see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="{{colorProductAttribute1.price}}" stepKey="seePrice"/>
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seePrice">
<argument name="productName" value="{{_defaultProduct.name}}"/>
<argument name="productPrice" value="{{colorProductAttribute1.price}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@
</after>

<!-- Verify storefront category list view -->
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage1"/>
<waitForPageLoad stepKey="wait1"/>
<click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="clickListView"/>
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="amOnCategoryPage1">
<argument name="category" value="$$createCategory$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
<actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="clickListView"/>
<waitForPageLoad stepKey="wait2"/>
<seeElement selector="{{StorefrontCategoryMainSection.productImage}}" stepKey="seePhoto"/>
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{_defaultProduct.name}}" stepKey="seeName"/>
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeName">
<argument name="productName" value="{{_defaultProduct.name}}"/>
</actionGroup>
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref(_defaultProduct.urlKey)}}" stepKey="seeNameLink"/>
<see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="{{colorProductAttribute1.price}}" stepKey="seePrice"/>
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seePrice">
<argument name="productName" value="{{_defaultProduct.name}}"/>
<argument name="productPrice" value="{{colorProductAttribute1.price}}"/>
</actionGroup>
</test>
</tests>