/** * {@inheritdoc} */ public function isOrderWithNumberInTheList($number) { try { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('customer_orders'), ['number' => $number]); return 1 === count($rows); } catch (\InvalidArgumentException $exception) { return false; } }
/** * {@inheritdoc} */ public function isResourceOnPage(array $parameters) { try { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters); return 1 === count($rows); } catch (\InvalidArgumentException $exception) { return false; } catch (ElementNotFoundException $exception) { return false; } }
/** * {@inheritdoc} */ public function isSingleResourceWithSpecificElementOnPage(array $parameters, $element) { try { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters); if (1 !== count($rows)) { return false; } return null !== $rows[0]->find('css', $element); } catch (\InvalidArgumentException $exception) { return false; } catch (ElementNotFoundException $exception) { return false; } }
/** * {@inheritdoc} */ public function isProductInTheList($name) { try { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('order_items'), ['item' => $name]); return 1 === count($rows); } catch (\InvalidArgumentException $exception) { return false; } }
/** * @param string $itemName * @param string $property * * @return string */ private function getItemProperty($itemName, $property) { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['item' => $itemName]); return $rows[0]->find('css', '.' . $property)->getText(); }
/** * {@inheritdoc} */ public function countPaymentWithSpecificState($state) { $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['state' => $state]); return count($rows); }