File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart Expand file tree Collapse file tree 1 file changed +12
-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,18 @@ 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 (
135
+ function () use ($ browser , $ windowsCount ) {
136
+ return count ($ browser ->getWindowHandles ()) === ($ windowsCount + 1 ) ? true : null ;
137
+ }
138
+ );
129
139
}
130
140
131
141
/**
You can’t perform that action at this time.
0 commit comments