Skip to content

Commit c9a541d

Browse files
Merge branch 'ACQE-4324' into ACQE-6192_mainline_PR_deployment
2 parents 86b444e + 7a59575 commit c9a541d

13 files changed

+273
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminConfigurePayPalPaymentsProActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="credentials" defaultValue="SamplePaypalPaymentsProConfig"/>
17+
<argument name="countryCode" type="string" defaultValue="us"/>
18+
</arguments>
19+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
20+
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
21+
<waitForElementClickable selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForConfigureButtonToBeClicked"/>
22+
<click selector ="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="expandOtherPaypalConfigButton"/>
23+
<scrollTo selector="{{PayPalPaymentsProConfigSection.paymentsAdvanced(countryCode)}}" stepKey="scrollToConfigure"/>
24+
<waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalPaymentsProConfigureBtn"/>
25+
<click selector ="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalPaymentsProConfigureBtn"/>
26+
<scrollTo selector="{{PayPalPaymentsProConfigSection.partner(countryCode)}}" stepKey="scrollToBottom"/>
27+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.partner(countryCode)}}" stepKey="waitForPartner"/>
28+
<fillField selector ="{{PayPalPaymentsProConfigSection.partner(countryCode)}}" userInput="{{credentials.paypal_paymentspro_parner}}" stepKey="inputPartner"/>
29+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.user(countryCode)}}" stepKey="waitForUser"/>
30+
<fillField selector ="{{PayPalPaymentsProConfigSection.user(countryCode)}}" userInput="{{credentials.paypal_paymentspro_user}}" stepKey="inputUser"/>
31+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.vendor(countryCode)}}" stepKey="waitForVendor"/>
32+
<fillField selector ="{{PayPalPaymentsProConfigSection.vendor(countryCode)}}" userInput="{{credentials.paypal_paymentspro_vendor}}" stepKey="inputVendor"/>
33+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.password(countryCode)}}" stepKey="waitForPassword"/>
34+
<fillField selector ="{{PayPalPaymentsProConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_paymentspro_password}}" stepKey="inputPassword"/>
35+
<selectOption selector="{{PayPalPaymentsProConfigSection.testMode(countryCode)}}" userInput="Yes" stepKey="enableTestMode"/>
36+
<selectOption selector ="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
37+
<waitForElementClickable selector="{{AdminConfigSection.saveButton}}" stepKey="waitForSaveButtonBecomeClickable"/>
38+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
39+
<waitForPageLoad stepKey="waitForSaving"/>
40+
<waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigSuccessMessage"/>
41+
</actionGroup>
42+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontCheckoutSelectPaypalPaymentMethodActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<arguments>
1616
<argument name="paymentMethod" defaultValue="{{StorefrontPaypalCheckoutSection.creditCard}}" type="string"/>
1717
</arguments>
18+
<waitForElementClickable selector="{{paymentMethod}}" stepKey="waitForPaypalPaymentMethod"/>
1819
<click selector="{{paymentMethod}}" stepKey="selectPaypalPaymentMethod"/>
1920
<waitForPageLoad stepKey="waitForPaypalFormLoad"/>
2021
<scrollTo selector="{{paymentMethod}}" stepKey="scrollToCreditCardSection"/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="PayPalPaymentsProConfigSection">
11+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk-head" parameterized="true"/>
12+
<element name="partner" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_partner" parameterized="true"/>
13+
<element name="user" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_user" parameterized="true"/>
14+
<element name="vendor" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_vendor" parameterized="true"/>
15+
<element name="password" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_pwd" parameterized="true"/>
16+
<element name="testMode" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_sandbox_flag" parameterized="true"/>
17+
<element name="enableSolution" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_enable_paypal_payflow" parameterized="true"/>
18+
<element name="paymentsAdvanced" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced-head" parameterized="true"/>
19+
</section>
20+
</sections>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="ConfigurePaypalPaymentsProSuite">
10+
<before>
11+
<!-- Login -->
12+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
13+
<!--Config PayPal Payments Pro-->
14+
<actionGroup ref="AdminConfigurePayPalPaymentsProActionGroup" stepKey="configPayPalPaymentsPro">
15+
<argument name="credentials" value="SamplePaypalPaymentsProConfig"/>
16+
</actionGroup>
17+
</before>
18+
<after>
19+
<!-- Cleanup Paypal configurations -->
20+
<magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePayPalPaymentsPro"/>
21+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
22+
<argument name="tags" value="config full_page"/>
23+
</actionGroup>
24+
</after>
25+
<include>
26+
<group name="paypalPaymentsPro"/>
27+
</include>
28+
</suite>
29+
</suites>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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="paypalPaymentsPro"/>
19+
<group value="3rd_party_integration"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Go to product 1 and add it to cart -->
25+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
26+
<argument name="product" value="$$createSimpleProduct$$"/>
27+
</actionGroup>
28+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
29+
<argument name="productName" value="$createSimpleProduct.name$"/>
30+
</actionGroup>
31+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
32+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
33+
<!--Place order-->
34+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
35+
<argument name="shippingMethod" value="Flat Rate"/>
36+
</actionGroup>
37+
<actionGroup ref="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup" stepKey="selectPaypalPaymentMethod"/>
38+
<waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/>
39+
<actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal">
40+
<argument name="cardData" value="VisaDefaultCard"/>
41+
</actionGroup>
42+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
43+
<waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
44+
<waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/>
45+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumber"/>
46+
</before>
47+
<after>
48+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
49+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnRemoveButtonToUnFiltersIfPresent"/>
50+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
51+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
52+
</after>
53+
<!--Open order in sales -->
54+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
55+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
56+
<argument name="orderId" value="{$grabOrderNumber}"/>
57+
</actionGroup>
58+
<actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkSubtotal">
59+
<argument name="subtotal" value="$123.00"/>
60+
<argument name="shippingAndHandling" value="$5.00"/>
61+
<argument name="grandTotal" value="$128.00"/>
62+
</actionGroup>
63+
<!--Void created order -->
64+
<actionGroup ref="AdminVoidPendingOrderActionGroup" stepKey="voidPendingOrder"/>
65+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus">
66+
<argument name="status" value="Processing"/>
67+
</actionGroup>
68+
<!--Grab transaction ids -->
69+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForGrabLastTransactionID"/>
70+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/>
71+
<waitForElementVisible selector="{{AdminOrderNotesSection.voidAuthorizationNotes('$grabLastTransactionID')}}" stepKey="waitForVoidAuthorizationNotesWithID"/>
72+
<grabTextFrom selector="{{AdminOrderNotesSection.voidAuthorizationNotes('$grabLastTransactionID')}}" stepKey="getVoidAuthorizationNotesWithID"/>
73+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryTab"/>
74+
<waitForText selector="{{AdminOrderCommentsTabSection.authorizationNotes('Voided')}}" userInput="$getVoidAuthorizationNotesWithID" stepKey="seeOrderHistoryNotes"/>
75+
<!-- Check the last transaction of the order and validate the details for Void and Authorization-->
76+
<actionGroup ref="AdminViewTransactionsInOrderActionGroup" stepKey="validateVoidTransaction"/>
77+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
78+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
79+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
80+
<actionGroup ref="AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey="validateAuthTransaction"/>
81+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/>
82+
</test>
83+
</tests>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminViewAuthorizationTransactionsInOrderActionGroup" extends="AdminViewTransactionsInOrderActionGroup">
11+
<annotations>
12+
<description>Click the Transactions button on the Order Details page and validate authorization transaction</description>
13+
</annotations>
14+
<remove keyForRemoval="selectVoidTypeTxn"/>
15+
<remove keyForRemoval="assertEquals"/>
16+
<waitForElementVisible selector="{{AdminTransactionsGridSection.orderTxnTableTypeFilter}}" after="orderTransactionsTableIsVisible" stepKey="waitForTransactionTypeAuthorizationToBeClicked"/>
17+
<selectOption selector="{{AdminTransactionsGridSection.orderTxnTableTypeFilter}}" userInput="authorization" after="orderTransactionsTableIsVisible" stepKey="selectAuthorizationTypeTxn" />
18+
<assertRegExp stepKey="assertEquals" message="pass">
19+
<expectedResult type="string">/([0-9a-z\-])*(?&lt;!authorization)$/</expectedResult>
20+
<actualResult type="variable">getVoidTransaction</actualResult>
21+
</assertRegExp>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminViewTransactionsInOrderActionGroup">
11+
<annotations>
12+
<description>Click the Transactions button on the Order Details page</description>
13+
</annotations>
14+
<waitForElementClickable selector="{{AdminTransactionsGridSection.transactionsSectionBtn}}" stepKey="waitForTransactionsTabToBeClicked"/>
15+
<click selector="{{AdminTransactionsGridSection.transactionsSectionBtn}}" stepKey="clickTransactionsTab"/>
16+
<waitForElementVisible selector="{{AdminTransactionsGridSection.orderTxnTable}}" stepKey="orderTransactionsTableIsVisible"/>
17+
<selectOption selector="{{AdminTransactionsGridSection.orderTxnTableTypeFilter}}" userInput="void" stepKey="selectVoidTypeTxn" />
18+
<waitForElementClickable selector="{{AdminTransactionsGridSection.orderTxnTableSearchBtn}}" stepKey="waitToClickSearch"/>
19+
<click selector="{{AdminTransactionsGridSection.orderTxnTableSearchBtn}}" stepKey="clickSearch"/>
20+
<waitForPageLoad stepKey="waitForFilterToLoad"/>
21+
<waitForElementClickable selector="{{AdminTransactionsGridSection.orderTxnTableFirstRow}}" stepKey="clickOnVoidTransaction"/>
22+
<click selector="{{AdminTransactionsGridSection.orderTxnTableFirstRow}}" stepKey="clickVoidTxn"/>
23+
<waitForPageLoad stepKey="waitForTxnToLoad"/>
24+
<grabTextFrom selector="{{AdminTransactionsGridSection.transactionData('Transaction ID')}}" stepKey="getVoidTransaction"/>
25+
<assertRegExp stepKey="assertEquals" message="pass">
26+
<expectedResult type="string">/([0-9a-z\-])*(?&lt;!void)$/</expectedResult>
27+
<actualResult type="variable">getVoidTransaction</actualResult>
28+
</assertRegExp>
29+
</actionGroup>
30+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminVoidPendingOrderActionGroup">
12+
<annotations>
13+
<description>Click on Void on order view page</description>
14+
</annotations>
15+
<waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.void}}" stepKey="waitForVoidButtonVisible"/>
16+
<click selector="{{AdminOrderDetailsMainActionsSection.void}}" stepKey="clickOnVoid"/>
17+
<waitForText selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to void the payment?" stepKey="seeConfirmationMessage"/>
18+
<waitForElementClickable selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForOkButtonToBeClicked"/>
19+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmVoid"/>
20+
<waitForText selector="{{AdminMessagesSection.success}}" userInput="The payment has been voided." stepKey="seeVoidedSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="orderNotesList" type="text" selector="div[aria-labelledby='sales_order_view_tabs_order_history'] .edit-order-comments .note-list"/>
1313
<element name="orderComments" type="text" selector="div[aria-labelledby='sales_order_view_tabs_order_history'] .edit-order-comments-block"/>
1414
<element name="orderComment" type="text" selector="div[aria-labelledby='sales_order_view_tabs_order_history'] .comments-block-item-comment"/>
15+
<element name="authorizationNotes" type="text" selector=".//*[@class='comments-block-item-comment' and (contains(text(),'{{status}}'))]" parameterized="true"/>
1516
</section>
1617
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
<element name="orderId" type="text" selector="|Order # (\d+)|"/>
2727
<element name="orderStatusUnderViewM" type="text" selector="//td//div[contains(text(),'{{product}}')]/../..//td[@class='col-status' and contains(text(),'{{status}}')]" parameterized="true" timeout="30"/>
2828
<element name="orderStatusUnderViewS" type="text" selector="//tr//div[contains(text(),'{{product}}')]/../../..//td[@class='col-status' and contains(text(),'{{status}}')]" parameterized="true" timeout="30"/>
29+
<element name="paymentInformationField" type="text" selector="//*[contains(text(),'{{paymentInformationField}}')]/following-sibling::td" parameterized="true"/>
2930
</section>
3031
</sections>

0 commit comments

Comments
 (0)