|
| 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="AdminValidateProductPricesOnTheFrontendWithTierPricingSetupTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Product and tax rule"/> |
| 13 | + <stories value="Create product and validate product prices on frontend"/> |
| 14 | + <title value="Create product and validate product tier prices on frontend"/> |
| 15 | + <description value="Create product and tax rule and validate product tier prices on frontend"/> |
| 16 | + <testCaseId value="MC-43283"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Create category --> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + <!-- Admin Login --> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <!--Create Product--> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createProduct"> |
| 27 | + <field key="price">100</field> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <!-- Create Tax Rate & Rule --> |
| 31 | + <createData entity="USFullTaxRate" stepKey="initialTaxRate"/> |
| 32 | + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule"> |
| 33 | + <argument name="taxRate" value="$$initialTaxRate$$"/> |
| 34 | + <argument name="taxRule" value="SimpleTaxRule"/> |
| 35 | + </actionGroup> |
| 36 | + <!-- change configurations --> |
| 37 | + <magentoCLI command="config:set {{CustomCatalogPrices.path}} {{CustomCatalogPrices.value}}" stepKey="selectIncludingTax"/> |
| 38 | + <magentoCLI command="config:set {{CustomDisplayProductPricesInCatalog.path}} {{CustomDisplayProductPricesInCatalog.value}}" stepKey="selectInclAndExlTax"/> |
| 39 | + <magentoCLI command="cron:run --group=index" stepKey="runCronReindex"/> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <!-- delete created product --> |
| 43 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 44 | + <!-- delete created category --> |
| 45 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory1"/> |
| 46 | + <!-- delete created Tax Rate & Rule --> |
| 47 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> |
| 48 | + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}"/> |
| 49 | + </actionGroup> |
| 50 | + <deleteData createDataKey="initialTaxRate" stepKey="deleteTaxRate"/> |
| 51 | + <!-- Revert back configurations --> |
| 52 | + <magentoCLI command="config:set {{CatalogPrices.path}} {{CatalogPrices.value}}" stepKey="setExlTax"/> |
| 53 | + <magentoCLI command="config:set {{DisplayProductPricesInCatalog.path}} {{DisplayProductPricesInCatalog.value}}" stepKey="selectExlTax"/> |
| 54 | + <magentoCron groups="index" stepKey="reindex"/> |
| 55 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> |
| 56 | + <argument name="tags" value="full_page"/> |
| 57 | + </actionGroup> |
| 58 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 59 | + </after> |
| 60 | + |
| 61 | + <!-- Go to product page --> |
| 62 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="GoToProductPage"> |
| 63 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 64 | + </actionGroup> |
| 65 | + <waitForPageLoad stepKey="waitForAssertPrices"/> |
| 66 | + |
| 67 | + <!-- Check Incl & Exl Tax prices --> |
| 68 | + <see stepKey="seeNewPriceSide" selector="{{StorefrontProductInfoMainSection.includingTaxPrice}}" userInput="$100.00"/> |
| 69 | + <see stepKey="seeNewPriceSide1" selector="{{StorefrontProductInfoMainSection.excludingTaxPrice}}" userInput="$90.91"/> |
| 70 | + |
| 71 | + </test> |
| 72 | +</tests> |
0 commit comments