Skip to content

Replace repetitive actions with Action Groups in AdminSimpleSetEditRelatedProductsTest #34346

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
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 @@ -61,7 +61,9 @@

<!--Save the product-->
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
<argument name="message" value="You saved the product."/>
</actionGroup>

<!--Add another related product-->
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1">
Expand All @@ -73,12 +75,17 @@

<!--Save the product-->
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAfterEdit"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/>
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShownAgain">
<argument name="message" value="You saved the product."/>
</actionGroup>

<!--See related product in admin-->
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo"/>
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/>
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollTo"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openDropDownIfClosedRelatedSee"/>
<actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="seeRelatedProduct">
<argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/>
<argument name="expectedText" value="$$simpleProduct1.name$$"/>
</actionGroup>

<!--See more related products in admin-->
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2">
Expand All @@ -96,16 +103,24 @@
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct6">
<argument name="sku" value="$$simpleProduct6.sku$$"/>
</actionGroup>
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/>
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/>
<see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="seeSixthRelatedProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollTo2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openDropDownIfClosedRelatedSee2"/>
<actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="seeSixthRelatedProduct">
<argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/>
<argument name="expectedText" value="$$simpleProduct6.name$$"/>
</actionGroup>

<selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/>
<waitForPageLoad stepKey="waitForLoadingAfterSelectFivePerPage"/>
<dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.name$$" stepKey="dontSeeSixthRelatedProduct"/>

<!--See related product in storefront-->
<amOnPage url="{{SimpleProduct3.urlKey}}.html" stepKey="goToStorefront"/>
<waitForPageLoad stepKey="waitForStorefront"/>
<seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$simpleProduct1.name$$)}}" stepKey="seeRelatedProductInStorefront"/>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefront">
<argument name="productUrl" value="{{SimpleProduct3.urlKey}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefront"/>
<actionGroup ref="StorefrontAssertRelatedProductOnProductPageActionGroup" stepKey="seeRelatedProductInStorefront">
<argument name="productName" value="$$simpleProduct1.name$$"/>
</actionGroup>
</test>
</tests>