|
| 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="AdminEnableAttributeIsUndefinedCatalogPriceRuleTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CatalogRule"/> |
| 14 | + <title value="Enable 'is undefined' condition to Scope Catalog Price rules by custom product attribute"/> |
| 15 | + <description value="Enable 'is undefined' condition to Scope Catalog Price rules by custom product attribute"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-13654"/> |
| 18 | + <useCaseId value="MC-10971"/> |
| 19 | + <group value="CatalogRule"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 23 | + |
| 24 | + <createData entity="CatalogRuleWithAllCustomerGroups" stepKey="createCatalogPriceRule"/> |
| 25 | + <createData entity="ApiCategory" stepKey="createFirstCategory"/> |
| 26 | + <createData entity="ApiSimpleProduct" stepKey="createFirstProduct"> |
| 27 | + <requiredEntity createDataKey="createFirstCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="SimpleProduct" stepKey="createSecondProduct"> |
| 30 | + <requiredEntity createDataKey="createFirstCategory"/> |
| 31 | + </createData> |
| 32 | + <createData entity="productYesNoAttribute" stepKey="createProductAttribute"/> |
| 33 | + <createData entity="AddToDefaultSet" stepKey="addToAttributeSetHandle"> |
| 34 | + <requiredEntity createDataKey="createProductAttribute"/> |
| 35 | + </createData> |
| 36 | + |
| 37 | + <createData entity="SimpleSubCategory" stepKey="createSecondCategory"/> |
| 38 | + <createData entity="SimpleProduct3" stepKey="createThirdProduct"> |
| 39 | + <requiredEntity createDataKey="createSecondCategory"/> |
| 40 | + </createData> |
| 41 | + <createData entity="SimpleProduct4" stepKey="createForthProduct"> |
| 42 | + <requiredEntity createDataKey="createSecondCategory"/> |
| 43 | + </createData> |
| 44 | + <createData entity="productDropDownAttribute" stepKey="createSecondProductAttribute"> |
| 45 | + <field key="scope">website</field> |
| 46 | + </createData> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + |
| 50 | + <!--Delete created data--> |
| 51 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/> |
| 52 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule"> |
| 53 | + <argument name="name" value="{{CatalogRuleWithAllCustomerGroups.name}}"/> |
| 54 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 55 | + </actionGroup> |
| 56 | + <click stepKey="resetFilters" selector="{{AdminSecondaryGridSection.resetFilters}}"/> |
| 57 | + <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> |
| 58 | + <deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/> |
| 59 | + <deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/> |
| 60 | + <deleteData createDataKey="createThirdProduct" stepKey="deleteThirdProduct"/> |
| 61 | + <deleteData createDataKey="createForthProduct" stepKey="deleteForthProduct"/> |
| 62 | + <deleteData createDataKey="createSecondCategory" stepKey="deleteSecondCategory"/> |
| 63 | + <deleteData createDataKey="createSecondProductAttribute" stepKey="deleteSecondProductAttribute"/> |
| 64 | + |
| 65 | + <actionGroup ref="logout" stepKey="logout"/> |
| 66 | + </after> |
| 67 | + |
| 68 | + <!--Create catalog price rule--> |
| 69 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/> |
| 70 | + <waitForPageLoad stepKey="waitForPriceRulePage"/> |
| 71 | + <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule"> |
| 72 | + <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition"> |
| 75 | + <argument name="attributeName" value="$$createProductAttribute.attribute[frontend_labels][0][label]$$"/> |
| 76 | + <argument name="targetValue" value="is"/> |
| 77 | + <argument name="targetSelectValue" value="is undefined"/> |
| 78 | + </actionGroup> |
| 79 | + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveRule"/> |
| 80 | + |
| 81 | + <!--Check Catalog Price Rule for first product--> |
| 82 | + <amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToFirstProductPage"/> |
| 83 | + <waitForPageLoad stepKey="waitForFirstProductPageLoad"/> |
| 84 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="grabFirstProductUpdatedPrice"/> |
| 85 | + <assertEquals expected='$110.70' expectedType="string" actual="($grabFirstProductUpdatedPrice)" stepKey="assertFirstProductUpdatedPrice"/> |
| 86 | + |
| 87 | + <!--Check Catalog Price Rule for second product--> |
| 88 | + <amOnPage url="{{StorefrontProductPage.url($$createSecondProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSecondProductPage"/> |
| 89 | + <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> |
| 90 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="grabSecondProductUpdatedPrice"/> |
| 91 | + <assertEquals expected='$110.70' expectedType="string" actual="($grabFirstProductUpdatedPrice)" stepKey="assertSecondProductUpdatedPrice"/> |
| 92 | + |
| 93 | + <!--Delete previous attribute and Catalog Price Rule--> |
| 94 | + <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> |
| 95 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/> |
| 96 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule"> |
| 97 | + <argument name="name" value="{{CatalogRuleWithAllCustomerGroups.name}}"/> |
| 98 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 99 | + </actionGroup> |
| 100 | + |
| 101 | + <!--Add new attribute to Default set--> |
| 102 | + <createData entity="AddToDefaultSet" stepKey="addToAttributeSetHandle1"> |
| 103 | + <requiredEntity createDataKey="createSecondProductAttribute"/> |
| 104 | + </createData> |
| 105 | + |
| 106 | + <!--Create new Catalog Price Rule--> |
| 107 | + <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule1"> |
| 108 | + <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> |
| 109 | + </actionGroup> |
| 110 | + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition1"> |
| 111 | + <argument name="attributeName" value="$$createSecondProductAttribute.attribute[frontend_labels][0][label]$$"/> |
| 112 | + <argument name="targetValue" value="is"/> |
| 113 | + <argument name="targetSelectValue" value="is undefined"/> |
| 114 | + </actionGroup> |
| 115 | + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveRule1"/> |
| 116 | + |
| 117 | + <!--Check Catalog Price Rule for third product--> |
| 118 | + <amOnPage url="{{StorefrontProductPage.url($$createThirdProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToThirdProductPage"/> |
| 119 | + <waitForPageLoad stepKey="waitForThirdProductPageLoad"/> |
| 120 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="grabThirdProductUpdatedPrice"/> |
| 121 | + <assertEquals expected='$110.70' expectedType="string" actual="($grabThirdProductUpdatedPrice)" stepKey="assertThirdProductUpdatedPrice"/> |
| 122 | + |
| 123 | + <!--Check Catalog Price Rule for forth product--> |
| 124 | + <amOnPage url="{{StorefrontProductPage.url($$createForthProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToForthProductPage"/> |
| 125 | + <waitForPageLoad stepKey="waitForForthProductPageLoad"/> |
| 126 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="grabForthProductUpdatedPrice"/> |
| 127 | + <assertEquals expected='$110.70' expectedType="string" actual="($grabForthProductUpdatedPrice)" stepKey="assertForthProductUpdatedPrice"/> |
| 128 | + </test> |
| 129 | +</tests> |
0 commit comments