|
| 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="AdminFixedTaxValSavedForSpecificWebsiteTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Tax"/> |
| 14 | + <title value="Fixed Product Tax value is saved correctly for Specific Website"/> |
| 15 | + <description value="Fixed Product Tax value is saved correctly for Specific Website"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MC-17182"/> |
| 18 | + <useCaseId value=" MC-17014"/> |
| 19 | + <group value="tax"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create product attribute and add it to default attribute set />--> |
| 23 | + <comment userInput="Create product attribute and add it to default attribute set" stepKey="createAttrAndAddToDefaultAttrSet"/> |
| 24 | + <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> |
| 25 | + <createData entity="AddToDefaultSet" stepKey="addToDefaultAttributeSet"> |
| 26 | + <requiredEntity createDataKey="createProductFPTAttribute"/> |
| 27 | + </createData> |
| 28 | + <!-- Create product, category and log in --> |
| 29 | + <comment userInput="Create product, category and log in" stepKey="createDataAndLogIn"/> |
| 30 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 31 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 32 | + <requiredEntity createDataKey="createCategory"/> |
| 33 | + </createData> |
| 34 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 35 | + <!-- Create website, store and store view --> |
| 36 | + <comment userInput="Create website, store and store view" stepKey="createWebsite"/> |
| 37 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> |
| 38 | + <argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> |
| 39 | + <argument name="websiteCode" value="{{NewWebSiteData.code}}"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStore"> |
| 42 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 43 | + <argument name="storeGroupName" value="{{NewStoreData.name}}"/> |
| 44 | + <argument name="storeGroupCode" value="{{NewStoreData.code}}"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> |
| 47 | + <argument name="StoreGroup" value="NewStoreData"/> |
| 48 | + <argument name="customStore" value="storeViewData"/> |
| 49 | + </actionGroup> |
| 50 | + <!--Set catalog price scope to Global--> |
| 51 | + <comment userInput="Set catalog price scope to Global" stepKey="commentSetPriceScope"/> |
| 52 | + <magentoCLI command="config:set catalog/price/scope 0" stepKey="setPriceScopeGlobal"/> |
| 53 | + <magentoCLI command="indexer:reindex catalog_product_price" stepKey="reindex"/> |
| 54 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 55 | + </before> |
| 56 | + <after> |
| 57 | + <!--Set catalog price scope to Global--> |
| 58 | + <comment userInput="Set catalog price scope to Global" stepKey="commentSetPriceScope"/> |
| 59 | + <magentoCLI command="config:set catalog/price/scope 0" stepKey="setPriceScopeGlobal"/> |
| 60 | + <!-- Delete created data and log out --> |
| 61 | + <comment userInput="Delete created data and log out" stepKey="deleteDataAndLogOut"/> |
| 62 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 63 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 64 | + <deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/> |
| 65 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteCustomWebsite"> |
| 66 | + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> |
| 69 | + </after> |
| 70 | + <!-- Go to product edit page and assign it to created website --> |
| 71 | + <comment userInput="Go to product edit page and assign it to created website" stepKey="assignProductToCreatedWebsite"/> |
| 72 | + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="navigateToProductPage"/> |
| 73 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 74 | + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct"> |
| 75 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="saveProductForm" stepKey="saveProductFirstTime"/> |
| 78 | + <!-- Add Fixed Product Tax attribute --> |
| 79 | + <comment userInput="Add Fixed Product Tax attribute" stepKey="addFixedProdTaxAttr"/> |
| 80 | + <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFixedProductTaxAttr"> |
| 81 | + <argument name="FPTAttributeCode" value="$$createProductFPTAttribute.attribute_code$$"/> |
| 82 | + <argument name="stateForFPT" value="California"/> |
| 83 | + <argument name="valueForFPT" value="10"/> |
| 84 | + </actionGroup> |
| 85 | + <actionGroup ref="saveProductForm" stepKey="saveProductSecondTime"/> |
| 86 | + <!-- Check if created tax attribute is saved --> |
| 87 | + <comment userInput="Check if created tax attribute is saved" stepKey="checkThatTaxAttributeIsSaved"/> |
| 88 | + <seeElement selector="{{AdminProductAddFPTValueSection.setTaxValueForFPT($$createProductFPTAttribute.attribute_code$$)}}" stepKey="checkIfTaxAttributeSaved"/> |
| 89 | + <!--See available websites only 'All Websites'--> |
| 90 | + <comment userInput="See available websites only 'All Websites'" stepKey="commentCheckWebsitesDropDown"/> |
| 91 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="seeAllWebsites"/> |
| 92 | + <dontSeeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, NewWebSiteData.name)}}" stepKey="dontSeeSecondWebsite"/> |
| 93 | + <dontSeeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="dontSeeMainWebsite"/> |
| 94 | + <!--Set catalog price scope to Website--> |
| 95 | + <comment userInput="Set catalog price scope to Website" stepKey="commentSetPriceScope"/> |
| 96 | + <magentoCLI command="config:set catalog/price/scope 1" stepKey="setPriceScopeWebsite"/> |
| 97 | + <magentoCLI command="indexer:reindex catalog_product_price" stepKey="reindex"/> |
| 98 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 99 | + <!--See available websites only 'All Websites'--> |
| 100 | + <comment userInput="See available websites 'All Websites', 'Main Website' and Second website" stepKey="commentCheckWebsitesInProductPage"/> |
| 101 | + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductPageSecondTime"/> |
| 102 | + <waitForPageLoad stepKey="waitForProductPageLoadSecondTime"/> |
| 103 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDown"/> |
| 104 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkMainWebsiteInDropDown"/> |
| 105 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, NewWebSiteData.name)}}" stepKey="checkSecondWebsitesInDropDown"/> |
| 106 | + <actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> |
| 107 | + <argument name="website" value="{{_defaultWebsite.name}}"/> |
| 108 | + </actionGroup> |
| 109 | + <actionGroup ref="saveProductForm" stepKey="saveProductThirdTime"/> |
| 110 | + <waitForPageLoad stepKey="waitForSavedProductLoad"/> |
| 111 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDownSecondTime"/> |
| 112 | + <dontSeeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkNoMainWebsiteInDropDown"/> |
| 113 | + <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, NewWebSiteData.name)}}" stepKey="checkSecondWebsitesInDropDownSecondTime"/> |
| 114 | + <!-- Check if created tax attribute is saved --> |
| 115 | + <comment userInput="Check if created tax attribute is saved" stepKey="checkTaxAttributeIsSaved"/> |
| 116 | + <seeInField selector="{{AdminProductAddFPTValueSection.setTaxValueForFPT($$createProductFPTAttribute.attribute_code$$)}}" userInput="10" stepKey="checkTaxAttributeSaved"/> |
| 117 | + </test> |
| 118 | +</tests> |
0 commit comments