Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertGrandTotalOrderReview.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertGrandTotalOrderReview extends AbstractConstraint
16 {
22  protected $waitElement = '.loading-mask';
23 
31  public function processAssert(CheckoutOnepage $checkoutOnepage, $grandTotal)
32  {
33  $checkoutOnepage->getReviewBlock()->waitForElementNotVisible($this->waitElement);
34  $checkoutReviewGrandTotal = $checkoutOnepage->getReviewBlock()->getGrandTotal();
35 
36  \PHPUnit\Framework\Assert::assertEquals(
37  number_format($grandTotal, 2),
38  $checkoutReviewGrandTotal,
39  "Grand Total price: $checkoutReviewGrandTotal not equals with price from data set: $grandTotal"
40  );
41  }
42 
48  public function toString()
49  {
50  return 'Grand Total price equals to price from data set.';
51  }
52 }
processAssert(CheckoutOnepage $checkoutOnepage, $grandTotal)