|
| 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="ValidateConfigurableProductPriceIsChangedWhenOptionSelectedTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Configurable product price is not changed when option is selected"/> |
| 14 | + <title value="Validate configurable product price need to be change when option is selected"/> |
| 15 | + <description value="Validate configurable product price need to be change when option is selected"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-8423"/> |
| 18 | + <group value="Catalog"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct1"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct2"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 30 | + </before> |
| 31 | + <after> |
| 32 | + <deleteData createDataKey="createConfigurableProduct1" stepKey="deleteConfigurableProduct1"/> |
| 33 | + <deleteData createDataKey="createConfigurableProduct2" stepKey="deleteConfigurableProduct2"/> |
| 34 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 35 | + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> |
| 36 | + <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 37 | + </actionGroup> |
| 38 | + <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> |
| 39 | + <click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/> |
| 40 | + <waitForPageLoad stepKey="waitForDeletion"/> |
| 41 | + <!-- Delete color attribute --> |
| 42 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> |
| 43 | + <argument name="ProductAttribute" value="ProductColorAttribute"/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidget"> |
| 46 | + <argument name="widget" value="ConfigurableProductsListWidget"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 49 | + </after> |
| 50 | + |
| 51 | + <!--Navigate to Stores > Attributes > Product.--> |
| 52 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 53 | + |
| 54 | + <!--Create new Product Attribute as TextField, with code and default value.--> |
| 55 | + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> |
| 56 | + <argument name="attribute" value="dropdownProductAttribute"/> |
| 57 | + </actionGroup> |
| 58 | + |
| 59 | + <!--Navigate to Product Attribute, add Product Options and Save - 1--> |
| 60 | + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> |
| 61 | + <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 62 | + </actionGroup> |
| 63 | + <!-- Set scope to global --> |
| 64 | + <actionGroup ref="AdminSwitchScopeForProductAttributeActionGroup" stepKey="switchScopeForProductAttribute"/> |
| 65 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> |
| 66 | + <argument name="adminName" value="Small"/> |
| 67 | + <argument name="frontName" value="Small"/> |
| 68 | + <argument name="row" value="1"/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> |
| 71 | + <argument name="adminName" value="Medium"/> |
| 72 | + <argument name="frontName" value="Medium"/> |
| 73 | + <argument name="row" value="2"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption3"> |
| 76 | + <argument name="adminName" value="Large"/> |
| 77 | + <argument name="frontName" value="Large"/> |
| 78 | + <argument name="row" value="3"/> |
| 79 | + </actionGroup> |
| 80 | + <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> |
| 81 | + <!--Create text swatch attribute with 3 options: Black, White and Blue--> |
| 82 | + <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> |
| 83 | + <argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> |
| 84 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 85 | + <argument name="option1" value="Black"/> |
| 86 | + <argument name="option2" value="White"/> |
| 87 | + <argument name="option3" value="Blue"/> |
| 88 | + <argument name="usedInProductListing" value="Yes"/> |
| 89 | + </actionGroup> |
| 90 | + <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct1.id$)}}" stepKey="goToConfigurableProduct1"/> |
| 91 | + |
| 92 | + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionWithUniquePricesActionGroup" stepKey="createConfigurationProductWithAttribute1"> |
| 93 | + <argument name="attributeCode" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 94 | + <argument name="attributeOption" value="Medium"/> |
| 95 | + <argument name="attributeSelection" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 96 | + </actionGroup> |
| 97 | + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct1" /> |
| 98 | + |
| 99 | + <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct2.id$)}}" stepKey="goToConfigurableProduct2"/> |
| 100 | + |
| 101 | + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionWithUniquePricesActionGroup" stepKey="createConfigurationProductWithAttribute2"> |
| 102 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 103 | + <argument name="attributeOption" value="Blue"/> |
| 104 | + <argument name="attributeSelection" value="{{ProductColorAttribute.frontend_label}}"/> |
| 105 | + </actionGroup> |
| 106 | + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionWithUniquePricesActionGroup" stepKey="createConfigurationProductWithAttribute3"> |
| 107 | + <argument name="attributeCode" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 108 | + <argument name="attributeOption" value="Medium"/> |
| 109 | + <argument name="attributeSelection" value="{{dropdownProductAttribute.attribute_code}}"/> |
| 110 | + </actionGroup> |
| 111 | + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct2" /> |
| 112 | + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="createWidgetPage"/> |
| 113 | + <actionGroup ref="AdminCreateConfigurableProductsListWidgetActionGroup" stepKey="fillForm"> |
| 114 | + <argument name="widget" value="ConfigurableProductsListWidget"/> |
| 115 | + <argument name="configProductSku" value="$$createConfigurableProduct1.sku$$"/> |
| 116 | + <argument name="widgetTitle" value="Catalog Products List"/> |
| 117 | + <argument name="numberOfProductsPerPage" value="1"/> |
| 118 | + <argument name="numberOfProductsToDisplay" value="1"/> |
| 119 | + </actionGroup> |
| 120 | + <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct1.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontConfigProductPage1"/> |
| 121 | + <waitForPageLoad stepKey="waitForConfigPageLoad"/> |
| 122 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="configProductSmallPriceText"/> |
| 123 | + <selectOption userInput="Large +$1.00" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectSecondOption"/> |
| 124 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="configProductLargePriceText"/> |
| 125 | + <assertNotEquals stepKey="assertChange"> |
| 126 | + <expectedResult type="string">$configProductSmallPriceText</expectedResult> |
| 127 | + <actualResult type="string">$configProductLargePriceText</actualResult> |
| 128 | + </assertNotEquals> |
| 129 | + </test> |
| 130 | +</tests> |
0 commit comments