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 =" VoidASalesOrderPlacedWithPayPalPaymentsProTest" >
11
+ <annotations >
12
+ <features value =" PayPal" />
13
+ <stories value =" Paypal Payments Pro" />
14
+ <title value =" Void a Sales Order placed with PayPal Payments Pro" />
15
+ <description value =" Void a Sales Order placed with PayPal Payments Pro and validate message in trasaction tab from backend " />
16
+ <severity value =" MAJOR" />
17
+ <testCaseId value =" AC-5461" />
18
+ <group value =" paypal" />
19
+ </annotations >
20
+ <before >
21
+ <createData entity =" SimpleProduct" stepKey =" createSimpleProduct" />
22
+ <actionGroup ref =" AdminLoginActionGroup" stepKey =" loginAsAdmin" />
23
+ <actionGroup ref =" AdminConfigurePayPalPaymentsProActionGroup" stepKey =" ConfigPayPalPaymentsPro" >
24
+ <argument name =" credentials" value =" SamplePaypalPaymentsProConfig" />
25
+ </actionGroup >
26
+ <actionGroup ref =" StorefrontOpenProductEntityPageActionGroup" stepKey =" goToProductOnStorefront2" >
27
+ <argument name =" product" value =" $$createSimpleProduct$$" />
28
+ </actionGroup >
29
+ <!-- Add product 1 to cart -->
30
+ <actionGroup ref =" AddToCartFromStorefrontProductPageActionGroup" stepKey =" addToCartFromStorefrontProductPage" >
31
+ <argument name =" productName" value =" $createSimpleProduct.name$" />
32
+ </actionGroup >
33
+ <actionGroup ref =" StorefrontCartPageOpenActionGroup" stepKey =" goToCheckoutCartPage" />
34
+ <actionGroup ref =" StorefrontClickProceedToCheckoutActionGroup" stepKey =" clickProceedToCheckout" />
35
+ <!-- Place order-->
36
+ <actionGroup ref =" GuestCheckoutFillingShippingSectionActionGroup" stepKey =" guestCheckoutFillingShipping" >
37
+ <argument name =" shippingMethod" value =" Flat Rate" />
38
+ </actionGroup >
39
+ <waitForElementVisible selector =" {{StorefrontPaypalCheckoutSection.creditCard}}" stepKey =" waitForCreditCardPaymentMethod" />
40
+ <actionGroup ref =" StorefrontCheckoutSelectPaypalPaymentMethodActionGroup" stepKey =" selectPaypalPaymentMethod" />
41
+ <waitForPageLoad stepKey =" waitForLoadingMaskAfterPaymentMethodSelection" />
42
+ <actionGroup ref =" StorefrontPaypalFillCardDataActionGroup" stepKey =" fillCardDataPaypal" >
43
+ <argument name =" cardData" value =" VisaDefaultCard" />
44
+ </actionGroup >
45
+ <actionGroup ref =" ClickPlaceOrderActionGroup" stepKey =" checkoutPlaceOrder" />
46
+ <waitForText selector =" {{CheckoutSuccessMainSection.successTitle}}" userInput =" Thank you for your purchase!" stepKey =" waitForLoadSuccessPage" />
47
+ </before >
48
+ <after >
49
+ <magentoCLI command =" config:set payment/paypal_payment_pro/active 0" stepKey =" disablePayPalExpress" />
50
+ <actionGroup ref =" CliCacheCleanActionGroup" stepKey =" flushingCacheAfterCreatingCouponsAndCartPriceRule" >
51
+ <argument name =" tags" value =" config full_page" />
52
+ </actionGroup >
53
+ <actionGroup ref =" CliIndexerReindexActionGroup" stepKey =" reindex" >
54
+ <argument name =" indices" value =" " />
55
+ </actionGroup >
56
+ <deleteData createDataKey =" createSimpleProduct" stepKey =" deleteSimpleProduct" />
57
+ <actionGroup ref =" AdminLogoutActionGroup" stepKey =" logout" />
58
+ </after >
59
+ <grabTextFrom selector =" {{CheckoutSuccessMainSection.orderNumber}}" stepKey =" grabOrderNumber" />
60
+ <actionGroup ref =" OpenOrderByIdActionGroup" stepKey =" openOrder" >
61
+ <argument name =" orderId" value =" {$grabOrderNumber}" />
62
+ </actionGroup >
63
+ <actionGroup ref =" AdminVoidPendingOrderActionGroup" stepKey =" voidOrder" />
64
+ <actionGroup ref =" AdminOrderViewCheckStatusActionGroup" stepKey =" checkOrderStatus" >
65
+ <argument name =" status" value =" Processing" />
66
+ </actionGroup >
67
+ <waitForElementVisible selector =" {{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey =" waitForGrabLastTransactionID" />
68
+ <grabTextFrom selector =" {{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey =" grabLastTransactionID" />
69
+ <waitForElementVisible selector =" {{AdminOrderNotesSection.voidAuthorizationNotes('$grabLastTransactionID')}}" stepKey =" WaitForVoidAuthorizationNotesWithID" />
70
+ <grabTextFrom selector =" {{AdminOrderNotesSection.voidAuthorizationNotes('$grabLastTransactionID')}}" stepKey =" voidAuthorizationNotesWithID" />
71
+ <actionGroup ref =" AdminOpenOrderCommentsHistoryActionGroup" stepKey =" clickOnCommentsHistory" />
72
+ <waitForText selector =" {{AdminOrderCommentsTabSection.authorizationNotes('Voided')}}" userInput =" $voidAuthorizationNotesWithID" stepKey =" seeOrderHistoryNotes" />
73
+ <!-- Check the last transaction of the order-->
74
+ <actionGroup ref =" AdminViewTransactionsInOrderActionGroup" stepKey =" validateVoidTxn" />
75
+ <waitForText selector =" {{AdminTransactionsGridSection.isClosed}}" userInput =" Yes" stepKey =" seeIsClosedIsYes" />
76
+ <waitForElementClickable selector =" {{AdminProductFormActionSection.backButton}}" stepKey =" waitForPBackButtonToBeClicked" />
77
+ <click selector =" {{AdminProductFormActionSection.backButton}}" stepKey =" clickBackButton" />
78
+ <actionGroup ref =" AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey =" validateAuthTxn" />
79
+ <waitForText selector =" {{AdminTransactionsGridSection.isClosed}}" userInput =" Yes" stepKey =" seeIsClosedIsYesForAuthorization" />
80
+ </test >
81
+ </tests >
0 commit comments