|
| 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="StoreFrontGuestCustomerProductsMerged"> |
| 11 | + <annotations> |
| 12 | + <features value="Checkout"/> |
| 13 | + <stories value="Products in cart are merged if Guest with cart logging in as Customer"/> |
| 14 | + <title value="Products are merged when Guest Customer Login"/> |
| 15 | + <description value="Products in cart are merged if Guest with cart logging in as Customer "/> |
| 16 | + <stories value="Guest Checkout"/> |
| 17 | + <testCaseId value="MC-26777"/> |
| 18 | + <severity value="MAJOR"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--PRECONDITIONS--> |
| 22 | + <!-- create category --> |
| 23 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 24 | + <!-- create SimpleProduct1 --> |
| 25 | + <createData entity="SimpleProduct" stepKey="simpleProductOne"> |
| 26 | + <requiredEntity createDataKey="testCategory"/> |
| 27 | + </createData> |
| 28 | + <!-- create SimpleProduct2 --> |
| 29 | + <createData entity="SimpleProduct" stepKey="simpleProductTwo"> |
| 30 | + <requiredEntity createDataKey="testCategory"/> |
| 31 | + </createData> |
| 32 | + <!-- Assign SimpleProductOne to Category --> |
| 33 | + <createData entity="AssignProductToCategory" stepKey="assignTestCategoryToSimpleProductOne"> |
| 34 | + <requiredEntity createDataKey="testCategory"/> |
| 35 | + <requiredEntity createDataKey="simpleProductOne"/> |
| 36 | + </createData> |
| 37 | + <!-- Assign SimpleProductTwo to Category --> |
| 38 | + <createData entity="AssignProductToCategory" stepKey="assignCategoryToSimpleProductTwo"> |
| 39 | + <requiredEntity createDataKey="testCategory"/> |
| 40 | + <requiredEntity createDataKey="simpleProductTwo"/> |
| 41 | + </createData> |
| 42 | + <!-- Create customer --> |
| 43 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 44 | + <!--Goto Admin Configuration page and Allow Guest Checkout is No--> |
| 45 | + <createData entity="DisableAllowGuestCheckout" stepKey="storeConfigurationAllowGuestCheckoutNo"> |
| 46 | + </createData> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <!-- delete category,product,customer --> |
| 50 | + <deleteData createDataKey="simpleProductOne" stepKey="deleteSimpleProduct1"/> |
| 51 | + <deleteData createDataKey="simpleProductTwo" stepKey="deleteSimpleProduct2"/> |
| 52 | + <deleteData createDataKey="testCategory" stepKey="deleteCategory"/> |
| 53 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 54 | + <!--Goto Admin Configuration page and Allow Guest Checkout is Yes--> |
| 55 | + <createData entity="EnableAllowGuestCheckout" stepKey="storeConfigurationAllowGuestCheckoutYes"/> |
| 56 | + </after> |
| 57 | + <!-- Go to Storefront as Customer--> |
| 58 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 59 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 60 | + </actionGroup> |
| 61 | + <!-- Customer added Simple Product1 to ShoppingCart --> |
| 62 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductOneToCart"> |
| 63 | + <argument name="product" value="$$simpleProductOne$$"/> |
| 64 | + </actionGroup> |
| 65 | + <!-- Open MiniCart --> |
| 66 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/> |
| 67 | + <!-- Check MiniCart displays with number = 1 --> |
| 68 | + <see userInput="1" selector="{{StorefrontMinicartSection.quantity}}" stepKey="assertQuantity"/> |
| 69 | + <!-- Check MiniCart contains simple1 product --> |
| 70 | + <seeElement selector="{{StorefrontMinicartSection.productName($$simpleProductOne.name$$)}}" stepKey="AssertSimpleProductOne"/> |
| 71 | + <!--SignOut Customer--> |
| 72 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 73 | + <!-- Add simple2 product to shopping cart as Guest --> |
| 74 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductTwoToCart"> |
| 75 | + <argument name="product" value="$$simpleProductTwo$$"/> |
| 76 | + </actionGroup> |
| 77 | + <!-- Open MiniCart Again--> |
| 78 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCartAgain"/> |
| 79 | + <!-- MiniCart displays with number = 1 --> |
| 80 | + <see userInput="1" selector="{{StorefrontMinicartSection.quantity}}" stepKey="checkQuantity"/> |
| 81 | + <!-- Check MiniCart contains simple2 product --> |
| 82 | + <seeElement selector="{{StorefrontMinicartSection.productName($$simpleProductTwo.name$$)}}" stepKey="AssertSimpleProductTwo"/> |
| 83 | + <!-- Open MiniCart Again and Click Proceed to Checkout--> |
| 84 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> |
| 85 | + <!-- Pop-Up window with *Create an Account* OR *Sign In* is presented--> |
| 86 | + <seeElement selector="{{StorefrontCustomerSignInPopupFormSection.signIn}}" stepKey="checkSignInButton"/> |
| 87 | + <seeElement selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="checkCreateAccountButton"/> |
| 88 | + <!--Go to Storefront and Sign In as Customer from preconditions--> |
| 89 | + <actionGroup ref="StorefrontGuestSignInActionGroup" stepKey="singInForPlaceOrder"> |
| 90 | + <argument name="email" value="$$createCustomer.email$$"/> |
| 91 | + <argument name="password" value="$$createCustomer.password$$"/> |
| 92 | + </actionGroup> |
| 93 | + <!--Redirect to HomePage--> |
| 94 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> |
| 95 | + <!-- Open MiniCart --> |
| 96 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openCart"/> |
| 97 | + <!-- Check MiniCart displays with number = 2 --> |
| 98 | + <see userInput="2" selector="{{StorefrontMinicartSection.quantity}}" stepKey="checkMiniCartDisplaysQuantity"/> |
| 99 | + <!-- Verify Two Products are added Product A and B--> |
| 100 | + <!--MiniCart contains simple1 and simple2 products--> |
| 101 | + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertSimpleProductOneNameInMiniCart"> |
| 102 | + <argument name="productName" value="$$simpleProductOne.name$$"/> |
| 103 | + </actionGroup> |
| 104 | + <!--Check Simple Product Two is there --> |
| 105 | + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertSimpleProductTwoNameInMiniCart"> |
| 106 | + <argument name="productName" value="$$simpleProductTwo.name$$"/> |
| 107 | + </actionGroup> |
| 108 | + <!--Go To ShoppingCart--> |
| 109 | + <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/> |
| 110 | + <waitForPageLoad stepKey="waitForPageToLoad"/> |
| 111 | + <!--Check Simple1 and Simple2 product are presented on the Shopping Cart page --> |
| 112 | + <seeElement selector="{{StorefrontMinicartSection.productCartName($$simpleProductOne.name$$)}}" stepKey="AssertSimpleProductOnenn"/> |
| 113 | + <seeElement selector="{{StorefrontMinicartSection.productCartName($$simpleProductTwo.name$$)}}" stepKey="AssertSimpleProductTwbbo"/> |
| 114 | + </test> |
| 115 | +</tests> |
0 commit comments