Skip to content

Commit 3c73ec6

Browse files
shanthishanthi
authored andcommitted
ACQE-4324
1 parent a047c76 commit 3c73ec6

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
3+
<test name="VoidASalesOrderPlacedWithPayPalPaymentsProTest">
4+
<annotations>
5+
<features value="PayPal"/>
6+
<stories value="Paypal Payments Pro"/>
7+
<title value="Void a Sales Order placed with PayPal Payments Pro"/>
8+
<description value="Void a Sales Order placed with PayPal Payments Pro"/>
9+
<severity value="MAJOR"/>
10+
<testCaseId value="AC-5461"/>
11+
<group value="paypal"/>
12+
</annotations>
13+
<before>
14+
<!--Enable free shipping method -->
15+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
16+
<createData entity="SimpleProduct" stepKey="createSimpleProduct1"/>
17+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
18+
<actionGroup ref="AdminPayPalPaymentsProActionGroup" stepKey="ConfigPayPalExpress">
19+
<argument name="credentials" value="SamplePaypalPaymentsProConfig"/>
20+
</actionGroup>
21+
</before>
22+
<after>
23+
<magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePayPalExpress"/>
24+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct"/>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
28+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct1.custom_attributes[url_key]$$)}}" stepKey="goToStorefront"/>
29+
30+
<!-- Add product 1 to cart -->
31+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
32+
<argument name="productName" value="$createSimpleProduct1.name$"/>
33+
</actionGroup>
34+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
35+
<!--Place order-->
36+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
37+
<argument name="shippingMethod" value="Flat Rate"/>
38+
</actionGroup>
39+
40+
<waitForPageLoad stepKey="waitForLoadingMask"/>
41+
<waitForPageLoad stepKey="waitForPageLoad"/>
42+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" visible="true" stepKey="selectPaymentsProMethod"/>
43+
<waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
44+
45+
<actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal">
46+
<argument name="cardData" value="VisaDefaultCard"/>
47+
</actionGroup>
48+
<waitForPageLoad stepKey="waitForFillCardData"/>
49+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
50+
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
51+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
52+
53+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
54+
55+
<actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchForOrder">
56+
<argument name="keyword" value="{$grabOrderNumber}"/>
57+
</actionGroup>
58+
59+
<!-- Open order -->
60+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
61+
<argument name="orderId" value="{$grabOrderNumber}"/>
62+
</actionGroup>
63+
64+
<actionGroup ref="VoidPendingOrderActionGroup" stepKey="voidOrder"/>
65+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/>
66+
<grabTextFrom selector="{{AdminOrderNotesSection.voidAuthorizationNotes}}" stepKey="voidAuthorizationNotesWithID"/>
67+
68+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
69+
<comment userInput="BIC workaround" stepKey="waitForCommentHistoryToLoad"/>
70+
<see selector="{{AdminOrderCommentsTabSection.orderComment}}" userInput="$voidAuthorizationNotesWithID" stepKey="seeOrderHistoryNotes"/>
71+
72+
<!-- Check the last transaction of the order-->
73+
<actionGroup ref="AdminValidatesVoidTransactionInOrderActionGroup" stepKey="validateVoidTxn"/>
74+
<see selector="{{AdminTransactionsGridSection.isClosed}}" userInput="Yes" stepKey="seeIsClosedIsYes"/>
75+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
76+
<actionGroup ref="AdminValidatesAuthorizationTransactionInOrderActionGroup" stepKey="validateAuthTxn"/>
77+
<see selector="{{AdminTransactionsGridSection.isClosed}}" userInput="Yes" stepKey="seeIsClosedIsYesForAuthorization"/>
78+
</test>
79+
</tests>
80+

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderNotesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminOrderNotesSection">
1212
<element name="customerNotifiedStatusOfOrderNoteByText" type="text" selector="//div[@class='note-list-comment' and contains(text(),'{{text}}')]//preceding-sibling::span[@class='note-list-customer']/span" parameterized="true"/>
13+
<element name="voidAuthorizationNotes" type="text" selector="(.//*[@class='note-list-comment'])[1]"/>
1314
</section>
1415
</sections>

0 commit comments

Comments
 (0)