Skip to content

Commit a38ed7e

Browse files
committed
Refactoring AdminEditRelatedBundleProductTest
1 parent eea292a commit a38ed7e

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252

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

5759
<actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1">
5860
<argument name="sku" value="$$simpleProduct1.sku$$"/>
@@ -63,18 +65,27 @@
6365

6466
<!--Save the product-->
6567
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAfterEdit"/>
66-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/>
68+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShownAgain">
69+
<argument name="message" value="You saved the product."/>
70+
</actionGroup>
6771

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

7380
<magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/>
7481

7582
<!--See related product in storefront-->
76-
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="goToStorefront"/>
77-
<waitForPageLoad stepKey="waitForStorefront"/>
78-
<see userInput="$$simpleProduct1.name$$" stepKey="seeRelatedProductInStorefront"/>
83+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefront">
84+
<argument name="productUrl" value="{{BundleProduct.urlKey}}"/>
85+
</actionGroup>
86+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefront"/>
87+
<actionGroup ref="StorefrontAssertRelatedProductOnProductPageActionGroup" stepKey="seeRelatedProductInStorefront">
88+
<argument name="productName" value="$$simpleProduct1.name$$"/>
89+
</actionGroup>
7990
</test>
8091
</tests>

0 commit comments

Comments
 (0)