Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertShipmentNotInShipmentsGrid.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Shipping\Test\Page\Adminhtml\ShipmentIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertShipmentNotInShipmentsGrid extends AbstractConstraint
17 {
26  public function processAssert(ShipmentIndex $shipmentIndex, OrderInjectable $order, array $ids)
27  {
28  $shipmentIndex->open();
29  $orderId = $order->getId();
30  $totalQty = $order->getTotalQtyOrdered();
31  foreach ($ids['shipmentIds'] as $key => $shipmentIds) {
32  $filter = [
33  'id' => $shipmentIds,
34  'order_id' => $orderId
35  ];
36  $filterQty = [
37  'total_qty_from' => $totalQty[$key],
38  'total_qty_to' => $totalQty[$key],
39  ];
40  $shipmentIndex->getShipmentsGrid()->search($filter + $filterQty);
41  \PHPUnit\Framework\Assert::assertFalse(
42  $shipmentIndex->getShipmentsGrid()->isRowVisible($filter, false),
43  'Shipment is present in shipment grid on shipment index page.'
44  );
45  }
46  }
47 
53  public function toString()
54  {
55  return 'Shipment is absent in the shipment grid on shipment index page.';
56  }
57 }
$order
Definition: order.php:55
processAssert(ShipmentIndex $shipmentIndex, OrderInjectable $order, array $ids)