|
| 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="StorefrontLoginAsCustomerBannerPresentOnAllPagesInSessionTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login as Customer"/> |
| 14 | + <stories value="Notification banner appears on all pages in session"/> |
| 15 | + <title value="Verify banner is persistent and appears during all page views in session"/> |
| 16 | + <description value="Banner is persistent and appears on all pages in session"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="login_as_customer"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 22 | + stepKey="enableLoginAsCustomer"/> |
| 23 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> |
| 24 | + <argument name="tags" value="config"/> |
| 25 | + </actionGroup> |
| 26 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 27 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 28 | + <requiredEntity createDataKey="createCategory"/> |
| 29 | + </createData> |
| 30 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 31 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <closeTab stepKey="closeLoginAsCustomerTab"/> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 36 | + |
| 37 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 38 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 39 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 40 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 41 | + stepKey="disableLoginAsCustomer"/> |
| 42 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> |
| 43 | + <argument name="tags" value="config"/> |
| 44 | + </actionGroup> |
| 45 | + </after> |
| 46 | + |
| 47 | + <!-- Admin Login as Customer from Customer page and assert notification banner --> |
| 48 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" stepKey="loginAsCustomerFromCustomerPage"> |
| 49 | + <argument name="customerId" value="$$createCustomer.id$$"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBanner"> |
| 52 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <!-- Go to Wishlist and assert notification banner --> |
| 56 | + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="amOnWishListPage"/> |
| 57 | + <waitForPageLoad stepKey="waitForWishlistPageLoad"/> |
| 58 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnWishList"> |
| 59 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <!-- Go to category page and assert notification banner --> |
| 63 | + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> |
| 64 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCategoryPage"> |
| 65 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 66 | + </actionGroup> |
| 67 | + |
| 68 | + <!-- Go to product page and assert notification banner --> |
| 69 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 70 | + <argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> |
| 71 | + </actionGroup> |
| 72 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnProductPage"> |
| 73 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 74 | + </actionGroup> |
| 75 | + |
| 76 | + <!-- Add product to cart and assert notification banner --> |
| 77 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 78 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 79 | + <argument name="productCount" value="1"/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCartPage"/> |
| 82 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCartPage"> |
| 83 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 84 | + </actionGroup> |
| 85 | + |
| 86 | + <!-- Proceed to checkout and assert notification banner --> |
| 87 | + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> |
| 88 | + <waitForPageLoad stepKey="waitForProceedToCheckout"/> |
| 89 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerOnCheckoutPage"> |
| 90 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <!-- Assert notification banner before place order --> |
| 94 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> |
| 95 | + <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> |
| 96 | + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> |
| 97 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterClickNext"/> |
| 98 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerBeforePlaceOrder"> |
| 99 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 100 | + </actionGroup> |
| 101 | + |
| 102 | + <!-- Assert notification banner after place order --> |
| 103 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> |
| 104 | + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> |
| 105 | + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> |
| 106 | + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> |
| 107 | + </actionGroup> |
| 108 | + <actionGroup ref="StorefrontAssertLoginAsCustomerNotificationBannerActionGroup" stepKey="assertNotificationBannerAfterPlaceOrder"> |
| 109 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 110 | + </actionGroup> |
| 111 | + </test> |
| 112 | +</tests> |
0 commit comments