File tree Expand file tree Collapse file tree 3 files changed +22
-13
lines changed
dev/tests/functional/tests/app/Magento
Checkout/Test/Block/Onepage/Payment Expand file tree Collapse file tree 3 files changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,15 @@ public function waitForFormLoaded()
40
40
/**
41
41
* Process PayPal auth flow
42
42
*
43
- * @return void
43
+ * @param null|string $parentWindow
44
+ *
44
45
*/
45
- public function process ()
46
+ public function process ($ parentWindow = null )
46
47
{
47
48
$ this ->browser ->selectWindow ();
48
49
$ this ->waitForFormLoaded ();
49
50
$ this ->browser ->find ($ this ->submitButton )->click ();
50
- /**
51
- * This try/catch is intended as workaround in case if popup window is closed instantly and #login-preview
52
- * selector cannot be found.
53
- */
54
- try {
55
- $ this ->waitForElementNotVisible ($ this ->selector );
56
- } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $ e ) {
57
- }
58
- $ this ->browser ->selectWindow ();
51
+ $ this ->browser ->selectWindow ($ parentWindow );
59
52
$ this ->waitForElementNotVisible ($ this ->loader );
60
53
}
61
54
}
Original file line number Diff line number Diff line change @@ -78,8 +78,11 @@ public function run()
78
78
if (isset ($ this ->prices ['grandTotal ' ])) {
79
79
$ this ->assertGrandTotalOrderReview ->processAssert ($ this ->checkoutOnepage , $ this ->prices ['grandTotal ' ]);
80
80
}
81
- $ this ->checkoutOnepage ->getPaymentBlock ()->getSelectedPaymentMethodBlock ()->clickPlaceOrder ();
82
- $ this ->checkoutOnepage ->getBraintreePaypalBlock ()->process ();
81
+ $ parentWindow = $ this ->checkoutOnepage ->getPaymentBlock ()
82
+ ->getSelectedPaymentMethodBlock ()
83
+ ->clickContinueToPaypal ();
84
+ $ this ->checkoutOnepage ->getBraintreePaypalBlock ()->process ($ parentWindow );
85
+
83
86
$ order = $ this ->fixtureFactory ->createByCode (
84
87
'orderInjectable ' ,
85
88
[
Original file line number Diff line number Diff line change @@ -70,6 +70,19 @@ public function clickPlaceOrder()
70
70
$ this ->waitForElementNotVisible ($ this ->waitElement );
71
71
}
72
72
73
+ /**
74
+ * Click Continue to Paypal button.
75
+ *
76
+ * @return string
77
+ */
78
+ public function clickContinueToPaypal ()
79
+ {
80
+ $ currentWindow = $ this ->browser ->getCurrentWindow ();
81
+ $ this ->_rootElement ->find ($ this ->placeOrderButton )->click ();
82
+ $ this ->waitForElementNotVisible ($ this ->waitElement );
83
+ return $ currentWindow ;
84
+ }
85
+
73
86
/**
74
87
* Click "Check out with PayPal" button.
75
88
*/
You can’t perform that action at this time.
0 commit comments