/**
  * Assert Credit Memo info in report: Refunds Orders, Total Refunded
  *
  * @param OrderInjectable $order
  * @param array $refundsReport
  * @param array $initialRefundsResult
  * @param RefundsReport $refundsReportPage
  * @return void
  */
 public function processAssert(OrderInjectable $order, array $refundsReport, array $initialRefundsResult, RefundsReport $refundsReportPage)
 {
     $this->salesReportPage = $refundsReportPage;
     $this->order = $order;
     $this->searchInSalesReportGrid($refundsReport);
     $salesResult = $refundsReportPage->getGridBlock()->getLastResult();
     $prepareInitialResult = $this->prepareExpectedResult($initialRefundsResult);
     \PHPUnit_Framework_Assert::assertEquals($prepareInitialResult, $salesResult, "Refund total Sales result is not correct.");
 }
 /**
  * Refunds report
  *
  * @param OrderInjectable $order
  * @param array $refundsReport
  * @return array
  */
 public function test(OrderInjectable $order, array $refundsReport)
 {
     // Preconditions
     $this->refundsReport->open();
     $this->refundsReport->getMessagesBlock()->clickLinkInMessages('notice', 'here');
     $this->refundsReport->getFilterBlock()->viewsReport($refundsReport);
     $this->refundsReport->getActionBlock()->showReport();
     $initialRefundsResult = $this->refundsReport->getGridBlock()->getLastResult();
     $order->persist();
     $invoice = $this->objectManager->create('Magento\\Sales\\Test\\TestStep\\CreateInvoiceStep', ['order' => $order]);
     $invoice->run();
     $creditMemo = $this->objectManager->create('Magento\\Sales\\Test\\TestStep\\CreateCreditMemoStep', ['order' => $order]);
     $creditMemo->run();
     return ['initialRefundsResult' => $initialRefundsResult];
 }