|
| 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="BraintreeCreditCardOnCheckoutTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Braintree"/> |
| 14 | + <stories value="MAGETWO-91624 - Braintree saved cards use billing address the same as shipping"/> |
| 15 | + <title value="Use saved for Braintree credit card on checkout with selecting billing address"/> |
| 16 | + <description value="Use saved for Braintree credit card on checkout with selecting billing address"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MAGETWO-93767"/> |
| 19 | + <group value="braintree"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 24 | + <createData entity="SimpleProduct" stepKey="product"> |
| 25 | + <requiredEntity createDataKey="category"/> |
| 26 | + </createData> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="customer"/> |
| 28 | + <createData entity="BraintreeConfig" stepKey="BraintreeConfigurationData"/> |
| 29 | + <createData entity="CustomBraintreeConfigurationData" stepKey="CustomBraintreeConfigurationData"/> |
| 30 | + </before> |
| 31 | + |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="product" stepKey="deleteProduct1"/> |
| 34 | + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> |
| 35 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 36 | + <createData entity="DefaultBraintreeConfig" stepKey="DefaultBraintreeConfig"/> |
| 37 | + <createData entity="RollBackCustomBraintreeConfigurationData" stepKey="RollBackCustomBraintreeConfigurationData"/> |
| 38 | + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> |
| 39 | + </after> |
| 40 | + <!--Go to storefront--> |
| 41 | + <amOnPage url="" stepKey="DoToStorefront"/> |
| 42 | + <!--Create account--> |
| 43 | + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="SignUpNewUserFromStorefrontActionGroup"> |
| 44 | + <argument name="Customer" value="Simple_US_Customer"/> |
| 45 | + </actionGroup> |
| 46 | + |
| 47 | + <!--Add product to cart--> |
| 48 | + <amOnPage url="$$product.sku$$.html" stepKey="goToProductPage"/> |
| 49 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 50 | + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> |
| 51 | + <waitForPageLoad stepKey="waitForPageLoad1"/> |
| 52 | + <!--Proceed to checkout--> |
| 53 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/> |
| 54 | + |
| 55 | + <actionGroup ref="LoggedInCheckoutFillNewBillingAddressActionGroup" stepKey="LoggedInCheckoutFillNewBillingAddressActionGroup"> |
| 56 | + <argument name="Address" value="US_Address_CA"/> |
| 57 | + </actionGroup> |
| 58 | + <waitForPageLoad stepKey="waitForPageLoad2"/> |
| 59 | + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> |
| 60 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> |
| 61 | + <!--Fill cart data--> |
| 62 | + <click selector="{{BraintreeConfigurationPaymentSection.creditCart}}" stepKey="SelectBraintreePaymentMethod"/> |
| 63 | + <waitForPageLoad stepKey="waitForPageLoad3"/> |
| 64 | + <actionGroup ref="StorefrontFillCartDataActionGroup" stepKey="StorefrontFillCartDataActionGroup"/> |
| 65 | + <waitForPageLoad stepKey="waitForPageLoad4"/> |
| 66 | + <!--Place order--> |
| 67 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="PlaceOrder"/> |
| 68 | + <waitForPageLoad stepKey="waitForPageLoad5"/> |
| 69 | + |
| 70 | + <!--Add product to cart again--> |
| 71 | + <amOnPage url="$$product.sku$$.html" stepKey="goToProductPage1"/> |
| 72 | + <waitForPageLoad stepKey="waitForPageLoad6"/> |
| 73 | + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart1"/> |
| 74 | + <waitForPageLoad stepKey="waitForPageLoad7"/> |
| 75 | + <!--Proceed to checkout--> |
| 76 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup1"/> |
| 77 | + <click selector="{{CheckoutPaymentSection.addressAction('New Address')}}" stepKey="clickOnNewAddress"/> |
| 78 | + <waitForPageLoad stepKey="waitForPageLoad8"/> |
| 79 | + <actionGroup ref="LoggedInCheckoutFillNewBillingAddressActionGroup" stepKey="LoggedInCheckoutFillNewBillingAddressActionGroup1"> |
| 80 | + <argument name="Address" value="US_Address_NY"/> |
| 81 | + </actionGroup> |
| 82 | + <click selector="{{CheckoutPaymentSection.addressAction('Save Address')}}" stepKey="SaveAddress"/> |
| 83 | + <waitForPageLoad stepKey="waitForPageLoad9"/> |
| 84 | + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext1"/> |
| 85 | + <waitForPageLoad stepKey="waitForPageLoad10"/> |
| 86 | + <click selector="{{BraintreeConfigurationPaymentSection.paymentMethod}}" stepKey="SelectBraintreePaymentMethod1"/> |
| 87 | + <waitForPageLoad stepKey="waitForPageLoad11"/> |
| 88 | + <click selector="{{CheckoutPaymentSection.shippingAndBillingAddressSame}}" stepKey="UncheckCheckBox"/> |
| 89 | + |
| 90 | + <click selector="{{CheckoutShippingSection.updateAddress}}" stepKey="clickToUpdate"/> |
| 91 | + <waitForPageLoad stepKey="waitForPageLoad12"/> |
| 92 | + <!--Place order--> |
| 93 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="PlaceOrder1"/> |
| 94 | + <waitForPageLoad stepKey="waitForPageLoad13"/> |
| 95 | + |
| 96 | + <click selector="{{CheckoutOrderSummarySection.orderNumber}}" stepKey="ClickOnOrderNumber"/> |
| 97 | + <waitForPageLoad stepKey="waitForPageLoad14"/> |
| 98 | + <!--Check billing and shipping addresses also additional Address info--> |
| 99 | + <click selector="{{CheckoutPaymentSection.addressBook}}" stepKey="goToAddressBook"/> |
| 100 | + <grabTextFrom selector="{{CheckoutOrderSummarySection.shippingAddress}}" stepKey="shippingAddr"/> |
| 101 | + <grabTextFrom selector="{{CheckoutOrderSummarySection.billingAddress}}" stepKey="billingAddr"/> |
| 102 | + <grabTextFrom selector="{{CheckoutOrderSummarySection.additionalAddress}}" stepKey="additionalAddress"/> |
| 103 | + <see userInput="Shipping Address" stepKey="seeShippingAddress"/> |
| 104 | + <see userInput="Billing Address" stepKey="seeBillingAddress"/> |
| 105 | + <assertEquals stepKey="assertValuesAreEqual" actual="$billingAddr" expected="$shippingAddr"/> |
| 106 | + <assertNotEquals stepKey="assertValuesAreNotEqual" actual="$billingAddr" expected="$additionalAddress"/> |
| 107 | + </test> |
| 108 | +</tests> |
0 commit comments