/** * @Then I should be logged in */ public function iShouldBeLoggedIn() { $this->shouldBeLoggedIn = true; $verification = new WebAssert($this->getSession()); $verification->elementNotExists('css', '.ez-loginform'); $jsCode = "return (document.querySelector('.ez-loginform') === null);"; }
/** * Verify if we're on an expected page. Throw an exception if not. */ public function verifyPage() { if ($this->getDriver() instanceof Selenium2Driver) { $this->getSession()->wait(5000, '$("#sAGB").length > 0'); } $namedSelectors = $this->getNamedSelectors(); $language = Helper::getCurrentLanguage(); try { $assert = new WebAssert($this->getSession()); $assert->pageTextContains($namedSelectors['gtc'][$language]); } catch (ResponseTextException $e) { $message = ['You are not on the checkout confirmation page!', 'Current URL: ' . $this->getSession()->getCurrentUrl()]; Helper::throwException($message); } }
/** * {@inheritdoc} */ protected function cleanUrl($url) { if ($url instanceof Url) { $url = $url->setAbsolute()->toString(); } // Strip the base URL from the beginning for absolute URLs. if ($this->baseUrl !== '' && strpos($url, $this->baseUrl) === 0) { $url = substr($url, strlen($this->baseUrl)); } // Make sure there is a forward slash at the beginning of relative URLs for // consistency. if (parse_url($url, PHP_URL_HOST) === NULL && strpos($url, '/') !== 0) { $url = "/{$url}"; } return parent::cleanUrl($url); }
/** * @param string $keyword */ public function receiveNoResultsMessageForKeyword($keyword) { $assert = new WebAssert($this->getSession()); $assert->pageTextContains(sprintf('Leider wurden zu "%s" keine Artikel gefunden', $keyword)); }
/** * @Then I should see an/a field with value :value */ public function seeFieldtWithValue($value) { if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) { $this->clickEditActionBar('Publish'); } $verification = new WebAssert($this->getSession()); $verification->elementTextContains('css', '.ez-fieldview-value-content', $value); }
/** * Check if the user was successfully logged in * @param string $username * @throws \Behat\Mink\Exception\ResponseTextException */ public function verifyLogin($username) { $assert = new WebAssert($this->getSession()); $assert->pageTextContains('Dies ist Ihr Konto Dashboard, wo Sie die Möglichkeit haben, Ihre letzten Kontoaktivitäten einzusehen'); $assert->pageTextContains('Willkommen, ' . $username); }
/** * @Then Publishing fails with validation error message :messege * * Creates a Content with the previously defined ContentType */ public function failsWithMessage($message) { $verification = new WebAssert($this->getSession()); $verification->elementTextContains('css', '.ez-editfield-error-message', $message); }
/** * @param string $keyword */ public function receiveNoResultsMessageForKeyword($keyword) { // $keyword gets ignored in responsive template $assert = new WebAssert($this->getSession()); $assert->pageTextContains('Leider wurden zu Ihrer Suchanfrage keine Artikel gefunden'); }
/** * 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'); }
/** * Checks, that page doesn't contain specified text. * * @Then I should not see :text */ public function assertPageNotContainsText($text) { $this->assert->pageTextNotContains($text); }
/** * @Given /^the "(?P<field>[^"]*)" field should contain:$/ */ public function theFieldShouldContain($field, PyStringNode $string) { $assert = new WebAssert($this->getSession()); $assert->fieldValueEquals($field, $string->getRaw()); }