|
| 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="StorefrontResolveWindowsCount"> |
| 12 | + <executeJS function="return 0;" stepKey="windowsCount"/> |
| 13 | + <executeInSelenium function="function ($webdriver) use (&$windowsCount) { |
| 14 | + $windowsCount = count($webdriver->getWindowHandles()); |
| 15 | + }" stepKey="calculateWindowsCount"/> |
| 16 | + </actionGroup> |
| 17 | + <actionGroup name="StorefrontWaitForPaypalWindowAppearsAndSwitchTo"> |
| 18 | + <arguments> |
| 19 | + <argument name="windowsCount" type="string"/> |
| 20 | + </arguments> |
| 21 | + <executeInSelenium function="function ($webdriver) use ({{windowsCount}}, $I) { |
| 22 | + $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::numberOfWindowsToBe({{windowsCount}} + 1)); |
| 23 | + $handles = $webdriver->getWindowHandles(); |
| 24 | + $lastWindow = end($handles); |
| 25 | + $I->switchToWindow($lastWindow); |
| 26 | + }" stepKey="switchToPaypalSandboxTab"/> |
| 27 | + </actionGroup> |
| 28 | + <actionGroup name="StorefrontWaitForPaypalWindowCloseAndSwitchToMain"> |
| 29 | + <arguments> |
| 30 | + <argument name="windowsCount" type="string"/> |
| 31 | + </arguments> |
| 32 | + <executeInSelenium function="function ($webdriver) use ({{windowsCount}}, $I) { |
| 33 | + $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::numberOfWindowsToBe({{windowsCount}})); |
| 34 | + $handles = $webdriver->getWindowHandles(); |
| 35 | + $lastWindow = end($handles); |
| 36 | + $I->switchToWindow($lastWindow); |
| 37 | + }" stepKey="switchBackToMainWindow"/> |
| 38 | + </actionGroup> |
| 39 | + <!-- PayPal account login --> |
| 40 | + <actionGroup name="StorefrontPaypalLoginWithBuyerAccount"> |
| 41 | + <arguments> |
| 42 | + <argument name="buyerAccount" defaultValue="DefaultPaypalBuyerAccount"/> |
| 43 | + </arguments> |
| 44 | + <waitForElementVisible selector="{{PayPalPopupLoginSection.email}}" stepKey="waitForEmailFieldVisible"/> |
| 45 | + <fillField userInput="{{buyerAccount.email}}" selector="{{PayPalPopupLoginSection.email}}" stepKey="fillBuyerEmail"/> |
| 46 | + <conditionalClick selector="{{PayPalPopupLoginSection.nextButton}}" dependentSelector="{{PayPalPopupLoginSection.password}}" visible="false" stepKey="proceedToPassword"/> |
| 47 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.busySpinner}}" stepKey="waitForBusySpinner"/> |
| 48 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.preloadSpinner}}" stepKey="waitForPreloadSpinner"/> |
| 49 | + <waitForElementVisible selector="{{PayPalPopupLoginSection.password}}" stepKey="waitForPasswordFieldVisible"/> |
| 50 | + <fillField userInput="{{buyerAccount.password}}" selector="{{PayPalPopupLoginSection.password}}" stepKey="fillBuyerPassword"/> |
| 51 | + <click selector="{{PayPalPopupLoginSection.loginButton}}" stepKey="clickLogin"/> |
| 52 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.busySpinner}}" stepKey="waitForBusySpinnerAfterLogin"/> |
| 53 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.preloadSpinner}}" stepKey="waitForPreloadSpinnerAfterLogin"/> |
| 54 | + </actionGroup> |
| 55 | + <!-- Assumes we are logged in to PayPal account --> |
| 56 | + <!-- PayPal account submit review --> |
| 57 | + <actionGroup name="StorefrontPaypalWindowSubmitReview"> |
| 58 | + <waitForElementVisible time="30" selector="{{PayPalPopupReviewSection.continueButton}}" stepKey="waitForContinuaButtonVisible"/> |
| 59 | + <click selector="{{PayPalPopupReviewSection.continueButton}}" stepKey="clickContinueButton"/> |
| 60 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.busySpinner}}" stepKey="waitForBusySpinner"/> |
| 61 | + <waitForElementNotVisible time="30" selector="{{PayPalPopupLoginSection.preloadSpinner}}" stepKey="waitForPreloadSpinner"/> |
| 62 | + </actionGroup> |
| 63 | +</actionGroups> |
0 commit comments