/**
  * Assert that deleted customers address is not displayed on backend during order creation.
  *
  * @param SalesOrderIndex $orderIndex
  * @param SalesOrderCreateIndex $orderCreateIndex
  * @param Address $deletedAddress
  * @param Customer $customer
  * @return void
  */
 public function processAssert(SalesOrderIndex $orderIndex, SalesOrderCreateIndex $orderCreateIndex, Address $deletedAddress, Customer $customer)
 {
     $orderIndex->open()->getPageActionsBlock()->addNew();
     $orderCreateIndex->getCustomerGrid()->selectCustomer($customer);
     $orderCreateIndex->getStoreBlock()->selectStoreView();
     \PHPUnit_Framework_Assert::assertNotContains($this->prepareAddress($deletedAddress), $orderCreateIndex->getCreateBlock()->getBillingAddressForm()->getExistingAddresses(), 'Deleted address is present on backend during order creation');
 }
 /**
  * Add products by SKU on backend.
  *
  * @param Customer $customer
  * @param array $orderOptions
  * @param string $cartBlock
  * @param string|null $products
  * @return array
  */
 public function test(Customer $customer, array $orderOptions, $cartBlock, $products = null)
 {
     // Preconditions
     $products = $this->createProducts($products);
     $orderOptions = $this->prepareOrderOptions($products, $orderOptions);
     // Steps
     $this->orderIndex->open();
     $this->orderIndex->getPageActionsBlock()->addNew();
     $this->orderCreateIndex->getCustomerGrid()->selectCustomer($customer);
     $this->orderCreateIndex->getStoreBlock()->selectStoreView();
     $orderCreateBlock = $this->orderCreateIndex->getAdvancedOrderCreateBlock();
     $orderCreateBlock->getItemsBlock()->clickAddProductsBySku();
     $orderCreateBlock->getAddToOrderBySkuBlock()->getOrderBySkuForm()->fillForm($orderOptions);
     $this->orderCreateIndex->getAdvancedOrderCreateBlock()->getAddToOrderBySkuBlock()->addToCart();
     $filteredProducts = $this->filterProducts($products, $cartBlock);
     return ['products' => isset($filteredProducts['cart']) ? $filteredProducts['cart'] : [], 'requiredAttentionProducts' => isset($filteredProducts['required_attention']) ? $filteredProducts['required_attention'] : []];
 }
 /**
  * Select Store on create order page.
  *
  * @return void
  */
 public function run()
 {
     $this->orderCreateIndex->getStoreBlock()->selectStoreView($this->store);
 }