/**
  * Create tax report entity.
  *
  * @param OrderInjectable $order
  * @param TaxRule $taxRule
  * @param array $report
  * @param string $orderSteps
  * @return void
  */
 public function test(OrderInjectable $order, TaxRule $taxRule, array $report, $orderSteps)
 {
     // Precondition
     $taxRule->persist();
     $this->taxRule = $taxRule;
     $order->persist();
     $this->orderIndex->open();
     $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
     $this->processOrder($orderSteps, $order);
     $this->reportStatistic->open();
     $this->reportStatistic->getGridBlock()->massaction([['report' => 'Tax']], 'Refresh Statistics for the Last Day', true);
     // Steps
     $this->salesTaxReport->open();
     $this->salesTaxReport->getFilterBlock()->viewsReport($report);
     $this->salesTaxReport->getActionBlock()->showReport();
 }
 /**
  * Assert sales info in report: Tax, Rate, Orders, Tax Amount on tax report page
  *
  * @param SalesTaxReport $salesTaxReport
  * @param OrderInjectable $order
  * @param TaxRule $taxRule
  * @param string $taxAmount
  * @return void
  */
 public function processAssert(SalesTaxReport $salesTaxReport, OrderInjectable $order, TaxRule $taxRule, $taxAmount)
 {
     $filter = ['tax' => $taxRule->getTaxRate()[0], 'rate' => $taxRule->getDataFieldConfig('tax_rate')['source']->getFixture()[0]->getRate(), 'orders' => count($order->getEntityId()['products']), 'tax_amount' => $taxAmount];
     \PHPUnit_Framework_Assert::assertTrue($salesTaxReport->getGridBlock()->isRowVisible($filter, false), "Tax Report is not visible in grid on tax report page.");
 }