|
| 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="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Checkout"/> |
| 13 | + <title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/> |
| 14 | + <description value="Checkout as UK customer with different shipping/billing address and register checkout method"/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <testCaseId value="MC-28288"/> |
| 17 | + <group value="mtf_migrated"/> |
| 18 | + <group value="checkout"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> |
| 23 | + <createData entity="SimpleProduct2" stepKey="simpleProduct"> |
| 24 | + <field key="price">50.00</field> |
| 25 | + </createData> |
| 26 | + </before> |
| 27 | + <after> |
| 28 | + <!-- Sign out Customer from storefront --> |
| 29 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 30 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 31 | + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> |
| 32 | + <argument name="customerEmail" value="UKCustomer.email"/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomersGridFilter"/> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 36 | + </after> |
| 37 | + |
| 38 | + <!--Open Product page in StoreFront and assert product and price range --> |
| 39 | + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> |
| 40 | + <argument name="product" value="$simpleProduct$"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!--Add product to the cart --> |
| 44 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 45 | + <argument name="product" value="$simpleProduct$"/> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!--Open View and edit --> |
| 49 | + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openCartFromMiniCart"/> |
| 50 | + |
| 51 | + <!-- Fill the Estimate Shipping and Tax section --> |
| 52 | + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> |
| 53 | + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> |
| 54 | + <waitForPageLoad stepKey="waitForPageToLoad"/> |
| 55 | + |
| 56 | + <!-- Fill the guest form --> |
| 57 | + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestShippingAddress"> |
| 58 | + <argument name="customer" value="UKCustomer"/> |
| 59 | + <argument name="customerAddress" value="updateCustomerUKAddress"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping"/> |
| 62 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToBillingStep"/> |
| 63 | + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForSameBillingAndShippingAddressCheckboxVisible"/> |
| 64 | + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> |
| 65 | + <conditionalClick selector="{{CheckoutShippingSection.editAddressButton}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditBillingAddressButton"/> |
| 66 | + |
| 67 | + <!-- Fill Billing Address --> |
| 68 | + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddressForm"/> |
| 69 | + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateBillingAddressButton"/> |
| 70 | + |
| 71 | + <!--Place order --> |
| 72 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> |
| 73 | + <seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> |
| 74 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> |
| 75 | + |
| 76 | + <!-- Register customer after checkout --> |
| 77 | + <actionGroup ref="StorefrontRegisterCustomerAfterCheckoutActionGroup" stepKey="registerCustomer"/> |
| 78 | + |
| 79 | + <!-- Open Order Page in admin --> |
| 80 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 81 | + <argument name="orderId" value="{$orderId}"/> |
| 82 | + </actionGroup> |
| 83 | + |
| 84 | + <!-- Assert Grand Total --> |
| 85 | + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$55.00" stepKey="seeGrandTotal"/> |
| 86 | + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> |
| 87 | + |
| 88 | + <!-- Ship the order and assert the status --> |
| 89 | + <actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/> |
| 90 | + <actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/> |
| 91 | + |
| 92 | + <!-- Assert order buttons --> |
| 93 | + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> |
| 94 | + </test> |
| 95 | +</tests> |
0 commit comments