Author: Arkadiusz Krakowiak (arkadiusz.krakowiak@lakion.com)
Inheritance: extends Sylius\Behat\Page\SymfonyPageInterface
示例#1
0
 /**
  * @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) {
     }
 }
示例#2
0
 /**
  * @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.');
 }
示例#3
0
 /**
  * @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!');
 }
示例#4
0
 /**
  * @Then I should not be logged in
  */
 public function iShouldNotBeLoggedIn()
 {
     Assert::false($this->homePage->hasLogoutButton(), 'I should not be logged in.');
 }
示例#5
0
 /**
  * @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);
 }
示例#6
0
 /**
  * @When /^I visit (this channel)'s homepage$/
  */
 public function iVisitChannelHomepage(ChannelInterface $channel)
 {
     $this->channelContextSetter->setChannel($channel);
     $this->homePage->open();
 }
示例#7
0
 /**
  * @When I log out
  */
 public function iLogOut()
 {
     $this->homePage->logOut();
 }
示例#8
0
 /**
  * @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));
 }
示例#10
0
 /**
  * @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');
 }