Skip to content

Commit d0d18eb

Browse files
author
Michail Slabko
committed
MAGETWO-31159: Varnish coverage increase
- fix test after merge
1 parent a6a8b3c commit d0d18eb

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

app/code/Magento/Checkout/Controller/Cart/EstimatePost.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function execute()
6868
->setRegion($region)
6969
->setCollectShippingRates(true);
7070
$this->quoteRepository->save($this->cart->getQuote());
71+
$this->cart->save();
7172
return $this->_goBack();
7273
}
7374
}

app/code/Magento/Checkout/Controller/Cart/EstimateUpdatePost.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function execute()
1616
$code = (string)$this->getRequest()->getParam('estimate_method');
1717
if (!empty($code)) {
1818
$this->cart->getQuote()->getShippingAddress()->setShippingMethod($code)->save();
19+
$this->cart->save();
1920
}
2021
return $this->_goBack();
2122
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ class Cart extends Block
5757
*/
5858
protected $cartEmpty = '.cart-empty';
5959

60+
/**
61+
* Cart container selector
62+
*
63+
* @var string
64+
*/
65+
protected $cartContainer = '.cart-container';
66+
6067
/**
6168
* Get cart item block
6269
*
@@ -170,4 +177,12 @@ public function cartIsEmpty()
170177
{
171178
return $this->_rootElement->find($this->cartEmpty, Locator::SELECTOR_CSS)->isVisible();
172179
}
180+
181+
/**
182+
* Wait while cart container is loaded
183+
*/
184+
public function waitCartContainerLoading()
185+
{
186+
$this->waitForElementVisible($this->cartContainer);
187+
}
173188
}

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/EstimateShippingAndTaxStep.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ public function __construct(
106106
public function run()
107107
{
108108
$this->checkoutCart->open();
109+
$this->checkoutCart->getCartBlock()->waitCartContainerLoading();
109110
$this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($this->address);
111+
$this->checkoutCart->getCartBlock()->waitCartContainerLoading();
110112
if ($this->shipping['shipping_service'] !== '-') {
111113
$this->checkoutCart->getShippingBlock()->selectShippingMethod($this->shipping);
112114
}

0 commit comments

Comments
 (0)