Skip to content

Commit d063a34

Browse files
committed
Refactoring EnableDisableBundleProductStatusTest
1 parent a38ed7e commit d063a34

File tree

1 file changed

+41
-25
lines changed

1 file changed

+41
-25
lines changed

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

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,33 @@
3535
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3636
</after>
3737
<!--Go to bundle product creation page-->
38-
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />
39-
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
38+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToBundleProductCreationPage">
39+
<argument name="attributeSetId" value="{{BundleProduct.set}}"/>
40+
<argument name="productType" value="{{BundleProduct.type}}"/>
41+
</actionGroup>
42+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/>
4043

4144
<!-- Add two bundle items -->
42-
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
43-
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
44-
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
45-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
46-
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
47-
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
48-
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
49-
<argument name="product" value="$$simpleProduct1$$"/>
50-
</actionGroup>
51-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
52-
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
53-
<argument name="product" value="$$simpleProduct2$$"/>
45+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItems"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAddOption3"/>
47+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptions"/>
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillOptionTitle"/>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectInputType"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAddProductsToOption"/>
51+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterBundleProductOptions"/>
52+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFirstGridRow"/>
53+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterBundleProductOptions2"/>
54+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFirstGridRow2"/>
55+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="clickAddSelectedBundleProducts">
56+
<argument name="x" value="0"/>
57+
<argument name="n" value="1"/>
58+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
59+
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
60+
<argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/>
61+
<argument name="inputType" value="{{BundleProduct.optionInputType1}}"/>
5462
</actionGroup>
55-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
56-
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
57-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
58-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
63+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty1"/>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty2"/>
5965

6066
<!--Fill out ancillary data on bundle product-->
6167
<actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts">
@@ -64,14 +70,20 @@
6470

6571
<!--Save the product-->
6672
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
67-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
73+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
74+
<argument name="message" value="You saved the product."/>
75+
</actionGroup>
6876

6977
<!--Testing enabled view-->
7078
<!--Product enabled by default-->
7179
<!--Go to page-->
72-
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/>
73-
<waitForPageLoad stepKey="waitForBundleProductPageToLoad"/>
74-
<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>
80+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage">
81+
<argument name="productUrl" value="{{BundleProduct.urlKey}}"/>
82+
</actionGroup>
83+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoad"/>
84+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="LookingForNameOfProduct">
85+
<argument name="productName" value="{{BundleProduct.name}}"/>
86+
</actionGroup>
7587

7688
<!--Testing disabled view-->
7789
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="GoToProductCatalog"/>
@@ -81,9 +93,13 @@
8193
<click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="ClickProductInGrid"/>
8294
<click stepKey="ClickOnEnableDisableToggle" selector="{{AdminProductFormBundleSection.enableDisableToggle}}"/>
8395
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAgain"/>
84-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/>
85-
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPageAgain"/>
86-
<waitForPageLoad stepKey="WaitForProductPageToLoadToShowElement"/>
96+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShownAgain">
97+
<argument name="message" value="You saved the product."/>
98+
</actionGroup>
99+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPageAgain">
100+
<argument name="productUrl" value="{{BundleProduct.urlKey}}"/>
101+
</actionGroup>
102+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="WaitForProductPageToLoadToShowElement"/>
87103
<dontSeeElement stepKey="LookingForNameOfProductTwo" selector="{{StorefrontBundledSection.bundleProductName}}"/>
88104
</test>
89105
</tests>

0 commit comments

Comments
 (0)