/**
  * Assert shipment with corresponding shipment/order ID is present in 'Shipments' with correct total qty field
  *
  * @param ShipmentIndex $shipmentIndex
  * @param OrderInjectable $order
  * @param array $ids
  * @return void
  */
 public function processAssert(ShipmentIndex $shipmentIndex, OrderInjectable $order, array $ids)
 {
     $shipmentIndex->open();
     $orderId = $order->getId();
     $totalQty = $order->getTotalQtyOrdered();
     foreach ($ids['shipmentIds'] as $key => $shipmentIds) {
         $filter = ['id' => $shipmentIds, 'order_id' => $orderId, 'total_qty_from' => $totalQty[$key], 'total_qty_to' => $totalQty[$key]];
         \PHPUnit_Framework_Assert::assertTrue($shipmentIndex->getShipmentsGrid()->isRowVisible($filter), 'Shipment is absent in shipment grid on shipment index page.');
     }
 }
 /**
  * Process assert.
  *
  * @param OrderInjectable $order
  * @param array $ids
  * @param SalesShipmentView $salesShipmentView
  * @param array|null $data [optional]
  * @return void
  */
 protected function assert(OrderInjectable $order, array $ids, SalesShipmentView $salesShipmentView, array $data = null)
 {
     $orderId = $order->getId();
     $productsData = $this->prepareOrderProducts($order, $data['items_data']);
     foreach ($ids['shipmentIds'] as $shipmentId) {
         $filter = ['order_id' => $orderId, 'id' => $shipmentId];
         $this->shipmentPage->getShipmentsGrid()->searchAndOpen($filter);
         $itemsData = $this->preparePageItems($salesShipmentView->getItemsBlock()->getData());
         $error = $this->verifyData($productsData, $itemsData);
         \PHPUnit_Framework_Assert::assertEmpty($error, $error);
     }
 }
 /**
  * Assert that shipment is present in the shipments grid
  *
  * @param ShipmentIndex $shipmentIndex
  * @param array         $ids
  *
  * @return void
  */
 public function processAssert(ShipmentIndex $shipmentIndex, array $ids)
 {
     foreach ($ids as $orderId => $shipmentIds) {
         $shipmentIndex->open();
         $grid = $shipmentIndex->getShipmentsGrid();
         foreach ($shipmentIds as $shipmentId) {
             $filter = ['id' => $shipmentId, 'order_id' => $orderId];
             $grid->search($filter);
             \PHPUnit_Framework_Assert::assertTrue($grid->isRowVisible($filter, false, true), 'Shipment is absent on shipments grid.');
         }
     }
 }