Skip to content

Commit dc9e0bc

Browse files
committed
Refactoring the test
1 parent eea292a commit dc9e0bc

File tree

1 file changed

+59
-22
lines changed

1 file changed

+59
-22
lines changed

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

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,54 @@
3636
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3737
</after>
3838
<!-- go to bundle product creation page-->
39-
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />
40-
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
39+
<!--<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />-->
40+
<!--<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>-->
4141

42-
<!-- Add two bundle items -->
43-
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
44-
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
45-
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
46-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
47-
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
48-
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
49-
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
50-
<argument name="product" value="$$simpleProduct1$$"/>
42+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToBundleProductCreationPage">
43+
<argument name="attributeSetId" value="{{BundleProduct.set}}"/>
44+
<argument name="productType" value="{{BundleProduct.type}}"/>
5145
</actionGroup>
52-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
53-
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
54-
<argument name="product" value="$$simpleProduct2$$"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/>
47+
48+
<!-- Add two bundle items -->
49+
<!--<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>-->
50+
<!--<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>-->
51+
<!--<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>-->
52+
<!--<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>-->
53+
<!--<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>-->
54+
<!--<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>-->
55+
<!--<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">-->
56+
<!--<argument name="product" value="$$simpleProduct1$$"/>-->
57+
<!--</actionGroup>-->
58+
<!--<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>-->
59+
<!--<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">-->
60+
<!--<argument name="product" value="$$simpleProduct2$$"/>-->
61+
<!--</actionGroup>-->
62+
<!--<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>-->
63+
<!--<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>-->
64+
<!--<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>-->
65+
<!--<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>-->
66+
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItems"/>
68+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAddOption3"/>
69+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptions"/>
70+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillOptionTitle"/>
71+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectInputType"/>
72+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAddProductsToOption"/>
73+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterBundleProductOptions"/>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFirstGridRow"/>
75+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterBundleProductOptions2"/>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFirstGridRow2"/>
77+
<actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="clickAddSelectedBundleProducts">
78+
<argument name="x" value="0"/>
79+
<argument name="n" value="1"/>
80+
<argument name="prodOneSku" value="$$simpleProduct1.sku$$"/>
81+
<argument name="prodTwoSku" value="$$simpleProduct2.sku$$"/>
82+
<argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/>
83+
<argument name="inputType" value="{{BundleProduct.optionInputType1}}"/>
5584
</actionGroup>
56-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
57-
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
58-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
59-
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
85+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty1"/>
86+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty2"/>
6087

6188
<!--Create a bundle product with ancillary data-->
6289
<actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProduct">
@@ -65,13 +92,23 @@
6592

6693
<!--save the product/published by default-->
6794
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
68-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
95+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
96+
<argument name="message" value="You saved the product."/>
97+
</actionGroup>
6998

7099
<!-- go to page-->
71-
<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/>
100+
<!--<amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/>-->
72101

73102
<!--Test Assertion - on correct page/page has been published-->
74-
<waitForPageLoad stepKey="waitForBundleProductPageToLoad"/>
75-
<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>
103+
<!--<waitForPageLoad stepKey="waitForBundleProductPageToLoad"/>-->
104+
<!--<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>-->
105+
106+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage">
107+
<argument name="productUrl" value="{{BundleProduct.urlKey}}"/>
108+
</actionGroup>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoad"/>
110+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="LookingForNameOfProduct">
111+
<argument name="productName" value="{{BundleProduct.name}}"/>
112+
</actionGroup>
76113
</test>
77114
</tests>

0 commit comments

Comments
 (0)