|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminConfigurableProductBulkUpdateTest"> |
| 11 | + <annotations> |
| 12 | + <features value="ConfigurableProduct"/> |
| 13 | + <stories value="Create, Read, Update, Delete"/> |
| 14 | + <title value="Admin should be able to bulk update attributes of configurable products"/> |
| 15 | + <description value="Admin should be able to bulk update attributes of configurable products"/> |
| 16 | + <testCaseId value="MC-88"/> |
| 17 | + <group value="ConfigurableProduct"/> |
| 18 | + <severity value="AVERAGE"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="ApiConfigurableProduct" stepKey="createProduct1"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <createData entity="ApiConfigurableProduct" stepKey="createProduct2"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="ApiConfigurableProduct" stepKey="createProduct3"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 33 | + </before> |
| 34 | + |
| 35 | + <after> |
| 36 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 37 | + <deleteData createDataKey="createProduct1" stepKey="deleteFirstProduct"/> |
| 38 | + <deleteData createDataKey="createProduct2" stepKey="deleteSecondProduct"/> |
| 39 | + <deleteData createDataKey="createProduct3" stepKey="deleteThirdProduct"/> |
| 40 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> |
| 41 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 42 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> |
| 43 | + <actionGroup ref="logout" stepKey="logout"/> |
| 44 | + </after> |
| 45 | + |
| 46 | + <!-- Search for prefix of the 3 products we created via api --> |
| 47 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> |
| 48 | + <waitForPageLoad stepKey="wait1"/> |
| 49 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearAll"/> |
| 50 | + <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> |
| 51 | + <argument name="keyword" value="ApiConfigurableProduct.name"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <!-- Select all, then start the bulk update attributes flow --> |
| 55 | + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> |
| 56 | + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> |
| 57 | + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> |
| 58 | + <click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickBulkUpdate"/> |
| 59 | + <waitForPageLoad stepKey="wait2"/> |
| 60 | + |
| 61 | + <!-- Update the description --> |
| 62 | + <click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToggleDescription"/> |
| 63 | + <fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="MFTF automation!" stepKey="fillDescription"/> |
| 64 | + <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSave"/> |
| 65 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" time="60" stepKey="waitForSuccessMessage"/> |
| 66 | + <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/> |
| 67 | + |
| 68 | + <comment userInput="Apply changes" stepKey="runCron1"/> |
| 69 | + <comment userInput="Run consumer to apply changes" stepKey="runCron2"/> |
| 70 | + <actionGroup ref="CliConsumerStartActionGroup" stepKey="reindex"> |
| 71 | + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> |
| 72 | + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> |
| 73 | + </actionGroup> |
| 74 | + |
| 75 | + <!-- Check storefront for description --> |
| 76 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct1.custom_attributes[url_key]$$)}}" stepKey="goToFirstProductPageOnStorefront"/> |
| 77 | + <waitForPageLoad stepKey="waitForFirstProductPageLoad"/> |
| 78 | + <see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="MFTF automation!" stepKey="seeFirstDescription"/> |
| 79 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct2.custom_attributes[url_key]$$)}}" stepKey="goToSecondProductPageOnStorefront"/> |
| 80 | + <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> |
| 81 | + <see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="MFTF automation!" stepKey="seeSecondDescription"/> |
| 82 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct3.custom_attributes[url_key]$$)}}" stepKey="goToThirdProductPageOnStorefront"/> |
| 83 | + <waitForPageLoad stepKey="waitForThirdProductPageLoad"/> |
| 84 | + <see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="MFTF automation!" stepKey="seeThirdDescription"/> |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments