File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Sidebar extends Block
34
34
*
35
35
* @var string
36
36
*/
37
- protected $ braintreePaypalCheckoutButton = '.// button[contains(@id, "braintree-paypal-mini-cart") ] ' ;
37
+ protected $ braintreePaypalCheckoutButton = 'button[id^= "braintree-paypal-mini-cart"] ' ;
38
38
39
39
/**
40
40
* Locator value for "Proceed to Checkout" button.
@@ -124,8 +124,16 @@ public function openMiniCart()
124
124
*/
125
125
public function clickBraintreePaypalButton ()
126
126
{
127
- $ this ->_rootElement ->find ($ this ->braintreePaypalCheckoutButton , Locator::SELECTOR_XPATH )
127
+ // Button can be enabled/disabled few times.
128
+ sleep (3 );
129
+
130
+ $ windowsCount = count ($ this ->browser ->getWindowHandles ());
131
+ $ this ->_rootElement ->find ($ this ->braintreePaypalCheckoutButton )
128
132
->click ();
133
+ $ browser = $ this ->browser ;
134
+ $ this ->browser ->waitUntil (function () use ($ browser , $ windowsCount ) {
135
+ return count ($ browser ->getWindowHandles ()) === ($ windowsCount + 1 ) ? true : null ;
136
+ });
129
137
}
130
138
131
139
/**
You can’t perform that action at this time.
0 commit comments