示例#1
0
 /**
  * {@inheritdoc}
  */
 public function clickPayButtonForGivenPayment(PaymentInterface $payment)
 {
     $table = $this->getElement('table');
     $row = $this->tableAccessor->getRowWithFields($this->getElement('table'), ['#' => $payment->getId()]);
     $actions = $this->tableAccessor->getFieldFromRow($table, $row, 'Action');
     $actions->clickLink('Pay');
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function isThereProduct(ProductInterface $product)
 {
     if (!($table = $this->getDocument()->find('css', 'table'))) {
         return false;
     }
     $row = $this->tableAccessor->getRowWithFields($table, ['id' => $product->getId()]);
     return null === $row;
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function hasItemWithProductAndQuantity($productName, $quantity)
 {
     $table = $this->getElement('items_table');
     try {
         $this->tableAccessor->getRowWithFields($table, ['item' => $productName, 'qty' => $quantity]);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
     return true;
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function isThereShippingMethodNamed($name)
 {
     if (null === ($table = $this->getDocument()->find('css', 'table'))) {
         return false;
     }
     try {
         $row = $this->tableAccessor->getRowWithFields($table, ['name' => $name]);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
     return 1 === $row;
 }
示例#5
0
 /**
  * {@inheritDoc}
  */
 public function isItPossibleToChangePaymentMethodForOrder(OrderInterface $order)
 {
     $row = $this->tableAccessor->getRowWithFields($this->getElement('customer_orders'), ['number' => $order->getNumber()]);
     return $row->hasLink('Pay');
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function getUsedThemeName($channelCode)
 {
     $table = $this->getDocument()->find('css', 'table');
     $row = $this->tableAccessor->getRowWithFields($table, ['code' => $channelCode]);
     return trim($this->tableAccessor->getFieldFromRow($table, $row, 'theme')->getText());
 }