Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertTaxCalculationAfterCheckoutDownloadable.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutCart;
10 use Magento\Checkout\Test\Page\CheckoutOnepage;
11 use Magento\Checkout\Test\Page\CheckoutOnepageSuccess;
12 use Magento\Cms\Test\Page\CmsIndex;
14 use Magento\Sales\Test\Page\CustomerOrderView;
15 use Magento\Mtf\Fixture\InjectableFixture;
17 
22 {
28  protected $severeness = 'high';
29 
41  public function processAssert(
42  array $prices,
43  InjectableFixture $product,
44  CheckoutCart $checkoutCart,
45  CheckoutOnepage $checkoutOnepage,
46  CheckoutOnepageSuccess $checkoutOnepageSuccess,
47  CustomerOrderView $customerOrderView,
48  CmsIndex $cmsIndex
49  ) {
50  $this->checkoutOnepage = $checkoutOnepage;
51  $this->customerOrderView = $customerOrderView;
52 
53  $checkoutCart->getProceedToCheckoutBlock()->proceedToCheckout();
54  $cmsIndex->getCmsPageBlock()->waitPageInit();
55  $checkoutOnepage->getPaymentBlock()->selectPaymentMethod(['method' => 'checkmo']);
56  $actualPrices = [];
57  $actualPrices = $this->getReviewPrices($actualPrices, $product);
58  $actualPrices = $this->getReviewTotals($actualPrices);
59  $prices = $this->preparePrices($prices);
60  //Order review prices verification
61  $message = 'Prices on order review should be equal to defined in dataset.';
62  \PHPUnit\Framework\Assert::assertEquals($prices, array_filter($actualPrices), $message);
63 
64  $checkoutOnepage->getPaymentBlock()->placeOrder();
65  $checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
66  $checkoutOnepageSuccess->getSuccessBlock()->openOrder();
67  $actualPrices = [];
68  $actualPrices = $this->getOrderPrices($actualPrices, $product);
69  $actualPrices = $this->getOrderTotals($actualPrices);
70 
71  //Frontend order prices verification
72  $message = 'Prices on order view page should be equal to defined in dataset.';
73  \PHPUnit\Framework\Assert::assertEquals($prices, array_filter($actualPrices), $message);
74  }
75 }
$message
processAssert(array $prices, InjectableFixture $product, CheckoutCart $checkoutCart, CheckoutOnepage $checkoutOnepage, CheckoutOnepageSuccess $checkoutOnepageSuccess, CustomerOrderView $customerOrderView, CmsIndex $cmsIndex)