|
| 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="AdminPayPalExpressCheckoutTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Paypal express checkout configuration"/> |
| 14 | + <title value="Paypal Express Checkout configuration with valid credentials"/> |
| 15 | + <description value="Place an order using paypal express checkout as payment method"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-6149"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Simple product is created and assigned to category --> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + <field key="price">10.00</field> |
| 25 | + </createData> |
| 26 | + <!-- US Customer is created --> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <!-- Configure Paypal Express Checkout --> |
| 30 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress"> |
| 31 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 32 | + </actionGroup> |
| 33 | + </before> |
| 34 | + <after> |
| 35 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 36 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 37 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 38 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 39 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 40 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 41 | + </after> |
| 42 | + <!-- Login to StoreFront --> |
| 43 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 44 | + <!-- Add product to cart --> |
| 45 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 46 | + <argument name="product" value="$$createProduct$$"/> |
| 47 | + </actionGroup> |
| 48 | + <!-- Goto Checkout Page --> |
| 49 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 50 | + <!--Fill Shipping Address--> |
| 51 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> |
| 52 | + <argument name="customer" value="$$createCustomer$$" /> |
| 53 | + <argument name="address" value="US_Address_TX"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping" /> |
| 56 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> |
| 57 | + <!-- Click on PayPal payment radio button --> |
| 58 | + <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/> |
| 59 | + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/> |
| 60 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 61 | + <!-- Login to Paypal in-context and verify order total on paypal page--> |
| 62 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 63 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 64 | + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> |
| 65 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 66 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 67 | + </actionGroup> |
| 68 | + <waitForElementVisible selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/> |
| 69 | + <grabTextFrom selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabATransactionID"/> |
| 70 | + <actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkSubtotal"> |
| 71 | + <argument name="subtotal" value="$10.00"/> |
| 72 | + <argument name="shippingAndHandling" value="$5.00"/> |
| 73 | + <argument name="grandTotal" value="15.00"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 76 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderComment}}" userInput="Authorized amount of $15.00. Transaction ID: "{$grabATransactionID}"" stepKey="seeOrderHistoryNotes"/> |
| 77 | + </test> |
| 78 | +</tests> |
0 commit comments