|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /************************************************************************ |
| 4 | + * |
| 5 | + * Copyright 2023 Adobe |
| 6 | + * All Rights Reserved. |
| 7 | + * |
| 8 | + * NOTICE: All information contained herein is, and remains |
| 9 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 10 | + * and technical concepts contained herein are proprietary to Adobe |
| 11 | + * and its suppliers and are protected by all applicable intellectual |
| 12 | + * property laws, including trade secret and copyright laws. |
| 13 | + * Dissemination of this information or reproduction of this material |
| 14 | + * is strictly forbidden unless prior written permission is obtained |
| 15 | + * from Adobe. |
| 16 | + * ************************************************************************ |
| 17 | + */ |
| 18 | +--> |
| 19 | + |
| 20 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 22 | + <test name="StorefrontCheckSpecialPriceWithCustomOptionAndTaxTest"> |
| 23 | + <annotations> |
| 24 | + <features value="Catalog"/> |
| 25 | + <stories value="Check special price with custom option and tax" /> |
| 26 | + <title value="Regular price should include tax for custom option"/> |
| 27 | + <description value="Regular price should include tax for custom option when product has special price"/> |
| 28 | + <severity value="MAJOR"/> |
| 29 | + <testCaseId value="AC-10576"/> |
| 30 | + <useCaseId value="ACP2E-2245"/> |
| 31 | + <group value="Catalog"/> |
| 32 | + <group value="cloud"/> |
| 33 | + </annotations> |
| 34 | + <before> |
| 35 | + <!-- log in as admin --> |
| 36 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 37 | + |
| 38 | + <!-- Create product --> |
| 39 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 40 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 41 | + <requiredEntity createDataKey="createCategory"/> |
| 42 | + <field key="price">110</field> |
| 43 | + </createData> |
| 44 | + <updateData createDataKey="createSimpleProduct" entity="productWithCustomOptions" stepKey="updateProductWithCustomOption"/> |
| 45 | + |
| 46 | + <!-- Create tax rate for US --> |
| 47 | + <createData entity="USFullTaxRate" stepKey="createTaxRateUS"/> |
| 48 | + <!-- Create Tax Rule --> |
| 49 | + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule"> |
| 50 | + <argument name="taxRate" value="$$createTaxRateUS$$"/> |
| 51 | + <argument name="taxRule" value="SimpleTaxRule"/> |
| 52 | + </actionGroup> |
| 53 | + |
| 54 | + <!-- Set up catalog to store product price including tax --> |
| 55 | + <magentoCLI command="config:set tax/calculation/price_includes_tax 1" stepKey="enableCatalogIncludingTax"/> |
| 56 | + |
| 57 | + <!-- Display product price including tax in catalog --> |
| 58 | + <magentoCLI command="config:set tax/display/type 2" stepKey="enableShowIncludingTax"/> |
| 59 | + |
| 60 | + <!-- Display product price including tax in shopping cart --> |
| 61 | + <magentoCLI command="config:set tax/cart_display/price 2" stepKey="enableShowIncludingTaxInCart"/> |
| 62 | + |
| 63 | + <!-- Set Origin Country as Great Britain --> |
| 64 | + <magentoCLI command="config:set shipping/origin/country_id GB" stepKey="setOriginCountryToGB"/> |
| 65 | + </before> |
| 66 | + <after> |
| 67 | + <!-- Set Origin Country as United States --> |
| 68 | + <magentoCLI command="config:set shipping/origin/country_id US" stepKey="setOriginCountryToUS"/> |
| 69 | + |
| 70 | + <!-- Display product price excluding tax in shopping cart --> |
| 71 | + <magentoCLI command="config:set tax/cart_display/price 0" stepKey="disableShowIncludingTaxInCart"/> |
| 72 | + |
| 73 | + <!-- Display product price excluding tax in catalog --> |
| 74 | + <magentoCLI command="config:set tax/display/type 0" stepKey="disableShowIncludingTax"/> |
| 75 | + |
| 76 | + <!-- Set up catalog to store product price excluding tax --> |
| 77 | + <magentoCLI command="config:set tax/calculation/price_includes_tax 0" stepKey="disableCatalogIncludingTax"/> |
| 78 | + |
| 79 | + <!-- Delete Tax Rule --> |
| 80 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> |
| 81 | + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}"/> |
| 82 | + </actionGroup> |
| 83 | + |
| 84 | + <!--Delete Tax Rate --> |
| 85 | + <deleteData createDataKey="createTaxRateUS" stepKey="deleteTaxRate"/> |
| 86 | + |
| 87 | + <!-- Delete product --> |
| 88 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 89 | + |
| 90 | + <!-- Delete category --> |
| 91 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 92 | + |
| 93 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 94 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/> |
| 95 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> |
| 96 | + </after> |
| 97 | + |
| 98 | + <!-- Add special price to product --> |
| 99 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> |
| 100 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 101 | + </actionGroup> |
| 102 | + |
| 103 | + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceToProduct"> |
| 104 | + <argument name="price" value="100.00"/> |
| 105 | + </actionGroup> |
| 106 | + |
| 107 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
| 108 | + |
| 109 | + <!-- Navigate to the created product page --> |
| 110 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 111 | + <argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/> |
| 112 | + </actionGroup> |
| 113 | + |
| 114 | + <!-- Assert regular and special price for product --> |
| 115 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabSpecialPrice"/> |
| 116 | + <assertEquals stepKey="assertSpecialPrice"> |
| 117 | + <actualResult type="const">$grabSpecialPrice</actualResult> |
| 118 | + <expectedResult type="string">$110.00</expectedResult> |
| 119 | + </assertEquals> |
| 120 | + |
| 121 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.oldPriceAmount}}" stepKey="grabOldPrice"/> |
| 122 | + <assertEquals stepKey="assertOldPrice"> |
| 123 | + <actualResult type="const">$grabOldPrice</actualResult> |
| 124 | + <expectedResult type="string">$121.00</expectedResult> |
| 125 | + </assertEquals> |
| 126 | + |
| 127 | + <!-- Assert regular and special price for product after selecting Product Option --> |
| 128 | + <actionGroup ref="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" stepKey="storefrontSelectCustomOptionAndAssertProduct1Prices"> |
| 129 | + <argument name="customOption" value="{{ProductOptionValueDropdown3.title}} +$11.00"/> |
| 130 | + <argument name="productPrice" value="$133.10"/> |
| 131 | + <argument name="productFinalPrice" value="$121.00"/> |
| 132 | + </actionGroup> |
| 133 | + </test> |
| 134 | +</tests> |
0 commit comments