|
| 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="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminCatalogPriceRuleWithUndefinedProductDropdownAttributeConditionTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CatalogRule"/> |
| 14 | + <stories value="Create catalog price rule"/> |
| 15 | + <title value="Enable 'is undefined' condition to Scope Catalog Price rules by custom 'Dropdown' product attribute"/> |
| 16 | + <description value="Checks discount will applies with Catalog Price Rule with 'is undefined' of 'Dropdown' Product Attribute condition"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-13654"/> |
| 19 | + <useCaseId value="MC-10971"/> |
| 20 | + <group value="CatalogRule"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create Category, two Products in it and "Yesno" Product attribute --> |
| 24 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 25 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + <createData entity="SimpleProduct" stepKey="createSecondProduct"> |
| 29 | + <requiredEntity createDataKey="createCategory"/> |
| 30 | + </createData> |
| 31 | + <createData entity="productDropDownAttribute" stepKey="createProductAttribute"> |
| 32 | + <field key="scope">website</field> |
| 33 | + </createData> |
| 34 | + <!-- Add Product Attribute to Default Set --> |
| 35 | + <createData entity="AddToDefaultSet" stepKey="addProductAttributeToDefaultSet"> |
| 36 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 37 | + </createData> |
| 38 | + |
| 39 | + <!--Create Catalog Price Rule--> |
| 40 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 41 | + <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingCatalogPriceRule"/> |
| 42 | + <actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForCatalogPriceRule"> |
| 43 | + <argument name="name" value="{{_defaultCatalogRule.name}}"/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition"> |
| 46 | + <argument name="attributeName" value="$createProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 47 | + <argument name="targetValue" value="is"/> |
| 48 | + <argument name="targetSelectValue" value="is undefined"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule"/> |
| 51 | + <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> |
| 52 | + <!-- Reindex after Catalog Price Rule creation --> |
| 53 | + <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="runIndexerUsingCronAfterCatalogPriceRuleCreated"/> |
| 54 | + <wait time="1" stepKey="waitForReindex"/> |
| 55 | + </before> |
| 56 | + <after> |
| 57 | + <!-- Delete created via API data --> |
| 58 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 59 | + <deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/> |
| 60 | + <deleteData createDataKey="createCategory" stepKey="deleteFirstCategory"/> |
| 61 | + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> |
| 62 | + <!-- Delete Catalog Price Rule --> |
| 63 | + <actionGroup ref="RemoveCatalogPriceRule" stepKey="deleteCatalogPriceRule"> |
| 64 | + <argument name="ruleName" value="{{_defaultCatalogRule.name}}"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 67 | + <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="runIndexerUsingCronAfterAttributesWasDeleted"/> |
| 68 | + </after> |
| 69 | + |
| 70 | + <!-- Check Catalog Price Rule has been affected on Product prices --> |
| 71 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProduct"> |
| 72 | + <argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertProductPrices"> |
| 75 | + <argument name="productPrice" value="$123.00"/> |
| 76 | + <argument name="productFinalPrice" value="$110.70"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openSecondProduct"> |
| 79 | + <argument name="productUrlKey" value="$createSecondProduct.custom_attributes[url_key]$"/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertSecondProductPrices"> |
| 82 | + <argument name="productPrice" value="$123.00"/> |
| 83 | + <argument name="productFinalPrice" value="$110.70"/> |
| 84 | + </actionGroup> |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments