AmazonCheckoutActionGroup.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. <!--Begin checkout and proceed to final step-->
  11. <actionGroup name="AmazonCheckoutBeginActionGroup">
  12. <waitForElement selector="{{CheckoutShippingMethodsSection.shippingMethodRow}}" time="20" stepKey="apWaitForShipping"/>
  13. <waitForPageLoad stepKey="apWaitPageLoadShipping" />
  14. <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="clickShippingMethod"/>
  15. <waitForPageLoad stepKey="waitForPageLoadPayment1" />
  16. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
  17. <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickContinueButton"/>
  18. <waitForPageLoad stepKey="waitForPageLoadPayment2" />
  19. <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
  20. </actionGroup>
  21. <!--Place order-->
  22. <actionGroup name="AmazonCheckoutSubmitActionGroup" extends="AmazonCheckoutBeginActionGroup">
  23. <!--Click Place Order button-->
  24. <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
  25. <!--See success messages-->
  26. <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
  27. </actionGroup>
  28. <!--Select credit card number and submit-->
  29. <actionGroup name="AmazonCheckoutCcActionGroup">
  30. <arguments>
  31. <argument name="cc" defaultValue="1111" type="string"/>
  32. </arguments>
  33. <executeJS function="return window.name;" stepKey="topName"/>
  34. <!--Get wallet iframe name (dynamic)-->
  35. <executeJS function="return jQuery('#walletWidgetDiv iframe').attr('name');" stepKey="iframeName"/>
  36. <!--Expand Wallet Widget to expose all CC# (and avoid JS paging)-->
  37. <executeJS function="jQuery('#walletWidgetDiv').css('height', '450px');" stepKey="executeJsHeight"/>
  38. <!--Select CC#-->
  39. <switchToIFrame userInput="{$iframeName}" stepKey="switchToIFrameWidget"/>
  40. <executeJS function="$('.card-number:contains({{cc}})').closest('a').click();" stepKey="executeJsCc"/>
  41. <!--Place order-->
  42. <switchToWindow userInput="{$topName}" stepKey="switchToWindowTop" />
  43. <waitForPageLoad stepKey="waitForPageLoadPayment1" />
  44. <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
  45. <waitForPageLoad stepKey="waitForPageLoadPayment2"/>
  46. </actionGroup>
  47. </actionGroups>