|
| 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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 11 | + <test name="CheckCheckoutSuccessPageAsRegisterCustomer"> |
| 12 | + <annotations> |
| 13 | + <features value="Checkout"/> |
| 14 | + <stories value="Success page elements are presented for placed order as Customer"/> |
| 15 | + <title value="Customer Checkout"/> |
| 16 | + <description value="To be sure that other elements of Success page are shown for placed order as registered Customer."/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MAGETWO-60345"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"> |
| 25 | + <field key="group_id">1</field> |
| 26 | + </createData> |
| 27 | + </before> |
| 28 | + |
| 29 | + <after> |
| 30 | + <!--Logout from customer account--> |
| 31 | + <amOnPage url="customer/account/logout/" stepKey="logoutCustomerOne"/> |
| 32 | + <waitForPageLoad stepKey="waitLogoutCustomerOne"/> |
| 33 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 34 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 35 | + <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> |
| 36 | + </after> |
| 37 | + |
| 38 | + <!--Log in to Storefront as Customer--> |
| 39 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser"> |
| 40 | + <argument name="Customer" value="$$createSimpleUsCustomer$$"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!--Go to product page--> |
| 44 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> |
| 45 | + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> |
| 46 | + |
| 47 | + <!--Add Product to Shopping Cart--> |
| 48 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> |
| 49 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!--Go to Checkout--> |
| 53 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 54 | + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> |
| 55 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> |
| 56 | + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> |
| 57 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> |
| 58 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest3"/> |
| 59 | + |
| 60 | + <!--Click Place Order button--> |
| 61 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 62 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 63 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> |
| 64 | + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/> |
| 65 | + |
| 66 | + <click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/> |
| 67 | + <seeInCurrentUrl url="{{StorefrontCustomerOrderPage.url}}" stepKey="seeMyOrderPage"/> |
| 68 | + |
| 69 | + <!--Go to product page--> |
| 70 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/> |
| 71 | + <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> |
| 72 | + |
| 73 | + <!--Add Product to Shopping Cart--> |
| 74 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> |
| 75 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 76 | + </actionGroup> |
| 77 | + |
| 78 | + <!--Go to Checkout--> |
| 79 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> |
| 80 | + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod2"/> |
| 81 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> |
| 82 | + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton2"/> |
| 83 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext2"/> |
| 84 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest4"/> |
| 85 | + |
| 86 | + <!--Click Place Order button--> |
| 87 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/> |
| 88 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage2"/> |
| 89 | + <click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/> |
| 90 | + <see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/> |
| 91 | + <seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/> |
| 92 | + |
| 93 | + <!--Go to product page--> |
| 94 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage3"/> |
| 95 | + <waitForPageLoad stepKey="waitForCatalogPageLoad3"/> |
| 96 | + |
| 97 | + <!--Add Product to Shopping Cart--> |
| 98 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage3"> |
| 99 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 100 | + </actionGroup> |
| 101 | + |
| 102 | + <!--Go to Checkout--> |
| 103 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart3"/> |
| 104 | + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod3"/> |
| 105 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/> |
| 106 | + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton3"/> |
| 107 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext3"/> |
| 108 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoadedTest5"/> |
| 109 | + |
| 110 | + <!--Click Place Order button--> |
| 111 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder3"/> |
| 112 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage3"/> |
| 113 | + |
| 114 | + <!--Check "Print Receipt" button is presented (desktop only)--> |
| 115 | + <seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint"/> |
| 116 | + <resizeWindow width="600" height="800" stepKey="resizeWindow"/> |
| 117 | + <waitForElementNotVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitInvisiblePrint"/> |
| 118 | + <dontSeeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeInvisiblePrint"/> |
| 119 | + <resizeWindow width="1360" height="1020" stepKey="maximizeWindowKey1"/> |
| 120 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="waitVisiblePrint"/> |
| 121 | + <seeElement selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="seeVisiblePrint2" /> |
| 122 | + |
| 123 | + <!--See print page--> |
| 124 | + <click selector="{{CheckoutSuccessMainSection.printLink}}" stepKey="clickPrintLink"/> |
| 125 | + <switchToWindow stepKey="switchToWindow"/> |
| 126 | + <switchToNextTab stepKey="switchToTab"/> |
| 127 | + <seeInCurrentUrl url="sales/order/print/order_id" stepKey="seePrintPage"/> |
| 128 | + <seeElement selector="{{StorefrontCustomerOrderViewSection.orderTitle}}" stepKey="seeOrderTitleOnPrint"/> |
| 129 | + <switchToWindow stepKey="switchToWindow2"/> |
| 130 | + </test> |
| 131 | + <test name="CheckCheckoutSuccessPageAsGuest"> |
| 132 | + <annotations> |
| 133 | + <features value="Checkout"/> |
| 134 | + <stories value="Success page elements are presented for placed order as Guest"/> |
| 135 | + <title value="Customer Checkout"/> |
| 136 | + <description value="To be sure that other elements of Success page are presented for placed order as Guest."/> |
| 137 | + <severity value="CRITICAL"/> |
| 138 | + <testCaseId value="MAGETWO-60346"/> |
| 139 | + <group value="checkout"/> |
| 140 | + </annotations> |
| 141 | + |
| 142 | + <before> |
| 143 | + <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> |
| 144 | + </before> |
| 145 | + |
| 146 | + <after> |
| 147 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 148 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 149 | + </after> |
| 150 | + |
| 151 | + <!--Go to product page--> |
| 152 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> |
| 153 | + <waitForPageLoad stepKey="waitForCatalogPageLoad"/> |
| 154 | + |
| 155 | + <!--Add Product to Shopping Cart--> |
| 156 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> |
| 157 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 158 | + </actionGroup> |
| 159 | + |
| 160 | + <!--Go to Checkout--> |
| 161 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 162 | + |
| 163 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection"> |
| 164 | + <argument name="customerVar" value="CustomerEntityOne" /> |
| 165 | + <argument name="customerAddressVar" value="CustomerAddressSimple" /> |
| 166 | + </actionGroup> |
| 167 | + |
| 168 | + <!--Click Place Order button--> |
| 169 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 170 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> |
| 171 | + |
| 172 | + <!--See success messages--> |
| 173 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 174 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 175 | + |
| 176 | + <!--Check register section--> |
| 177 | + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessNotify"/> |
| 178 | + <see selector="{{CheckoutSuccessRegisterSection.registerMessage}}" userInput="You can track your order status by creating an account." stepKey="seeRegisterMessage"/> |
| 179 | + <see selector="{{CheckoutSuccessRegisterSection.customerEmail}}" userInput="Email Address: {{CustomerEntityOne.email}}" stepKey="seeCustomerEmail"/> |
| 180 | + <seeElement selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="seeVisibleCreateAccountButton"/> |
| 181 | + <click selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="clickCreateAccountButton"/> |
| 182 | + <seeInCurrentUrl url="{{StorefrontCustomerCreatePage.url}}" stepKey="seeCreateAccountPage"/> |
| 183 | + <see userInput="Create New Customer Account" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeCreateAccountPageTitle"/> |
| 184 | + |
| 185 | + <!--Go to product page--> |
| 186 | + <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/> |
| 187 | + <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> |
| 188 | + |
| 189 | + <!--Add Product to Shopping Cart--> |
| 190 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> |
| 191 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 192 | + </actionGroup> |
| 193 | + |
| 194 | + <!--Go to Checkout--> |
| 195 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> |
| 196 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection2"> |
| 197 | + <argument name="customerVar" value="CustomerEntityOne" /> |
| 198 | + <argument name="customerAddressVar" value="CustomerAddressSimple" /> |
| 199 | + </actionGroup> |
| 200 | + |
| 201 | + <!--Click Place Order button--> |
| 202 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/> |
| 203 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage2"/> |
| 204 | + |
| 205 | + <!--Continue shopping--> |
| 206 | + <click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickContinueShoppingButton"/> |
| 207 | + <seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}" stepKey="seeHomePageUrl"/> |
| 208 | + <see userInput="Home Page" selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="seeHomePageTitle"/> |
| 209 | + </test> |
| 210 | +</tests> |
0 commit comments