Skip to content

Commit ca77ce5

Browse files
committed
ACQE-4869 : Complete a Sales Order Paid with PayPal Payments Standard
Created a payment standard testcase and cancelled order
1 parent 995a05c commit ca77ce5

8 files changed

+209
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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="AdminPayPalStandardEnableActionGroup">
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="SamplePaypalExpressConfig2"/>
17+
<argument name="countryCode" type="string" defaultValue="us"/>
18+
</arguments>
19+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
20+
<waitForPageLoad stepKey="waitForPageLoad1"/>
21+
<waitForElementClickable selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForExpandOtherPaypalConfigButton" />
22+
<click selector ="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="expandOtherPaypalConfigButton"/>
23+
<scrollTo selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" x="0" y="-80" stepKey="scrollToConfigure"/>
24+
<waitForElementClickable selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalStandardConfigureBtn" />
25+
<click selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalStandardConfigureBtn"/>
26+
<waitForElementVisible selector="{{PayPalStandardConfigSection.email(countryCode)}}" stepKey="waitForEmailTab"/>
27+
<fillField selector ="{{PayPalStandardConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
28+
<selectOption selector ="{{PayPalStandardConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
29+
<fillField selector ="{{PayPalStandardConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
30+
<fillField selector ="{{PayPalStandardConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
31+
<fillField selector ="{{PayPalStandardConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
32+
<selectOption selector ="{{PayPalStandardConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
33+
<selectOption selector="{{PayPalStandardConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
34+
<waitForElementClickable selector="{{AdminConfigSection.saveButton}}" stepKey="waitForConfigureBtn" />
35+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
36+
<waitForPageLoad stepKey="waitForPageLoad2"/>
37+
</actionGroup>
38+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<!--Create Shipment With Tracking Number-->
12+
<actionGroup name="AdminSelectPaypalStandardPaymentInPaymentPageActionGroup">
13+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
14+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
15+
<waitForElementClickable selector="{{CheckoutPaymentSection.ContinuePayPalBtn}}" stepKey="waitForPayPalBtn"/>
16+
<click selector="{{CheckoutPaymentSection.ContinuePayPalBtn}}" stepKey="clickPayPalBtn"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="StorefrontLoginToPayPalStandardPaymentActionGroup" extends="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup">
12+
<annotations>
13+
<description>remove click btn which is not coming when we login with paypal standard payment enabled</description>
14+
</annotations>
15+
<remove keyForRemoval="clickNext"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Data/PaypalData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@
196196
<entity name="DisablePaypalPayflowProVault" type="payflowpro_cc_vault_active">
197197
<data key="value">0</data>
198198
</entity>
199+
<entity name="EnablePaypalPayStandard">
200+
<data key="path">payment/wps_express/active</data>
201+
<data key="value">1</data>
202+
</entity>
203+
<entity name="DisablePaypalPayStandard">
204+
<data key="path">payment/wps_express/active</data>
205+
<data key="value">0</data>
206+
</entity>
199207
<entity name="Visa3DSecureCard" type="data">
200208
<data key="cardNumber">4000000000000002</data>
201209
<data key="month">12</data>

app/code/Magento/Paypal/Test/Mftf/Section/PayPalExpressCheckoutConfigSection/CheckoutPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="smartButtonPayPalFrame" type="iframe" selector=".component-frame" timeout="10"/>
1414
<element name="PayPalPaymentRadio" type="radio" selector="input#paypal_express.radio" timeout="30"/>
1515
<element name="PayPalBtn" type="radio" selector=".paypal-button.paypal-button-number-0" timeout="30"/>
16+
<element name="ContinuePayPalBtn" type="radio" selector="//span[text()='Continue to PayPal']"/>
1617
</section>
1718
</sections>
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="PayPalStandardConfigSection">
11+
<element name="configureBtn" type="button" selector="//button[@id='payment_{{countryCode}}_paypal_group_all_in_one_wps_express-head']" parameterized="true"/>
12+
<element name="email" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_business_account" parameterized="true"/>
13+
<element name="apiMethod" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_authentication" parameterized="true"/>
14+
<element name="username" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_username" parameterized="true"/>
15+
<element name="password" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_password" parameterized="true"/>
16+
<element name="signature" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_signature" parameterized="true"/>
17+
<element name="sandboxMode" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_sandbox_flag" parameterized="true"/>
18+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_enable_express_checkout" parameterized="true"/>
19+
</section>
20+
</sections>
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="ConfigPayPalStandardSuite">
10+
<before>
11+
<!-- Login -->
12+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
13+
<!--Config PayPal Standard-->
14+
<actionGroup ref="AdminPayPalStandardEnableActionGroup" stepKey="ConfigPayPalStandard"/>
15+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
16+
<argument name="tags" value="config full_page"/>
17+
</actionGroup>
18+
</before>
19+
<after>
20+
<!-- Cleanup PayPal Standard configurations -->
21+
<magentoCLI command="config:set {{DisablePaypalPayStandard.path}} {{DisablePaypalPayStandard.value}}" stepKey="disablePayPalStandard"/>
22+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
23+
<argument name="tags" value="config full_page"/>
24+
</actionGroup>
25+
</after>
26+
<include>
27+
<group name="paypalStandard"/>
28+
</include>
29+
</suite>
30+
</suites>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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="AdminCancelledPaymentStandardOrderTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Payment standard methods"/>
14+
<title value="Complete a Sales Order Paid with PayPal Payments Standard"/>
15+
<description value="Complete order paid with PayPalStandard and cancelled in backend"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4808"/>
18+
<group value="paypalStandard"/>
19+
<group value="3rd_party_integration" />
20+
</annotations>
21+
<before>
22+
<!-- Login to admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Simple product is created -->
25+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct">
26+
<field key="price">140.98</field>
27+
</createData>
28+
<!-- US Customer is created -->
29+
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
30+
</before>
31+
<after>
32+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
<!-- Logout-->
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
36+
</after>
37+
<!-- Navigate to StoreFront -->
38+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
39+
<!-- Add product to cart -->
40+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
41+
<argument name="product" value="$$createProduct$$"/>
42+
</actionGroup>
43+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
44+
<!-- Click Next button -->
45+
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
46+
<!-- Click on PayPal payment radio button and click on continue btn -->
47+
<actionGroup ref="AdminSelectPaypalStandardPaymentInPaymentPageActionGroup" stepKey="selectPaypalStandardPaymentAndClickOnContinueButton"/>
48+
<!-- Login to PayPal in-context and verify order total on PayPal page-->
49+
<actionGroup ref="StorefrontLoginToPayPalStandardPaymentActionGroup" stepKey="loginToPayPal"/>
50+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
51+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>
52+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
53+
<!-- Go to order page -->
54+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderedPage">
55+
<argument name="orderId" value="{$grabOrderNumber}"/>
56+
</actionGroup>
57+
<actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption">
58+
<argument name="orderStatus" value="Canceled"/>
59+
</actionGroup>
60+
<!--Grab the transaction id-->
61+
<waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/>
62+
<grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/>
63+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
64+
<waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Canceled order')}}" userInput="Canceled order online Amount: $145.98. Transaction ID: &quot;{$grabTransactionID}&quot;" stepKey="seeOrderHistoryNotesAfterCancelingOrder"/>
65+
<waitForText selector="{{AdminOrderCommentsTabSection.orderComment}}" userInput="Authorized amount of $145.98." stepKey="seeOrderHistoryNotes"/>
66+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
67+
<argument name="transactionType" value="authorization"/>
68+
</actionGroup>
69+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
70+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
71+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
72+
<actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization">
73+
<argument name="transactionType" value="void"/>
74+
</actionGroup>
75+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
76+
</test>
77+
</tests>

0 commit comments

Comments
 (0)