/**
  * Fill Shipping Data.
  *
  * @return array
  */
 public function run()
 {
     if ($this->shipping['shipping_service'] !== null) {
         $this->orderCreateIndex->getCreateBlock()->selectShippingMethod($this->shipping);
     }
     return ['shipping' => $this->shipping];
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     $block = $this->orderCreatePage->getCreateBlock();
     $this->payment['method'] .= '_cc_vault';
     $block->selectPaymentMethod($this->payment);
     $block->selectVaultToken('token_switcher_' . $this->payment['method']);
 }
예제 #3
0
 /**
  * Fill Sales Data.
  *
  * @return array
  */
 public function run()
 {
     $this->orderCreateIndex->getCreateBlock()->submitOrder();
     $this->salesOrderView->getMessagesBlock()->waitSuccessMessage();
     $orderId = trim($this->salesOrderView->getTitleBlock()->getTitle(), '#');
     $order = $this->fixtureFactory->createByCode('orderInjectable', ['data' => ['id' => $orderId, 'customer_id' => ['customer' => $this->customer], 'entity_id' => ['products' => $this->products], 'billing_address_id' => ['billingAddress' => $this->billingAddress]]]);
     return ['orderId' => $orderId, 'order' => $order];
 }
 /**
  * Add product to sales
  *
  * @return void
  */
 public function run()
 {
     $createBlock = $this->orderCreateIndex->getCreateBlock();
     $createBlock->getItemsBlock()->clickAddProducts();
     foreach ($this->products as $product) {
         $createBlock->getGridBlock()->searchAndSelect(['sku' => $product->getSku()]);
         $createBlock->getTemplateBlock()->waitLoader();
         if ($this->orderCreateIndex->getConfigureProductBlock()->isVisible()) {
             $this->orderCreateIndex->getConfigureProductBlock()->configProduct($product);
         }
     }
     $createBlock->addSelectedProductsToOrder();
     $createBlock->getTemplateBlock()->waitLoader();
 }
 /**
  * Assert product was added to Items Ordered grid in customer account on Order creation page backend
  *
  * @param OrderCreateIndex $orderCreateIndex
  * @param array $products
  * @throws \Exception
  * @return void
  */
 public function processAssert(OrderCreateIndex $orderCreateIndex, array $products)
 {
     if (empty($products)) {
         throw new \Exception("No products");
     }
     $data = $this->prepareData($products, $orderCreateIndex->getCreateBlock()->getItemsBlock());
     \PHPUnit_Framework_Assert::assertEquals($data['fixtureData'], $data['pageData'], 'Grouped product data on order create page not equals to passed from fixture.');
 }
 /**
  * Assert that deleted customers address is not displayed on backend during order creation
  *
  * @param OrderIndex $orderIndex
  * @param OrderCreateIndex $orderCreateIndex
  * @param Address $deletedAddress
  * @param Customer $customer
  * @return void
  */
 public function processAssert(OrderIndex $orderIndex, OrderCreateIndex $orderCreateIndex, Address $deletedAddress, Customer $customer)
 {
     $filter = ['email' => $customer->getEmail()];
     $orderIndex->open()->getGridPageActions()->addNew();
     $orderCreateIndex->getCustomerBlock()->searchAndOpen($filter);
     $orderCreateIndex->getStoreBlock()->selectStoreView();
     $actualAddresses = $orderCreateIndex->getCreateBlock()->getBillingAddressBlock()->getExistingAddresses();
     $addressRenderer = $this->objectManager->create('Magento\\Customer\\Test\\Block\\Address\\Renderer', ['address' => $deletedAddress]);
     $addressToSearch = $addressRenderer->render();
     \PHPUnit_Framework_Assert::assertFalse(in_array($addressToSearch, $actualAddresses), 'Deleted address is present on backend during order creation');
 }
 /**
  * Fill Payment data
  *
  * @return void
  */
 public function run()
 {
     $this->orderCreateIndex->getCreateBlock()->selectPaymentMethod($this->payment);
 }
 /**
  * @inheritdoc
  */
 public function run()
 {
     $block = $this->orderCreatePage->getCreateBlock();
     $block->selectPaymentMethod($this->payment, $this->creditCard);
     $block->saveCreditCard($this->payment['method'], $this->creditCardSave);
 }
 /**
  * Fill Order Account Data.
  *
  * @return void
  */
 public function run()
 {
     $this->orderCreateIndex->getCreateBlock()->getAccountBlock()->fill($this->customer);
 }
 /**
  * Fill Sales Data.
  *
  * @return Address
  */
 public function run()
 {
     $this->orderCreateIndex->getCreateBlock()->fillAddresses($this->billingAddress, $this->saveAddress);
     return ['billingAddress' => $this->billingAddress];
 }
 /**
  * Fill product data
  *
  * @return void
  */
 public function run()
 {
     $this->orderCreateIndex->getCreateBlock()->updateProductsData($this->products);
 }
예제 #12
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $block = $this->orderCreatePage->getCreateBlock();
     $block->selectPaymentMethod(['method' => 'vault']);
     $block->selectVaultToken('token_switcher_vault_item_');
 }