Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11 use Magento\Catalog\Test\Page\Product\CatalogProductView;
12 use Magento\Checkout\Test\Page\CheckoutCart;
14 use Magento\Mtf\Fixture\FixtureFactory;
15 use Magento\Mtf\Fixture\InjectableFixture;
16 
21 {
27  protected $severeness = 'high';
28 
44  public function processAssert(
45  InjectableFixture $product,
46  array $prices,
47  $qty,
48  CmsIndex $cmsIndex,
49  CatalogCategoryView $catalogCategoryView,
50  CatalogProductView $catalogProductView,
52  FixtureFactory $fixtureFactory
53  ) {
54  $this->cmsIndex = $cmsIndex;
55  $this->catalogCategoryView = $catalogCategoryView;
56  $this->catalogProductView = $catalogProductView;
57  $this->checkoutCart = $checkoutCart;
58 
59  //Assertion steps
60  $actualPrices = [];
61  $productCategory = $product->getCategoryIds()[0];
62  $this->openCategory($productCategory);
63  $actualPrices = $this->getCategoryPrices($product, $actualPrices);
64  $catalogCategoryView->getListProductBlock()->getProductItem($product)->open();
65  $catalogProductView->getViewBlock()->fillOptions($product);
66  $actualPrices = $this->getProductPagePrices($actualPrices);
67  $catalogProductView->getViewBlock()->clickAddToCart();
68  $catalogProductView->getMessagesBlock()->waitSuccessMessage();
69  $checkoutCart->open();
70  $actualPrices = $this->getCartPrices($product, $actualPrices);
71  $actualPrices = $this->getTotals($actualPrices);
72  //Prices verification
73  $message = 'Prices from dataset should be equal to prices on frontend';
74  \PHPUnit\Framework\Assert::assertEquals($prices, array_filter($actualPrices), $message);
75  }
76 }
$message
processAssert(InjectableFixture $product, array $prices, $qty, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, CatalogProductView $catalogProductView, CheckoutCart $checkoutCart, FixtureFactory $fixtureFactory)
getCategoryPrices(FixtureInterface $product, $actualPrices)