|
| 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="OnePageCheckoutAsCustomerUsingDefaultAddressTest"> |
| 12 | + <annotations> |
| 13 | + <features value="OnePageCheckout"/> |
| 14 | + <stories value="OnePageCheckout within Offline Payment Methods"/> |
| 15 | + <title value="OnePageCheckout as customer using default address test"/> |
| 16 | + <description value="Checkout as customer using default address"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-14741"/> |
| 19 | + <group value="checkout"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create Simple Product --> |
| 24 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> |
| 25 | + <field key="price">560</field> |
| 26 | + </createData> |
| 27 | + |
| 28 | + <!-- Create customer --> |
| 29 | + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> |
| 30 | + </before> |
| 31 | + <after> |
| 32 | + <!-- Admin log out --> |
| 33 | + <actionGroup ref="logout" stepKey="logout"/> |
| 34 | + |
| 35 | + <!-- Customer log out --> |
| 36 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 37 | + |
| 38 | + <!-- Delete created product --> |
| 39 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 40 | + |
| 41 | + <!-- Delete customer --> |
| 42 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 43 | + </after> |
| 44 | + |
| 45 | + <!-- Add Simple Product to cart --> |
| 46 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> |
| 47 | + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> |
| 48 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> |
| 49 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Go to shopping cart --> |
| 53 | + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> |
| 54 | + <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> |
| 55 | + <argument name="address" value="US_Address_CA"/> |
| 56 | + </actionGroup> |
| 57 | + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> |
| 58 | + <waitForPageLoad stepKey="waitForProceedToCheckout"/> |
| 59 | + |
| 60 | + |
| 61 | + <!-- Login as customer on checkout page --> |
| 62 | + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin"> |
| 63 | + <argument name="customer" value="$createCustomer$"/> |
| 64 | + </actionGroup> |
| 65 | + |
| 66 | + <!-- Fill customer address data --> |
| 67 | + <waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/> |
| 68 | + <!-- Change address --> |
| 69 | + <click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/> |
| 70 | + |
| 71 | + <!-- Click next button to open payment section --> |
| 72 | + <click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/> |
| 73 | + <waitForPageLoad stepKey="waitForShipmentPageLoad"/> |
| 74 | + |
| 75 | + <!-- Select payment solution --> |
| 76 | + <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> |
| 77 | + |
| 78 | + <!-- Check order summary in checkout --> |
| 79 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> |
| 80 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/> |
| 81 | + <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> |
| 82 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 83 | + |
| 84 | + <!-- Login as admin --> |
| 85 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 86 | + |
| 87 | + <!-- Open created order in backend --> |
| 88 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> |
| 89 | + <waitForPageLoad stepKey="waitForOrdersPageLoad"/> |
| 90 | + <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> |
| 91 | + <argument name="orderId" value="$grabOrderNumber"/> |
| 92 | + </actionGroup> |
| 93 | + |
| 94 | + <!-- Assert order total --> |
| 95 | + <scrollTo selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="scrollToOrderTotalSection"/> |
| 96 | + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$565.00" stepKey="checkOrderTotalInBackend"/> |
| 97 | + |
| 98 | + <!-- Assert order addresses --> |
| 99 | + <see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.street[0]}}" stepKey="seeBillingAddressStreet"/> |
| 100 | + <see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.city}}" stepKey="seeBillingAddressCity"/> |
| 101 | + <see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.postcode}}" stepKey="seeBillingAddressPostcode"/> |
| 102 | + <see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.street[0]}}" stepKey="seeShippingAddressStreet"/> |
| 103 | + <see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.city}}" stepKey="seeShippingAddressCity"/> |
| 104 | + <see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.postcode}}" stepKey="seeShippingAddressPostcode"/> |
| 105 | + </test> |
| 106 | +</tests> |
0 commit comments