Skip to content

Commit 75320e3

Browse files
committed
MAGETWO-52478: CreateOnlineCreditMemoBraintreePaypalTest is failing on closing popup window
- Added fix for tests from shopping cart
1 parent 2f31299 commit 75320e3

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/CheckoutWithPaypalFromCartStep.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function __construct(CheckoutCart $checkoutCart)
3737
public function run()
3838
{
3939
$this->checkoutCart->open();
40-
$this->checkoutCart->getCartBlock()
40+
$currentWindow = $this->checkoutCart->getCartBlock()
4141
->braintreePaypalCheckout();
42-
$this->checkoutCart->getBraintreePaypalBlock()->process();
42+
$this->checkoutCart->getBraintreePaypalBlock()->process($currentWindow);
4343
}
4444
}

dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/CheckoutWithPaypalFromMinicartStep.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function run()
6161
{
6262
$product = reset($this->products);
6363
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
64-
$this->catalogProductView->getViewBlock()->braintreePaypalCheckout();
65-
$this->catalogProductView->getBraintreePaypalBlock()->process();
64+
$parentWindow = $this->catalogProductView->getViewBlock()->braintreePaypalCheckout();
65+
$this->catalogProductView->getBraintreePaypalBlock()->process($parentWindow);
6666
}
6767
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,12 @@ public function inContextPaypalCheckout()
302302

303303
/**
304304
* Press 'Check out with Braintree PayPal' button.
305-
*
306-
* @return void
305+
*
306+
* @return string
307307
*/
308308
public function braintreePaypalCheckout()
309309
{
310+
$currentWindow = $this->browser->getCurrentWindow();
310311
/** @var \Magento\Checkout\Test\Block\Cart\Sidebar $miniCart */
311312
$miniCart = $this->blockFactory->create(
312313
'\Magento\Checkout\Test\Block\Cart\Sidebar',
@@ -315,6 +316,7 @@ public function braintreePaypalCheckout()
315316

316317
$miniCart->openMiniCart();
317318
$miniCart->clickBraintreePaypalButton();
319+
return $currentWindow;
318320
}
319321

320322
/**

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ public function getOnepageLinkBlock()
152152
/**
153153
* Click "Check out with Braintree PayPal" button.
154154
*
155-
* @return void
155+
* @return string
156156
*/
157157
public function braintreePaypalCheckout()
158158
{
159+
$currentWindow = $this->browser->getCurrentWindow();
159160
$this->_rootElement->find($this->braintreePaypalCheckoutButton, Locator::SELECTOR_XPATH)
160161
->click();
162+
return $currentWindow;
161163
}
162164

163165
/**

0 commit comments

Comments
 (0)