/** * {@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'); }
/** * {@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; }
/** * {@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; }
/** * {@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; }
/** * {@inheritDoc} */ public function isItPossibleToChangePaymentMethodForOrder(OrderInterface $order) { $row = $this->tableAccessor->getRowWithFields($this->getElement('customer_orders'), ['number' => $order->getNumber()]); return $row->hasLink('Pay'); }
/** * {@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()); }