|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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="AdminProductAttributeAdminValuesUsedInsteadOfDefaultValueTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Backend"/> |
| 13 | + <stories value="Product attribute admin values should be used in backend"/> |
| 14 | + <title value="Product attribute admin values should be used instead of default store view values in backend"/> |
| 15 | + <description value="Verify that product attribute admin values should be used in cart price rule instead of default store view values in backend"/> |
| 16 | + <testCaseId value="AC-13048"/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + <group value="backend"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="productAttributeMultiselectTwoOptions" stepKey="createColourProductAttribute"/> |
| 22 | + </before> |
| 23 | + <after> |
| 24 | + <!-- Delete cart price rule --> |
| 25 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> |
| 26 | + <argument name="ruleName" value="{{CustomSalesRuleWithNoCouponCode.name}}"/> |
| 27 | + </actionGroup> |
| 28 | + <!-- Delete attribute --> |
| 29 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 30 | + <argument name="ProductAttribute" value="$$createColourProductAttribute$$"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/> |
| 33 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 34 | + </after> |
| 35 | + <!-- Login as admin --> |
| 36 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 37 | + <!--Step-1 Set Admin value & Default store view value in product attribute & Save the product --> |
| 38 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 39 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 40 | + <argument name="ProductAttribute" value="$$createColourProductAttribute$$"/> |
| 41 | + </actionGroup> |
| 42 | + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="$$createColourProductAttribute.attribute_code$$" stepKey="fillDefaultLabel"/> |
| 43 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createColourOptionWhichAsDifferentValuesInAdminAndDefaultStoreView"> |
| 44 | + <argument name="adminName" value="{{productAttributeColour.black}}"/> |
| 45 | + <argument name="frontName" value="{{productAttributeColour.gold}}"/> |
| 46 | + <argument name="row" value="1"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/> |
| 49 | + <!-- Product Attribute added to default Attribute set --> |
| 50 | + <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> |
| 51 | + <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> |
| 52 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 53 | + <argument name="group" value="Product Details"/> |
| 54 | + <argument name="attribute" value="$$createColourProductAttribute.attribute_code$$"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 57 | + <!--Step 2: Create cart price rule with custom condition and verify admin value is displayed under product attribute combination --> |
| 58 | + <actionGroup ref="AdminCreateCartPriceRuleActionGroup" stepKey="createCartPriceRule"> |
| 59 | + <argument name="ruleName" value="CustomSalesRuleWithNoCouponCode"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="filterCreatedCartPriceRule"> |
| 62 | + <argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="AdminCreateCustomConditionWithMultipleSelectInCartPriceRuleActionGroup" stepKey="createProductAttributeCombinationCondition"> |
| 65 | + <argument name="productAttribute" value="$$createColourProductAttribute.attribute_code$$"/> |
| 66 | + </actionGroup> |
| 67 | + <waitForText selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.black}}" stepKey="verifyAdminValueIsVisibleInTheConditionInsteadOfDefaultStoreViewValue"/> |
| 68 | + <dontSee selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.gold}}" stepKey="verifyDefaultStoreViewValueIsNotVisible"/> |
| 69 | + <actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveAndAssertCartPriceRuleSuccessSaveMessage"/> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments