|
| 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="StorefrontVerifyCategoryPageNotCachedTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <title value="Verify category page is not cached"/> |
| 15 | + <stories value="Product Categories Indexer"/> |
| 16 | + <description value="Verify that the category page is NOT cached for customers with different tax rates"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <group value="Catalog"/> |
| 19 | + <group value="indexer"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Login to Admin Panel--> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> |
| 24 | + <!-- Create tax rate for CA --> |
| 25 | + <createData entity="US_CA_Rate_1" stepKey="createTaxRateCA"/> |
| 26 | + <!-- Create tax rate for TX --> |
| 27 | + <createData entity="ThirdTaxRateTexas" stepKey="createTaxRateTX"/> |
| 28 | + <!-- Create Tax Rules --> |
| 29 | + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule1"> |
| 30 | + <argument name="taxRate" value="$$createTaxRateCA$$"/> |
| 31 | + <argument name="taxRule" value="SimpleTaxRule"/> |
| 32 | + </actionGroup> |
| 33 | + <actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule2"> |
| 34 | + <argument name="taxRate" value="$$createTaxRateTX$$"/> |
| 35 | + <argument name="taxRule" value="SimpleTaxRule2"/> |
| 36 | + </actionGroup> |
| 37 | + <!--Create Customers--> |
| 38 | + <createData entity="Simple_US_CA_Customer" stepKey="createCustomerCA"/> |
| 39 | + <createData entity="Simple_US_Customer" stepKey="createCustomerTX"/> |
| 40 | + <!--Create Category--> |
| 41 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 42 | + <!--Create Products--> |
| 43 | + <createData entity="SimpleProduct" stepKey="simpleProduct"> |
| 44 | + <field key="price">100</field> |
| 45 | + <requiredEntity createDataKey="createCategory"/> |
| 46 | + </createData> |
| 47 | + <createData entity="SimpleProduct" stepKey="simpleProduct2"> |
| 48 | + <field key="price">200</field> |
| 49 | + <requiredEntity createDataKey="createCategory"/> |
| 50 | + </createData> |
| 51 | + <!--Display product price including and excluding tax in catalog--> |
| 52 | + <magentoCLI command="config:set tax/display/type 3" stepKey="enableShowIncludingExcludingTax"/> |
| 53 | + </before> |
| 54 | + <after> |
| 55 | + <magentoCLI command="config:set tax/display/type 0" stepKey="disableShowIncludingExcludingTax"/> |
| 56 | + <!--Delete Products--> |
| 57 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProductOne"/> |
| 58 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteProductTwo"/> |
| 59 | + <!--Delete Category--> |
| 60 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 61 | + <!--Delete Tax Rules--> |
| 62 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule1"> |
| 63 | + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule2"> |
| 66 | + <argument name="taxRuleCode" value="{{SimpleTaxRule2.code}}"/> |
| 67 | + </actionGroup> |
| 68 | + <!--Delete Tax Rates--> |
| 69 | + <deleteData createDataKey="createTaxRateCA" stepKey="deleteTaxRate1"/> |
| 70 | + <deleteData createDataKey="createTaxRateTX" stepKey="deleteTaxRate2"/> |
| 71 | + <!--Delete Customers--> |
| 72 | + <deleteData createDataKey="createCustomerCA" stepKey="deleteCustomer1"/> |
| 73 | + <deleteData createDataKey="createCustomerTX" stepKey="deleteCustomer2"/> |
| 74 | + <!--Logout Admin--> |
| 75 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> |
| 76 | + </after> |
| 77 | + |
| 78 | + <!-- Login as customer 1--> |
| 79 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomer1Login"> |
| 80 | + <argument name="Customer" value="$$createCustomerCA$$"/> |
| 81 | + </actionGroup> |
| 82 | + <!-- Assert Customer Name --> |
| 83 | + <actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="assertCustomerName"> |
| 84 | + <argument name="customerFullName" value="$$createCustomerCA.firstname$$ $$createCustomerCA.lastname$$" /> |
| 85 | + </actionGroup> |
| 86 | + <!-- Navigate to category page --> |
| 87 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> |
| 88 | + <argument name="category" value="$$createCategory$$"/> |
| 89 | + </actionGroup> |
| 90 | + <!-- Assert Product Prices --> |
| 91 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct1TaxInclusivePriceCustomer1"> |
| 92 | + <argument name="productName" value="$$simpleProduct.name$$"/> |
| 93 | + <argument name="productPrice" value="$108.25"/> |
| 94 | + </actionGroup> |
| 95 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct2TaxInclusivePriceCustomer1"> |
| 96 | + <argument name="productName" value="$$simpleProduct2.name$$"/> |
| 97 | + <argument name="productPrice" value="$216.50"/> |
| 98 | + </actionGroup> |
| 99 | + <!--Add first product to compare list and cart --> |
| 100 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openFirstProductPage"> |
| 101 | + <argument name="productUrl" value="$$simpleProduct.custom_attributes[url_key]$$"/> |
| 102 | + </actionGroup> |
| 103 | + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addFirstProductToCompare"> |
| 104 | + <argument name="productVar" value="$$simpleProduct$$"/> |
| 105 | + </actionGroup> |
| 106 | + <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addFirstProductToCart"/> |
| 107 | + <!--Add second product to compare list --> |
| 108 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage"> |
| 109 | + <argument name="productUrl" value="$$simpleProduct2.custom_attributes[url_key]$$"/> |
| 110 | + </actionGroup> |
| 111 | + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addSecondProductToCompare"> |
| 112 | + <argument name="productVar" value="$$simpleProduct2$$"/> |
| 113 | + </actionGroup> |
| 114 | + <!--Add second product to wishlist --> |
| 115 | + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addSecondProductToWishlist"> |
| 116 | + <argument name="productVar" value="$$simpleProduct2$$"/> |
| 117 | + </actionGroup> |
| 118 | + <!-- Customer 1 logout --> |
| 119 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customer1Logout"/> |
| 120 | + <!-- Customer 2 login --> |
| 121 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomer2Login"> |
| 122 | + <argument name="Customer" value="$$createCustomerTX$$"/> |
| 123 | + </actionGroup> |
| 124 | + <!-- Assert Wishlist is empty --> |
| 125 | + <actionGroup ref="NavigateThroughCustomerTabsActionGroup" stepKey="navigateToWishlist"> |
| 126 | + <argument name="navigationItemName" value="My Wish List"/> |
| 127 | + </actionGroup> |
| 128 | + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertNoItemsInWishlist"/> |
| 129 | + <!-- Assert minicart is empty --> |
| 130 | + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartIsEmpty"/> |
| 131 | + <!-- Navigate to category page --> |
| 132 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage2"> |
| 133 | + <argument name="category" value="$$createCategory$$"/> |
| 134 | + </actionGroup> |
| 135 | + <!-- Assert Compare list is empty --> |
| 136 | + <seeElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" stepKey="assertCompareListIsEmpty"/> |
| 137 | + <!-- Assert Product Prices --> |
| 138 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct1TaxInclusivePriceCustomer2"> |
| 139 | + <argument name="productName" value="$$simpleProduct.name$$"/> |
| 140 | + <argument name="productPrice" value="$120"/> |
| 141 | + </actionGroup> |
| 142 | + <actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct2TaxInclusivePriceCustomer2"> |
| 143 | + <argument name="productName" value="$$simpleProduct2.name$$"/> |
| 144 | + <argument name="productPrice" value="$240"/> |
| 145 | + </actionGroup> |
| 146 | + </test> |
| 147 | +</tests> |
0 commit comments