Skip to content

Commit 400c218

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-70959' into 2.1.8-develop-pr24
2 parents aecb20b + eb16a87 commit 400c218

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function openEstimateShippingAndTax()
8686
*/
8787
public function selectShippingMethod(array $shipping)
8888
{
89+
$this->waitForUpdatedShippingMethods();
8990
$selector = sprintf($this->shippingMethod, $shipping['shipping_service'], $shipping['shipping_method']);
9091
if (!$this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible()) {
9192
$this->openEstimateShippingAndTax();

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping/Method.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ class Method extends Block
4242
*/
4343
protected $blockWaitElement = '._block-content-loading';
4444

45+
/**
46+
* Wait until shipping rates will appear.
47+
*
48+
* @return void
49+
*/
50+
private function waitForShippingRates()
51+
{
52+
// Code under test uses JavaScript setTimeout at this point as well.
53+
sleep(3);
54+
$this->waitForElementNotVisible($this->blockWaitElement);
55+
}
56+
4557
/**
4658
* Select shipping method.
4759
*
@@ -50,20 +62,19 @@ class Method extends Block
5062
*/
5163
public function selectShippingMethod(array $method)
5264
{
53-
// Code under test uses JavaScript setTimeout at this point as well.
54-
sleep(3);
65+
$this->waitForShippingRates();
5566
$selector = sprintf($this->shippingMethod, $method['shipping_method'], $method['shipping_service']);
56-
$this->waitForElementNotVisible($this->blockWaitElement);
5767
$this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click();
5868
}
5969

6070
/**
61-
* Click continue button
71+
* Click continue button.
6272
*
6373
* @return void
6474
*/
6575
public function clickContinue()
6676
{
77+
$this->waitForShippingRates();
6778
$this->_rootElement->find($this->continue)->click();
6879
$browser = $this->browser;
6980
$selector = $this->waitElement;

0 commit comments

Comments
 (0)