Skip to content

Commit c9d651f

Browse files
shanthishanthi
authored andcommitted
ACQE-6250: Updated test file and AdminAuthorizeAnOrderActionGroup
1 parent aa79ff1 commit c9d651f

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

app/code/Magento/Paypal/Test/Mftf/Test/PlaceOrderUsingPaypalExpressWithPaymentActionOrderTest.xml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</actionGroup>
2828
</before>
2929
<after>
30+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
3031
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
3132
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3233
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
@@ -43,18 +44,15 @@
4344
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart">
4445
<argument name="productName" value="$simpleProduct.name$"/>
4546
</actionGroup>
46-
<!--<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
47-
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>-->
48-
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="onCheckout"/>
49-
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate">
47+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutPage"/>
48+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate">
5049
<argument name="shippingMethodName" value="Flat Rate"/>
5150
</actionGroup>
5251
<!-- Go to Order review -->
5352
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
5453
<waitForElement selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/>
5554
<click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/>
5655
<waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/>
57-
<wait time="120" stepKey="waiting"/>
5856
<!-- Click on Paypal paypal button-->
5957
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
6058
<!--Login to Paypal in-context-->
@@ -63,17 +61,22 @@
6361
<actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/>
6462
<!--Click PayPal button and go back to Magento site-->
6563
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/>
66-
<!-- I see order successful Page instead of Order Review Page -->
64+
<!-- See order successful Page instead of Order Review Page -->
6765
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
6866
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/>
67+
<!--Grab order number-->
6968
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/>
7069
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/>
70+
<!--Go to admin sales page and open the order id-->
7171
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
7272
<argument name="orderId" value="{$grabOrderNumber}"/>
7373
</actionGroup>
74-
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$128.00" stepKey="checkGrandTotal"/>
74+
<!--Assert the total-->
75+
<waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$128.00" stepKey="checkGrandTotal"/>
76+
<!--Grab the transaction id-->
7577
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
7678
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
79+
<!--Open comment history tab and assert the comment-->
7780
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
7881
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Ordered amount')}}" userInput="Ordered amount of $128.00 Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotes"/>
7982
<waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/>
@@ -95,28 +98,31 @@
9598
<actionGroup ref="AdminAssertAuthorizeButtonOnOrderPageActionGroup" stepKey="assertAuthorizeButtonIsPresentAfterUnHolding"/>
9699
<!--Authorize the order-->
97100
<actionGroup ref="AdminAuthorizeAnOrderActionGroup" stepKey="authorizeTheOrder"/>
98-
<!--Open Comments history tab and seert the comment for authorization-->
101+
<!--Open Comments history tab and assert the comment for authorization-->
99102
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppeared"/>
100103
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/>
101104
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterAuthorizing"/>
102105
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Authorized amount')}}" userInput="Authorized amount of $128.00. Transaction ID: &quot;{$grabLastTransactionID}&quot;" stepKey="seeOrderHistoryNotesAfterAuthorizing"/>
103106
<dontSee selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="dontSeeAuthorizationButtonAfterAuthorizing"/>
107+
<!--Assert the invoice button is present-->
104108
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoiceButtonToBeAppeared"/>
105-
<waitForElement selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="assertInvoiceButtonIsPresent"/>
109+
<!--Assert the authorization transaction is present in transaction grid-->
106110
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
107111
<argument name="transactionType" value="authorization"/>
108112
</actionGroup>
109113
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedAfterAsserting"/>
110114
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonAfterAsserting"/>
115+
<!--Submit invoice-->
111116
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
112117
<seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType"/>
113-
<!--Submit creating invoice into the order-->
118+
<!--Submit creating invoice into the order and assert the status of the order-->
114119
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoiceIntoOrder"/>
115120
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus">
116121
<argument name="status" value="Processing"/>
117122
</actionGroup>
118123
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/>
119124
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/>
125+
<!--Open the comment history tab and assert the comment-->
120126
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/>
121127
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $128.00 online. Transaction ID: &quot;{$grabLastTransactionIDForCaptured}&quot;" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/>
122128
</test>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAuthorizeAnOrderActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<argument name="orderStatus" type="string" defaultValue="Processing"/>
1717
</arguments>
1818
<waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="waitForAuthorizeButtonToBeClickable"/>
19-
<click selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="clickCancelOrder"/>
19+
<click selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="clickAuthorizeOrder"/>
2020
<waitForText selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to authorize full order amount?" stepKey="seeConfirmationMessage"/>
21-
<waitForElementClickable selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForOkayButtonToAppeare"/>
21+
<waitForElementClickable selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForOkayButtonToAppear"/>
2222
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrder"/>
2323
<waitForText selector="{{AdminMessagesSection.success}}" userInput="Payment authorization has been successfully created." stepKey="seeAuthorizedSuccessMessage"/>
2424
<waitForText selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatus"/>

0 commit comments

Comments
 (0)