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 =" ConfigPayPalExpressCheckout" >
11
+ <amOnPage url =" {{AdminConfigPaymentMethodsPage.url}}" stepKey =" navigateToPaymentConfigurationPage" />
12
+ <waitForPageLoad stepKey =" waitForPageLoad1" />
13
+ <click selector =" {{PayPalExpressCheckoutConfigSection.configureBtn}}" stepKey =" clickPayPalConfigureBtn" />
14
+ <waitForElementVisible selector =" {{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey =" waitForAdvancedSettingTab" />
15
+ <fillField selector =" {{PayPalExpressCheckoutConfigSection.email}}" userInput =" {{_CREDS.paypal_express_email}}" stepKey =" inputEmailAssociatedWithPayPalMerchantAccount" />
16
+ <selectOption selector =" {{PayPalExpressCheckoutConfigSection.apiMethod}}" userInput =" API Signature" stepKey =" inputAPIAuthenticationMethods" />
17
+ <fillField selector =" {{PayPalExpressCheckoutConfigSection.username}}" userInput =" {{_CREDS.paypal_express_api_username}}" stepKey =" inputAPIUsername" />
18
+ <fillField selector =" {{PayPalExpressCheckoutConfigSection.password}}" userInput =" {{_CREDS.paypal_express_api_password}}" stepKey =" inputAPIPassword" />
19
+ <fillField selector =" {{PayPalExpressCheckoutConfigSection.signature}}" userInput =" {{_CREDS.paypal_express_api_signature}}" stepKey =" inputAPISignature" />
20
+ <selectOption selector =" {{PayPalExpressCheckoutConfigSection.sandboxMode}}" userInput =" Yes" stepKey =" enableSandboxMode" />
21
+ <selectOption selector =" {{PayPalExpressCheckoutConfigSection.enableSolution}}" userInput =" Yes" stepKey =" enableSolution" />
22
+ <fillField selector =" {{PayPalExpressCheckoutConfigSection.merchantID}}" userInput =" {{_CREDS.paypal_express_merchantID}}" stepKey =" inputMerchantID" />
23
+ <!-- Save configuration-->
24
+ <click selector =" {{AdminConfigSection.saveButton}}" stepKey =" saveConfig" />
25
+ </actionGroup >
26
+ <actionGroup name =" CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends =" CreateOrderToPrintPageActionGroup" >
27
+ <waitForElement selector =" {{CheckoutPaymentSection.paymentSectionTitle}}" stepKey =" waitForPlaceOrderButton" />
28
+ <click selector =" {{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey =" clickPlaceOrder" />
29
+ <!-- set ID for iframe of PayPal group button-->
30
+ <executeJS function =" jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey =" clickOrderLink" />
31
+ <!-- switch to iframe of PayPal group button-->
32
+ <comment userInput =" switch to iframe of PayPal group button" stepKey =" commentSwitchToIframe" />
33
+ <switchToIFrame userInput =" myIframe" stepKey =" clickPrintOrderLink" />
34
+ <waitForElementVisible selector =" {{CheckoutPaymentSection.PayPalBtn}}" stepKey =" waitForPayPalBtn" />
35
+ <click selector =" {{CheckoutPaymentSection.PayPalBtn}}" stepKey =" clickPayPalBtn" />
36
+ <switchToIFrame stepKey =" switchBack1" />
37
+ <!-- Check in-context-->
38
+ <comment userInput =" Check in-context" stepKey =" commentVerifyInContext" />
39
+ <switchToNextTab stepKey =" switchToInContentTab" />
40
+ <waitForPageLoad stepKey =" waitForPageLoad" />
41
+ <seeCurrentUrlMatches regex =" ~\//www.sandbox.paypal.com/~" stepKey =" seeCurrentUrlMatchesConfigPath1" />
42
+ <waitForElement selector =" {{PayPalPaymentSection.email}}" stepKey =" waitForLoginForm" />
43
+ <fillField selector =" {{PayPalPaymentSection.email}}" userInput =" {{Payer.buyerEmail}}" stepKey =" fillEmail" />
44
+ <fillField selector =" {{PayPalPaymentSection.password}}" userInput =" {{Payer.buyerPassword}}" stepKey =" fillPassword" />
45
+ <click selector =" {{PayPalPaymentSection.loginBtn}}" stepKey =" login" />
46
+ <waitForPageLoad stepKey =" wait" />
47
+ <seeElement selector =" {{PayPalPaymentSection.reviewUserInfo}}" stepKey =" seePayerName" />
48
+ </actionGroup >
49
+ <actionGroup name =" addProductToCheckoutPage" >
50
+ <arguments >
51
+ <argument name =" Category" />
52
+ </arguments >
53
+ <amOnPage url =" {{StorefrontCategoryPage.url(Category.name)}}" stepKey =" onCategoryPage" />
54
+ <waitForPageLoad stepKey =" waitForPageLoad1" />
55
+ <moveMouseOver selector =" {{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey =" hoverProduct" />
56
+ <click selector =" {{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey =" addToCart" />
57
+ <waitForElementVisible selector =" {{StorefrontCategoryMainSection.SuccessMsg}}" time =" 30" stepKey =" waitForProductAdded" />
58
+ <click selector =" {{StorefrontMinicartSection.showCart}}" stepKey =" clickCart" />
59
+ <click selector =" {{StorefrontMinicartSection.goToCheckout}}" stepKey =" goToCheckout" />
60
+ <waitForPageLoad stepKey =" waitForPageLoad2" />
61
+ <waitForLoadingMaskToDisappear stepKey =" waitForLoadingMask" />
62
+ <click selector =" {{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey =" selectFirstShippingMethod" />
63
+ <waitForLoadingMaskToDisappear stepKey =" waitForLoadingMask2" />
64
+ <waitForElement selector =" {{CheckoutShippingMethodsSection.next}}" time =" 30" stepKey =" waitForNextButton" />
65
+ <click selector =" {{CheckoutShippingMethodsSection.next}}" stepKey =" clickNext" />
66
+ <waitForElement selector =" {{CheckoutPaymentSection.paymentSectionTitle}}" stepKey =" waitForPlaceOrderButton" />
67
+ <click selector =" {{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey =" clickPayPalCheckbox" />
68
+ </actionGroup >
69
+ </actionGroups >
0 commit comments