/** * @param string $language * @return bool * @throws \Exception */ public function verifyPage($language = '') { $info = Helper::getPageInfo($this->getSession(), ['controller', 'action']); if ($info['controller'] === 'checkout' && $info['action'] === 'cart') { return Helper::hasNamedLink($this, 'checkout', $language); } $message = ['You are not on the cart!', 'Current URL: ' . $this->getSession()->getCurrentUrl()]; Helper::throwException($message); return false; }
/** * @inheritdoc */ public function verifyPage() { if (Helper::hasNamedLink($this, 'moreProducts')) { return; } $errors = []; if (!$this->hasLink('Filtern')) { $errors[] = '- There is no filter link!'; } if (!$this->hasSelect('o')) { $errors[] = '- There is no order select!'; } if (!$errors) { return; } $message = ['You are not on a listing:']; $message = array_merge($message, $errors); $message[] = 'Current URL: ' . $this->getSession()->getCurrentUrl(); Helper::throwException($message); }
/** * @param string $language * @return bool */ public function verifyPage($language = '') { return Helper::hasNamedLink($this, 'checkout', $language); }
/** * Verify if we're on an expected page. Throw an exception if not. * @return bool * @throws \Exception */ public function verifyPage() { try { $assert = new WebAssert($this->getSession()); $assert->pageTextContains('1 Ihr Warenkorb 2 Ihre Adresse 3 Prüfen und Bestellen'); } catch (ResponseTextException $e) { $message = ['You are not on the cart!', 'Current URL: ' . $this->getSession()->getCurrentUrl()]; Helper::throwException($message); } return Helper::hasNamedLink($this, 'checkout'); }
/** * Helper function to check weather we are on the login page * @return bool */ protected function verifyPageLogin() { return $this->hasField('email') && $this->hasField('password') && Helper::hasNamedLink($this, 'forgotPasswordLink') && Helper::hasNamedButton($this, 'loginButton'); }