Skip to content

Commit 23b8ed8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-64297' into 2.1.8-develop-pr11
2 parents 5c6306d + a0492ba commit 23b8ed8

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class Totals extends Block
105105
*/
106106
public function getGrandTotal()
107107
{
108+
$this->waitForUpdatedTotals();
108109
$grandTotal = $this->_rootElement->find($this->grandTotal, Locator::SELECTOR_CSS)->getText();
109110
return $this->escapeCurrency($grandTotal);
110111
}

dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertDiscountInShoppingCart.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Checkout\Test\Fixture\Cart;
1010
use Magento\Checkout\Test\Page\CheckoutCart;
11+
use Magento\Customer\Test\Fixture\Customer;
1112
use Magento\Mtf\Constraint\AbstractConstraint;
1213

1314
/**
@@ -20,19 +21,29 @@ class AssertDiscountInShoppingCart extends AbstractConstraint
2021
/**
2122
* Assert that discount is equal to expected.
2223
*
24+
* @param Customer $customer
2325
* @param CheckoutCart $checkoutCart
2426
* @param Cart $cart
2527
* @return void
2628
*/
27-
public function processAssert(CheckoutCart $checkoutCart, Cart $cart)
28-
{
29+
public function processAssert(
30+
Customer $customer,
31+
CheckoutCart $checkoutCart,
32+
Cart $cart
33+
) {
34+
$loginStep = $this->objectManager->create(
35+
\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
36+
['customer' => $customer]
37+
);
38+
$loginStep->run();
2939
$checkoutCart->open();
3040
$checkoutCart->getTotalsBlock()->waitForUpdatedTotals();
3141
\PHPUnit_Framework_Assert::assertEquals(
3242
number_format($cart->getDiscount(), 2),
3343
$checkoutCart->getTotalsBlock()->getDiscount(),
3444
'Discount amount in the shopping cart not equals to discount amount from fixture.'
3545
);
46+
$loginStep->cleanUp();
3647
}
3748

3849
/**

0 commit comments

Comments
 (0)