|
| 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="StorefrontCatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Persistent"/> |
| 14 | + <stories value="Check the price"/> |
| 15 | + <title value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/> |
| 16 | + <description value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-13607"/> |
| 19 | + <group value="persistent"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="PersistentConfigSettings" stepKey="enablePersistent"/> |
| 23 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="productWithHTMLEntityOne" stepKey="createProduct"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + </createData> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 28 | + |
| 29 | + <!--Delete all Catalog Price Rule if exist--> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> |
| 31 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> |
| 32 | + |
| 33 | + <!--Create Catalog Rule--> |
| 34 | + <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/> |
| 35 | + <actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule"> |
| 36 | + <argument name="groups" value="'General'"/> |
| 37 | + </actionGroup> |
| 38 | + <actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="createCatalogPriceRule"> |
| 39 | + <argument name="conditionValue" value="$createCategory.id$"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForThirdPriceRule"/> |
| 42 | + <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="clickSaveAndApplyRule"/> |
| 43 | + |
| 44 | + <!-- Perform reindex --> |
| 45 | + <magentoCLI command="indexer:reindex" arguments="catalogrule_rule" stepKey="reindex"/> |
| 46 | + </before> |
| 47 | + <after> |
| 48 | + <createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/> |
| 49 | + <createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/> |
| 50 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 51 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 52 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 53 | + <!-- Delete the rule --> |
| 54 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> |
| 55 | + <actionGroup ref="logout" stepKey="logout"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!--Go to category and check price--> |
| 59 | + <actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPage"> |
| 60 | + <argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/> |
| 61 | + <argument name="productName" value="$createProduct.name$"/> |
| 62 | + </actionGroup> |
| 63 | + |
| 64 | + <!--Login to storefront from customer and check price--> |
| 65 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer"> |
| 66 | + <argument name="Customer" value="$createCustomer$"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomer"> |
| 69 | + <argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/> |
| 70 | + </actionGroup> |
| 71 | + |
| 72 | + <!--Go to category and check special price--> |
| 73 | + <actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPage"> |
| 74 | + <argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/> |
| 75 | + <argument name="productName" value="$createProduct.name$"/> |
| 76 | + </actionGroup> |
| 77 | + |
| 78 | + |
| 79 | + <!--Click *Sign Out*--> |
| 80 | + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/> |
| 81 | + <actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeForJohnDoeCustomer"> |
| 82 | + <argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!--Go to category and check special price--> |
| 86 | + <actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPageAfterLogout"> |
| 87 | + <argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/> |
| 88 | + <argument name="productName" value="$createProduct.name$"/> |
| 89 | + </actionGroup> |
| 90 | + |
| 91 | + <!--Click the *Not you?* link and check the price for Simple Product--> |
| 92 | + <click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNotYouLink"/> |
| 93 | + <actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomerAfterLogout"/> |
| 94 | + <actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPageAfterLogout"> |
| 95 | + <argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/> |
| 96 | + <argument name="productName" value="$createProduct.name$"/> |
| 97 | + </actionGroup> |
| 98 | + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($createProduct.name$)}}" stepKey="dontSeeSpecialPrice"/> |
| 99 | + </test> |
| 100 | +</tests> |
0 commit comments