|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest"> |
| 10 | + <annotations> |
| 11 | + <features value="Catalog"/> |
| 12 | + <stories value="Update price"/> |
| 13 | + <title value="Child Product price is updated according to updated prices from backend"/> |
| 14 | + <description value="Update the simple product price that is under configurable and validate the updated price in the front end"/> |
| 15 | + <severity value="MAJOR"/> |
| 16 | + <testCaseId value="AC-2031"/> |
| 17 | + <group value="Catalog"/> |
| 18 | + </annotations> |
| 19 | + |
| 20 | + <before> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 22 | + <actionGroup ref="UpdateAllIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"/> |
| 23 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 24 | + <magentoCLI command="indexer:reindex" stepKey="performReindex"/> |
| 25 | + <magentoCLI command="cache:flush" stepKey="cleanCache"/> |
| 26 | + </before> |
| 27 | + |
| 28 | + <after> |
| 29 | + <deleteData createDataKey="createFirstConfigProduct" stepKey="deleteConfigProduct"/> |
| 30 | + <deleteData createDataKey="createFirstConfigFirstChildProduct" stepKey="deleteFirstConfigFirstChildProduct"/> |
| 31 | + <deleteData createDataKey="firstSimpleCategory" stepKey="deleteCategory"/> |
| 32 | + <deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/> |
| 33 | + <comment userInput="The test was moved to elasticsearch suite" stepKey="resetCatalogSearchConfiguration"/> |
| 34 | + <actionGroup ref="AdminAllIndexerSetUpdateOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"/> |
| 35 | + <magentoCLI command="indexer:reindex" stepKey="performReindex"/> |
| 36 | + <magentoCLI command="cache:flush" stepKey="cleanCache"/> |
| 37 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 38 | + </after> |
| 39 | + |
| 40 | + <!-- Create category for configurable product --> |
| 41 | + <createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/> |
| 42 | + |
| 43 | + <!-- Create configurable product with two options --> |
| 44 | + <createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct"> |
| 45 | + <requiredEntity createDataKey="firstSimpleCategory"/> |
| 46 | + </createData> |
| 47 | + |
| 48 | + <createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/> |
| 49 | + |
| 50 | + <createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption"> |
| 51 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 52 | + </createData> |
| 53 | + <createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption"> |
| 54 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 55 | + </createData> |
| 56 | + |
| 57 | + <createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet"> |
| 58 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 59 | + </createData> |
| 60 | + |
| 61 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption"> |
| 62 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 63 | + </getData> |
| 64 | + |
| 65 | + <!-- Create one child product for configurable product --> |
| 66 | + <createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct"> |
| 67 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 68 | + <requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/> |
| 69 | + </createData> |
| 70 | + |
| 71 | + <createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption"> |
| 72 | + <requiredEntity createDataKey="createFirstConfigProduct"/> |
| 73 | + <requiredEntity createDataKey="createFirstConfigProductAttribute"/> |
| 74 | + <requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/> |
| 75 | + </createData> |
| 76 | + |
| 77 | + <createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild"> |
| 78 | + <requiredEntity createDataKey="createFirstConfigProduct"/> |
| 79 | + <requiredEntity createDataKey="createFirstConfigFirstChildProduct"/> |
| 80 | + </createData> |
| 81 | + |
| 82 | + <!-- Assert first product in category --> |
| 83 | + <magentoCLI command="cron:run" stepKey="runCron"/> |
| 84 | + <amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront"/> |
| 85 | + <waitForPageLoad stepKey="waitForFirstCategoryPageLoad"/> |
| 86 | + |
| 87 | + <actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory"> |
| 88 | + <argument name="productName" value="$$createFirstConfigProduct.name$$"/> |
| 89 | + <argument name="expectedPrice" value="$$createFirstConfigFirstChildProduct.price$$"/> |
| 90 | + </actionGroup> |
| 91 | + |
| 92 | + <!-- Search default simple product in grid --> |
| 93 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> |
| 94 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> |
| 95 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> |
| 96 | + <argument name="product" value="$$createFirstConfigFirstChildProduct$$"/> |
| 97 | + </actionGroup> |
| 98 | + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> |
| 99 | + |
| 100 | + <!-- Update default simple product with price --> |
| 101 | + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="150" stepKey="fillSimpleProductPrice"/> |
| 102 | + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickButtonSave"/> |
| 103 | + |
| 104 | + <!-- Verify customer see success message --> |
| 105 | + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> |
| 106 | + |
| 107 | + <!-- Assert first product in category --> |
| 108 | + <magentoCLI command="cron:run" stepKey="runCron1"/> |
| 109 | + <wait time="60" stepKey="waitForUpdateStarts"/> |
| 110 | + |
| 111 | + <amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront1"/> |
| 112 | + <waitForPageLoad stepKey="waitForFirstCategoryPageLoad1"/> |
| 113 | + |
| 114 | + <actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory1"> |
| 115 | + <argument name="productName" value="$$createFirstConfigProduct.name$$"/> |
| 116 | + <argument name="expectedPrice" value="150"/> |
| 117 | + </actionGroup> |
| 118 | + </test> |
| 119 | +</tests> |
0 commit comments