PayPalExpressCheckoutConfigurationActionGroup.xml 5.8 KB

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