/** * 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(); }
/** * Sales coupon report * * @param OrderInjectable $order * @param array $viewsReport * @return void */ public function test(OrderInjectable $order, array $viewsReport) { // Precondition $order->persist(); $this->orderIndex->open(); $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); $this->orderView->getPageActions()->invoice(); $this->orderInvoiceNew->getTotalsBlock()->submit(); $this->reportStatistic->open(); $this->reportStatistic->getGridBlock()->massaction([['report' => 'Coupons']], 'Refresh Statistics for the Last Day', true); // Steps $this->salesCouponReportView->open(); $ruleName = $order->getCouponCode()->getName(); $viewsReport['rules_list'] = str_replace('%rule_name%', $ruleName, $viewsReport['rules_list']); $this->salesCouponReportView->getFilterBlock()->viewsReport($viewsReport); $this->salesCouponReportView->getActionBlock()->showReport(); }