File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
dev/tests/functional/tests/app/Magento/Checkout/Test/Block Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -172,8 +172,19 @@ public function getOnepageLinkBlock()
172172 public function braintreePaypalCheckout ()
173173 {
174174 $ currentWindow = $ this ->browser ->getCurrentWindow ();
175+ // $this->_rootElement->find($this->braintreePaypalCheckoutButton, Locator::SELECTOR_XPATH)
176+ // ->click();
177+ // Button can be enabled/disabled few times.
178+ sleep (2 );
179+
180+ $ windowsCount = count ($ this ->browser ->getWindowHandles ());
175181 $ this ->_rootElement ->find ($ this ->braintreePaypalCheckoutButton , Locator::SELECTOR_XPATH )
176182 ->click ();
183+ $ browser = $ this ->browser ;
184+ $ this ->browser ->waitUntil (function () use ($ browser , $ windowsCount ) {
185+ return count ($ browser ->getWindowHandles ()) === ($ windowsCount + 1 ) ? true : null ;
186+ });
187+
177188 return $ currentWindow ;
178189 }
179190
You can’t perform that action at this time.
0 commit comments