Skip to content

Commit 96da9ee

Browse files
committed
MC-217: Admin should be able to mass change bundle products status to Enabled/Disabled
1 parent df106be commit 96da9ee

File tree

1 file changed

+159
-0
lines changed

1 file changed

+159
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="MassEnableDisableBundleProductsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Admin list bundle products"/>
15+
<title value="Admin should be able to mass change bundle products status to Enabled/Disabled"/>
16+
<description value="Admin should be able to mass change bundle products status to Enabled/Disabled"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-217"/>
19+
<group value="Bundle"/>
20+
<!--Skipped due to MAGETWO-92898-->
21+
<group value="skip"/>
22+
</annotations>
23+
<before>
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
26+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
27+
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
28+
<createData entity="SimpleProduct2" stepKey="simpleProduct4"/>
29+
</before>
30+
<after>
31+
<!--Clear Filters-->
32+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/>
33+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
34+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
35+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
36+
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
37+
<deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/>
38+
</after>
39+
40+
<!--Go to bundle product creation page-->
41+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />
42+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
43+
44+
<!--Create bundle product-->
45+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
46+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
47+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
48+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
49+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
50+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
51+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
52+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
53+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
54+
<argument name="product" value="$$simpleProduct1$$"/>
55+
</actionGroup>
56+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
57+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
58+
<argument name="product" value="$$simpleProduct2$$"/>
59+
</actionGroup>
60+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
61+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
62+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
63+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
64+
65+
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
66+
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
67+
68+
<!--Trigger SEO drop down-->
69+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
70+
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
71+
72+
<!--Fill URL input-->
73+
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
74+
75+
<!--Save the product-->
76+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
77+
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
78+
79+
<!--Creating Second bundle product-->
80+
<!--Go to bundle product creation page-->
81+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage2" />
82+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad2"/>
83+
84+
<!--Create bundle product 2-->
85+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/>
86+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption32"/>
87+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions2"/>
88+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle2"/>
89+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType2"/>
90+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/>
91+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/>
92+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/>
93+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptionsx2">
94+
<argument name="product" value="$$simpleProduct3$$"/>
95+
</actionGroup>
96+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/>
97+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions22">
98+
<argument name="product" value="$$simpleProduct4$$"/>
99+
</actionGroup>
100+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/>
101+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/>
102+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/>
103+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/>
104+
105+
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName2"/>
106+
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku2}}" stepKey="fillProductSku2"/>
107+
108+
<!--Trigger SEO drop down-->
109+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed2"/>
110+
<waitForPageLoad stepKey="WaitForDropDownSEO2"/>
111+
112+
<!--Fill URL input-->
113+
<fillField userInput="{{BundleProduct.urlKey2}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension2"/>
114+
115+
<!--Save the product-->
116+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton2"/>
117+
<see userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown2"/>
118+
119+
<!--Clear Filters-->
120+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFilters"/>
121+
122+
<!--Setting filter-->
123+
<actionGroup ref="BundleProductFilter" stepKey="FilterForOnlyBundleProducts"/>
124+
125+
<!--Disabling bundle products-->
126+
<click selector="{{AdminProductCatalog.allCheckbox}}" stepKey="ClickOnSelectAllCheckBox"/>
127+
<click selector="{{AdminProductCatalog.actions}}" stepKey="ClickOnActions"/>
128+
<click selector="{{AdminProductCatalog.changeStatus}}" stepKey="ClickOnChangeStatus"/>
129+
<click selector="{{AdminProductCatalog.disable}}" stepKey="ClickOnDisable"/>
130+
<waitForPageLoad stepKey="waitForPageloadToExecute"/>
131+
132+
<!--Clear Cache - reindex - resets products according to enabled/disabled view-->
133+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
134+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
135+
<actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/>
136+
137+
<!--Confirm bundle products have been disabled-->
138+
<amOnPage url="{{BundleProduct.urlKey2}}.html" stepKey="GoToProductPage"/>
139+
<waitForPageLoad stepKey="WaitForProductPageToLoadToShowElement"/>
140+
<dontSeeElement stepKey="LookingForNameOfProductDisabled" selector="{{BundleStorefrontSection.bundleProductName}}"/>
141+
142+
<!--Enabling bundle products-->
143+
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToCatalogPageChangingView"/>
144+
<waitForPageLoad stepKey="WaitForPageToLoadFullyChangingView"/>
145+
<click selector="{{AdminProductCatalog.allCheckbox}}" stepKey="ClickOnSelectAllCheckBoxChangingView"/>
146+
<click selector="{{AdminProductCatalog.actions}}" stepKey="ClickOnActionsChangingView"/>
147+
<click selector="{{AdminProductCatalog.changeStatus}}" stepKey="ClickOnChangeStatusChangingView"/>
148+
<click selector="{{AdminProductCatalog.enable}}" stepKey="ClickOnEnable"/>
149+
150+
<!--Clear Cache - reindex - resets products according to enabled/disabled view-->
151+
<magentoCLI command="indexer:reindex" stepKey="reindex2"/>
152+
<magentoCLI command="cache:flush" stepKey="flushCache2"/>
153+
154+
<!--Confirm bundle products have been enabled-->
155+
<amOnPage url="{{BundleProduct.urlKey2}}.html" stepKey="GoToProductPageEnabled"/>
156+
<waitForPageLoad stepKey="waitForBundleProductPageToLoad"/>
157+
<seeElement stepKey="LookingForNameOfProduct" selector="{{BundleStorefrontSection.bundleProductName}}"/>
158+
</test>
159+
</tests>

0 commit comments

Comments
 (0)