Esempio n. 1
0
 /**
  * @param array $urlParameters
  * @return boolean
  */
 public function isOpen(array $urlParameters = [])
 {
     if (!isset($urlParameters['id'])) {
         $urlParameters['id'] = '*';
     }
     return parent::isOpen($urlParameters);
 }
Esempio n. 2
0
 /**
  * @param string $locator
  * @param string $value
  */
 public function simpleFillField($locator, $value)
 {
     $field = parent::findField($locator);
     if (null === $field) {
         throw $this->elementNotFound('form field', 'id|name|label|value', $locator);
     }
     $field->setValue($value);
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 public function open(array $urlParameters = ['xml' => ''])
 {
     return parent::open($urlParameters);
 }
Esempio n. 4
0
 /**
  * @Given I am on the page for :page
  * @Then I should be on the page for :page
  */
 public function iAmOnPage(Page $page)
 {
     $page->open();
 }
Esempio n. 5
0
 /**
  * Clicks link with specified locator.
  *
  * @param string $locator
  *        	link id, title, text or image alt
  *        	
  * @throws ElementNotFoundException
  */
 public function clickLink($locator)
 {
     $this->scrollWindowToLink($locator);
     parent::clickLink($locator);
 }
Esempio n. 6
0
 /**
  * {@inheritdoc}
  */
 public function getElement($name, $timeout = 20, $message = 'no message')
 {
     return $this->spin(function () use($name) {
         return parent::getElement($name);
     }, $timeout, $message);
 }
Esempio n. 7
0
 /**
  * @param string $locator
  * @param string $value
  */
 public function simpleFillField($locator, $value)
 {
     $this->spin(function () use($locator) {
         return parent::findField($locator);
     })->setValue($value);
 }
Esempio n. 8
0
 /**
  * @param string $locator
  * @param string $value
  */
 public function simpleFillField($locator, $value)
 {
     $this->spin(function () use($locator) {
         return parent::findField($locator);
     }, sprintf('Cannot find field "%s"', $locator))->setValue($value);
 }
Esempio n. 9
0
 /**
  * Helper method that returns the content block of a page
  * @param Page $parent
  * @return \Behat\Mink\Element\NodeElement
  * @throws \Exception
  */
 public static function getContentBlock(Page $parent)
 {
     $contentBlocks = ['emotion' => 'div#content > div.inner', 'responsive' => 'div.content-main--inner'];
     foreach ($contentBlocks as $locator) {
         $block = $parent->find('css', $locator);
         if ($block) {
             return $block;
         }
     }
     self::throwException('No content block found!');
 }
Esempio n. 10
0
 /**
  * @param Session $session
  * @param Factory $factory
  * @param array $parameters
  * @param RouterInterface $router
  */
 public function __construct(Session $session, Factory $factory, array $parameters = array(), RouterInterface $router)
 {
     parent::__construct($session, $factory, $parameters);
     $this->router = $router;
 }
 /**
  * A bit of a hack, we require the Session to create instances of Notice, so we store it here
  * @param NodeElement $node
  * @param Session $session
  */
 public function __construct(Session $session, Factory $factory, array $parameters = array())
 {
     parent::__construct($session, $factory, $parameters);
     $this->session = $session;
 }
Esempio n. 12
0
 /**
  * @Then /^I should be on the (page "[^"]*")$/
  */
 public function iShouldBeOnThePage(Page $page)
 {
     $page->verifyPage();
 }
Esempio n. 13
0
 /**
  * @param string $name
  * @param array $arguments
  * @return Page
  */
 public function openPage($name, $arguments = [])
 {
     $this->currentPage = $this->getPage($name)->open($arguments);
     expect($this->currentPage->isOpen())->toBe(true);
     return $this->currentPage;
 }
Esempio n. 14
0
 /**
  * Helper function to get the current language ('de' or 'en')
  * @param Page $page
  * @return string
  */
 public static function getCurrentLanguage(Page $page)
 {
     $shop = null;
     $meta = $page->find('css', 'meta[name=application-name]');
     $shop = $meta->getAttribute('content');
     if ($shop === 'English') {
         return 'en';
     }
     return 'de';
 }