Skip to content

Commit 8808f43

Browse files
committed
MC-20333: Fix All Catalog Module MFTF tests that are failing with the use of Elastic Search functionality
"Based on review comments duplicated tests to also support Mysql search engine functionality"
1 parent 113519a commit 8808f43

File tree

4 files changed

+473
-0
lines changed

4 files changed

+473
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<testCaseId value="MC-128"/>
1919
<group value="Catalog"/>
2020
<group value="Product Attributes"/>
21+
<group value="SearchEngineElasticsearch"/>
2122
</annotations>
2223
<before>
2324
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -85,4 +86,76 @@
8586
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault1"/>
8687
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault1"/>
8788
</test>
89+
<test name="AdminMassUpdateProductAttributesStoreViewScopeMysqlTest">
90+
<annotations>
91+
<features value="Catalog"/>
92+
<stories value="Mass update product attributes"/>
93+
<title value="Admin should be able to mass update product attributes in store view scope using the Mysql search engine"/>
94+
<description value="Admin should be able to mass update product attributes in store view scope using the Mysql search engine"/>
95+
<severity value="AVERAGE"/>
96+
<testCaseId value="MC-20467"/>
97+
<group value="Catalog"/>
98+
<group value="Product Attributes"/>
99+
<group value="SearchEngineMysql"/>
100+
</annotations>
101+
<before>
102+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
103+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" />
104+
<createData entity="ApiProductWithDescription" stepKey="createProductOne"/>
105+
<createData entity="ApiProductWithDescription" stepKey="createProductTwo"/>
106+
</before>
107+
<after>
108+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
109+
<deleteData createDataKey="createProductTwo" stepKey="deleteProductTwo"/>
110+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="AdminDeleteStoreViewActionGroup"/>
111+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
112+
</after>
113+
114+
<!-- Search and select products -->
115+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
116+
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
117+
<actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword">
118+
<argument name="keyword" value="api-simple-product"/>
119+
</actionGroup>
120+
<actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/>
121+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/>
122+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/>
123+
<!-- Mass update attributes -->
124+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
125+
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
126+
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
127+
<seeInCurrentUrl stepKey="seeInUrl" url="catalog/product_action_attribute/edit/"/>
128+
<!-- Switch store view -->
129+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewActionGroup"/>
130+
<!-- Update attribute -->
131+
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeDescriptionToggle}}" stepKey="toggleToChangeDescription"/>
132+
<fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $$createProductOne.custom_attributes[description]$$" stepKey="fillAttributeDescriptionField"/>
133+
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
134+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/>
135+
136+
<!-- Run cron twice -->
137+
<magentoCLI command="cron:run" stepKey="runCron1"/>
138+
<magentoCLI command="cron:run" stepKey="runCron2"/>
139+
<reloadPage stepKey="refreshPage"/>
140+
<waitForPageLoad stepKey="waitFormToReload1"/>
141+
142+
<!-- Assert on storefront default view -->
143+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/>
144+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault">
145+
<argument name="name" value="$$createProductOne.name$$"/>
146+
<argument name="description" value="$$createProductOne.custom_attributes[description]$$"/>
147+
</actionGroup>
148+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/>
149+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/>
150+
151+
<!-- Assert on storefront custom view -->
152+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupCustom"/>
153+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="StorefrontSwitchStoreViewActionGroup"/>
154+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameCustom">
155+
<argument name="name" value="$$createProductOne.name$$"/>
156+
<argument name="description" value="Updated $$createProductOne.custom_attributes[description]$$"/>
157+
</actionGroup>
158+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultCustom"/>
159+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/>
160+
</test>
88161
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<testCaseId value="MAGETWO-59361"/>
1919
<group value="Catalog"/>
2020
<group value="Product Attributes"/>
21+
<group value="SearchEngineElasticsearch"/>
2122
</annotations>
2223
<before>
2324
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
@@ -157,4 +158,145 @@
157158
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault2"/>
158159
<see userInput="We can't find any items matching these search criteria." selector="{{StorefrontCatalogSearchAdvancedResultMainSection.message}}" stepKey="seeInDefault2"/>
159160
</test>
161+
<test name="AdminMassUpdateProductStatusStoreViewScopeMysqlTest">
162+
<annotations>
163+
<features value="Catalog"/>
164+
<stories value="Mass update product status"/>
165+
<title value="Admin should be able to mass update product statuses in store view scope using the Mysql search engine"/>
166+
<description value="Admin should be able to mass update product statuses in store view scope using the Mysql search engine"/>
167+
<severity value="AVERAGE"/>
168+
<testCaseId value="MC-20471"/>
169+
<group value="Catalog"/>
170+
<group value="Product Attributes"/>
171+
<group value="SearchEngineMysql"/>
172+
</annotations>
173+
<before>
174+
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
175+
176+
<!--Create Website -->
177+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite">
178+
<argument name="newWebsiteName" value="Second Website"/>
179+
<argument name="websiteCode" value="second_website"/>
180+
</actionGroup>
181+
182+
<!--Create Store -->
183+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore">
184+
<argument name="website" value="Second Website"/>
185+
<argument name="storeGroupName" value="Second Store"/>
186+
<argument name="storeGroupCode" value="second_store"/>
187+
</actionGroup>
188+
189+
<!--Create Store view -->
190+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
191+
<waitForPageLoad stepKey="waitForSystemStorePage"/>
192+
<click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/>
193+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
194+
<waitForElementVisible selector="//legend[contains(., 'Store View Information')]" stepKey="waitForNewStorePageToOpen"/>
195+
<selectOption userInput="Second Store" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/>
196+
<fillField userInput="Second Store View" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/>
197+
<fillField userInput="second_store_view" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/>
198+
<selectOption selector="{{AdminNewStoreSection.statusDropdown}}" userInput="1" stepKey="enableStoreViewStatus"/>
199+
<click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreView" />
200+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal" />
201+
<see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarning" />
202+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="dismissModal" />
203+
<waitForPageLoad stepKey="waitForPageLoad2" time="180" />
204+
<waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" time="150" stepKey="waitForPageReolad"/>
205+
<see userInput="You saved the store view." stepKey="seeSavedMessage" />
206+
207+
<!--Create a Simple Product 1 -->
208+
<actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1">
209+
<argument name="product" value="simpleProductForMassUpdate"/>
210+
<argument name="website" value="Second Website"/>
211+
</actionGroup>
212+
213+
<!--Create a Simple Product 2 -->
214+
<actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2">
215+
<argument name="product" value="simpleProductForMassUpdate2"/>
216+
<argument name="website" value="Second Website"/>
217+
</actionGroup>
218+
</before>
219+
<after>
220+
<!--Delete website -->
221+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite">
222+
<argument name="websiteName" value="Second Website"/>
223+
</actionGroup>
224+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
225+
226+
<!--Delete Products -->
227+
<actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct1">
228+
<argument name="productName" value="simpleProductForMassUpdate.name"/>
229+
</actionGroup>
230+
<actionGroup ref="DeleteProductActionGroup" stepKey="deleteProduct2">
231+
<argument name="productName" value="simpleProductForMassUpdate2.name"/>
232+
</actionGroup>
233+
<actionGroup ref="logout" stepKey="amOnLogoutPage"/>
234+
</after>
235+
236+
<!-- Search and select products -->
237+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
238+
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
239+
<actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword">
240+
<argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/>
241+
</actionGroup>
242+
<actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/>
243+
244+
<!-- Filter to Second Store View -->
245+
<actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" >
246+
<argument name="customStore" value="'Second Store View'" />
247+
</actionGroup>
248+
249+
<!-- Select Product 2 -->
250+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/>
251+
252+
<!-- Mass update attributes -->
253+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
254+
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickOption"/>
255+
<click selector="{{AdminProductGridSection.bulkActionOption('Disable')}}" stepKey="clickDisabled"/>
256+
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
257+
258+
<!-- Verify Product Statuses -->
259+
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Enabled" stepKey="checkIfProduct1IsEnabled"/>
260+
<see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Disabled" stepKey="checkIfProduct2IsDisabled"/>
261+
262+
<!-- Filter to Default Store View -->
263+
<actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterDefaultStoreView">
264+
<argument name="customStore" value="'Default'" />
265+
</actionGroup>
266+
267+
<!-- Verify Product Statuses -->
268+
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Enabled" stepKey="checkIfDefaultViewProduct1IsEnabled"/>
269+
<see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Enabled" stepKey="checkIfDefaultViewProduct2IsEnabled"/>
270+
271+
<!-- Assert on storefront default view -->
272+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/>
273+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault">
274+
<argument name="name" value="{{simpleProductForMassUpdate.keyword}}"/>
275+
<argument name="description" value=""/>
276+
</actionGroup>
277+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/>
278+
<see userInput="2 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/>
279+
280+
<!-- Enable the product in Default store view -->
281+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex2"/>
282+
<waitForPageLoad stepKey="waitForProductIndexPageLoad2"/>
283+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckboxDefaultStoreView"/>
284+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckboxDefaultStoreView2"/>
285+
286+
<!-- Mass update attributes -->
287+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdownDefaultStoreView"/>
288+
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickOptionDefaultStoreView"/>
289+
<click selector="{{AdminProductGridSection.bulkActionOption('Disable')}}" stepKey="clickDisabledDefaultStoreView"/>
290+
<waitForPageLoad stepKey="waitForBulkUpdatePageDefaultStoreView"/>
291+
<see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Disabled" stepKey="checkIfProduct2IsDisabledDefaultStoreView"/>
292+
293+
<!-- Assert on storefront default view -->
294+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault2"/>
295+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup" stepKey="searchByNameDefault2">
296+
<argument name="name" value="{{simpleProductForMassUpdate.name}}"/>
297+
<argument name="description" value=""/>
298+
</actionGroup>
299+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault2"/>
300+
<see userInput="We can't find any items matching these search criteria." selector="{{StorefrontCatalogSearchAdvancedResultMainSection.message}}" stepKey="seeInDefault2"/>
301+
</test>
160302
</tests>

0 commit comments

Comments
 (0)