Example #1
0
 /**
  * We use 'see' command only on visible elements
  *
  * @param $text
  * @param null $selector
  * @return array
  */
 protected function proceedSee($text, $selector = null)
 {
     if (!$selector) {
         return parent::proceedSee($this->escape($text), $selector);
     }
     try {
         $nodes = $this->session->getPage()->findAll('css', $selector);
     } catch (\Symfony\Component\CssSelector\Exception\ParseException $e) {
         $nodes = @$this->session->getPage()->findAll('xpath', $selector);
     }
     $values = '';
     foreach ($nodes as $node) {
         if (!$this->session->getDriver()->isVisible($node->getXpath())) {
             continue;
         }
         $values .= '<!-- Merged Output -->' . $node->getText();
     }
     return array('contains', $this->escape($text), $values, "'{$selector}' selector For more details look for page snapshot in the log directory");
 }
Example #2
0
 /**
  * We use 'see' command only on visible elements
  *
  * @param $text
  * @param null $selector
  * @return array
  */
 protected function proceedSee($text, $selector = null)
 {
     if (!$selector) {
         return parent::proceedSee($this->escape($text), $selector);
     }
     try {
         $nodes = $this->session->getPage()->findAll('css', $selector);
     } catch (\Symfony\Component\CssSelector\Exception\ParseException $e) {
         $nodes = @$this->session->getPage()->findAll('xpath', $selector);
     }
     $values = array();
     foreach ($nodes as $node) {
         if (!$this->session->getDriver()->isVisible($node->getXpath())) {
             continue;
         }
         $values[] = $node->getText();
     }
     $values = implode("-->\n", $values);
     return array($text, $values, "'{$selector}' selector.");
 }