/** * @Then I should not be able to shop without default locale */ public function iShouldNotBeAbleToShop() { try { $this->homePage->tryToOpen(); throw new \Exception('The page should not be able to open.'); } catch (LocaleNotFoundException $e) { } }
/** * @Then I should be redirected to the homepage */ public function iShouldBeRedirectedToTheHomepage() { Assert::true($this->homePage->isOpen(), 'Shop homepage should be opened, but it is not.'); }
/** * @Then I should not be able to shop without default currency */ public function iShouldNotBeAbleToShop() { $this->homePage->tryToOpen(); Assert::false($this->homePage->isOpen(), 'Homepage should not be opened!'); }
/** * @Then I should not be logged in */ public function iShouldNotBeLoggedIn() { Assert::false($this->homePage->hasLogoutButton(), 'I should not be logged in.'); }
/** * @Then I should not see a homepage from :theme theme */ public function iShouldNotSeeThemedHomepage(ThemeInterface $theme) { $content = file_get_contents(rtrim($theme->getPath(), '/') . '/SyliusShopBundle/views/Homepage/index.html.twig'); Assert::notSame($this->homePage->getContents(), $content); }
/** * @When /^I visit (this channel)'s homepage$/ */ public function iVisitChannelHomepage(ChannelInterface $channel) { $this->channelContextSetter->setChannel($channel); $this->homePage->open(); }
/** * @When I log out */ public function iLogOut() { $this->homePage->logOut(); }
/** * @Then I should not see a homepage from :theme theme */ public function iShouldNotSeeThemedHomepage(ThemeInterface $theme) { $content = file_get_contents(rtrim($theme->getPath(), '/') . '/SyliusWebBundle/views/Frontend/Homepage/main.html.twig'); expect($this->homePage->getContents())->notToBe($content); }
/** * @Then I should not be logged in as :fullName */ public function iShouldNotBeLoggedInAs($fullName) { $this->homePage->open(); Assert::false($this->homePage->hasLogoutButton(), 'I should not be logged in.'); Assert::false(strpos($this->homePage->getFullName(), $fullName), sprintf('I should not be logged in as %s.', $fullName)); }
/** * @Then I should see :numberOfProducts products in the list */ public function iShouldSeeProductsInTheList($numberOfProducts) { $foundProductsNames = $this->homePage->getLatestProductsNames(); Assert::same((int) $numberOfProducts, count($foundProductsNames), '%d rows with products should appear on page, %d rows has been found'); }