/**
  * Assert that rma is correct display on frontend (MyAccount - My Returns):
  * - status on rma history page
  * - details and items on rma view page
  *
  * @param Rma $rma
  * @param CmsIndex $cmsIndex
  * @param CustomerAccountIndex $customerAccountIndex
  * @param RmaReturnHistory $rmaReturnHistory
  * @param RmaReturnView $rmaReturnView
  * @return void
  */
 public function processAssert(Rma $rma, CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, RmaReturnHistory $rmaReturnHistory, RmaReturnView $rmaReturnView)
 {
     $this->rmaReturnHistory = $rmaReturnHistory;
     $this->rmaReturnView = $rmaReturnView;
     $this->order = $rma->getDataFieldConfig('order_id')['source']->getOrder();
     $this->customer = $this->order->getDataFieldConfig('customer_id')['source']->getCustomer();
     $this->productHandlerClass = $this->getProductHandlerClass();
     $this->login();
     $cmsIndex->getTopLinksBlock()->openAccountLink('My Account');
     $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('My Returns');
     $this->assertRmaStatus($rma);
     $rmaReturnHistory->getRmaHistory()->getItemRow($rma)->open();
     $this->assertRequestInformation($rma);
     $this->assertItemsData($rma);
 }
 /**
  * Cancel created order.
  *
  * @param Order $order
  * @return array
  */
 public function test(Order $order)
 {
     // Preconditions
     $order->persist();
     // Steps
     $this->orderIndex->open();
     $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
     $this->salesOrderView->getPageActions()->cancel();
     return ['customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer(), 'orderId' => $order->getId(), 'product' => $order->getEntityId()['products'][0]];
 }
Esempio n. 3
0
 /**
  * Prepare customer data.
  *
  * @param array $data
  * @return array
  */
 protected function prepareCustomerData(array $data)
 {
     return ['currency_id' => $data['base_currency_code'], 'customer_id' => $this->customer->getData('id'), 'payment' => $data['payment_authorization_amount'], 'store_id' => $this->order->getDataFieldConfig('store_id')['source']->store->getStoreId()];
 }