|
| 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="AdminCreateOrderWithSavedCreditCardPaypalPayflowProTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Admin create order with saved credit card paypal payflow pro"/> |
| 15 | + <description value="Use saved PayPal Payflow Pro credit card on admin sales order creation if two vault providers are available"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-5386"/> |
| 18 | + <group value="paypalPayflowProWithOutValut"/> |
| 19 | + <group value="3rd_party_integration" /> |
| 20 | + <group value="pr_exclude" /> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Create a customer--> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + <!-- Create simple product--> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct1"/> |
| 27 | + <!-- Enable Vault for paypal payflow pro--> |
| 28 | + <magentoCLI command="config:set {{EnablePaypalPayflowProVault.path}} {{EnablePaypalPayflowProVault.value}}" stepKey="enablePaypalPayflowProVault"/> |
| 29 | + <!-- Login to admin--> |
| 30 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 31 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 32 | + <argument name="indices" value=""/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 35 | + <argument name="tags" value="config full_page"/> |
| 36 | + </actionGroup> |
| 37 | + <!-- Login as Customer --> |
| 38 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 39 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 40 | + </actionGroup> |
| 41 | + <!-- Navigate to StoreFront --> |
| 42 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 43 | + <!-- Add product to cart --> |
| 44 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 45 | + <argument name="product" value="$$createSimpleProduct1$$"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 48 | + <!-- Select shipping --> |
| 49 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate"> |
| 50 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Go to Order review --> |
| 53 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 54 | + <!-- Checkout select Credit Card (Payflow Pro) and place order--> |
| 55 | + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectPaypalPayflowProPaymentMethod"/> |
| 56 | + <waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> |
| 57 | + <!--Fill Card Data and place an order--> |
| 58 | + <actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal"> |
| 59 | + <argument name="cardData" value="VisaDefaultCard"/> |
| 60 | + </actionGroup> |
| 61 | + <waitForPageLoad stepKey="waitForFillCardData"/> |
| 62 | + <!--Save credit card for the registered user--> |
| 63 | + <checkOption selector="{{StorefrontOnePageCheckoutPaymentSection.saveForLaterUse}}" stepKey="checkSaveForLaterUse"/> |
| 64 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> |
| 65 | + <!-- Grab order number--> |
| 66 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOderNumber"/> |
| 67 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 68 | + </before> |
| 69 | + <after> |
| 70 | + <!-- Delete product and customer--> |
| 71 | + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct"/> |
| 72 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 73 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 74 | + <!-- Disable Vault for paypal payflow pro--> |
| 75 | + <magentoCLI command="config:set {{DisablePaypalPayflowProVault.path}} {{DisablePaypalPayflowProVault.value}}" stepKey="disablePaypalPayflowProVault"/> |
| 76 | + <!-- Logout--> |
| 77 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 78 | + </after> |
| 79 | + <!-- Create new order --> |
| 80 | + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="CreateNewOrder"> |
| 81 | + <argument name="customer" value="Simple_US_Customer"/> |
| 82 | + </actionGroup> |
| 83 | + <!-- Add product to order --> |
| 84 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> |
| 85 | + <argument name="product" value="$$createSimpleProduct1$$"/> |
| 86 | + <argument name="productQty" value="1"/> |
| 87 | + </actionGroup> |
| 88 | + <waitForPageLoad stepKey="WaitForProductAdd"/> |
| 89 | + <waitForLoadingMaskToDisappear stepKey="WaitForProductAddLoading"/> |
| 90 | + <!--Select FlatRate shipping method--> |
| 91 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> |
| 92 | + <!--Select Stored Cards (PayPal pay flow pro) as a payment--> |
| 93 | + <conditionalClick selector="{{AdminOrderFormPaymentSection.storedCard}}" dependentSelector="{{AdminOrderFormPaymentSection.storedCard}}" visible="true" stepKey="selectStoredPayflowProCreditCard"/> |
| 94 | + <!--Verify credit card cvv is not visible--> |
| 95 | + <waitForElementNotVisible selector="{{StorefrontPaypalCheckoutSection.verificationNumber}}" stepKey="verifyCreditCardCvvNotVisible"/> |
| 96 | + <!--Submit order--> |
| 97 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> |
| 98 | + <waitForPageLoad stepKey="WaitForOrderSubmit"/> |
| 99 | + <!--verify order placed success message--> |
| 100 | + <waitForText selector="{{CheckoutCartMessageSection.successMessage}}" userInput="You created the order." stepKey="seeOrderPlacedSuccessMessage"/> |
| 101 | + </test> |
| 102 | +</tests> |
0 commit comments