Assert that the element with the given selector is visible.

@param  string  $selector
@return $this
424322
public function assertVisible($selector)
    {
        $fullSelector = $this->resolver->format($selector);

        PHPUnit::assertTrue(
            $this->resolver->findOrFail($selector)->isDisplayed(),
            "Element [{$fullSelector}] is not visible."
        );

        return $this;
    }
331637
public function parent($selector=null)
    {
        $result = $this->createChildInstance();

        if (isset($this->document) && $this->length > 0) {
            foreach ($this->nodes as $node) {
                if ($node->parentNode) {
                    $result->addDomNode($node->parentNode);
                }
            }

            if ($selector) {
                $result = $result->filter($selector);
            }
        }

        return $result;
    }
1161369
protected function getTable($selector) {
        $selector = $this->getSession()->getSelectorsHandler()->xpathLiteral($selector);
        $page = $this->getSession()->getPage();
        $candidates = $page->findAll(
            'xpath',
            $this->getSession()->getSelectorsHandler()->selectorToXpath(
                "xpath", ".//table[(./@id = $selector or  contains(./@title, $selector))]"
            )
        );

        // Find tables by a <caption> field
		$candidates += $page->findAll('xpath', "//table//caption[contains(normalize-space(string(.)), 
			$selector)]/ancestor-or-self::table[1]");

        // Find tables by a .title node
		$candidates += $page->findAll('xpath', "//table//*[@class='title' and contains(normalize-space(string(.)), 
			$selector)]/ancestor-or-self::table[1]");

        // Some tables don't have a visible title, so look for a fieldset with data-name instead
        $candidates += $page->findAll('xpath', "//fieldset[@data-name=$selector]//table");

        assertTrue((bool)$candidates, 'Could not find any table elements');

        $table = null;
        foreach($candidates as $candidate) {
            if(!$table && $candidate->isVisible()) {
                $table = $candidate;
            }
        }

        assertTrue((bool)$table, 'Found table elements, but none are visible');

        return $table;
    }
867730
protected function hasSelectorPlaceholder($selector)
    {
        if (! is_array($selector)) {
            return false;
        }

        foreach ($selector as $parts) {
            foreach ($parts as $part) {
                if (is_array($part)) {
                    return false;
                }
                if (strlen($part) && '%' === $part[0]) {
                    return true;
                }
            }
        }

        return false;
    }
1336251
function (selector) {
        selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);

        return selector.find(this);
      }
387988
public function mapWithIndex(callable $selector): Observable
    {
        $index = 0;
        return $this->map(function ($value) use ($selector, &$index) {
            return $selector($index++, $value);
        });
    }
886765
public function toBeInvisible()
    {
        $this->wait()->until(WebDriverExpectedCondition::invisibilityOfElementLocated($this->elementFinder->getSearchCriteria()));

        return $this;
    }
1211445
public function not($selector)
    {
        $result = $this->createChildInstance();

        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if (!$selector($node, $index)) {
                        $result->addDomNode($node);
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                if ($selection->length > 0) {
                    foreach ($this->nodes as $node) {
                        $matched = false;
                        foreach ($selection as $result_node) {
                            if ($result_node->isSameNode($node)) {
                                $matched = true;
                                break 1;
                            }
                        }
                        if (!$matched) {
                            $result->addDomNode($node);
                        }
                    }
                } else {
                    $result->addNodes($this->nodes);
                }
            }
        }

        return $result;
    }
724112
public function withSelector(DocumentSelector $selector): DocumentSource
    {
        $source = clone $this;
        $source->setSelector($selector);

        return $source;
    }
94872
public function setSelectors($selectors)
    {
        $this->selectors = [];
        if (!is_array($selectors)) {
            $selectors = [$selectors];
        }
        foreach ($selectors as $selector) {
            $this->addSelector($selector);
        }

        return $this;
    }
647547
public function clickLink($link, $element = 'a')
    {
        $this->ensurejQueryIsAvailable();

        $selector = addslashes(trim($this->resolver->format("{$element}:contains({$link}):visible")));

        $this->driver->executeScript("jQuery.find(\"{$selector}\")[0].click();");

        return $this;
    }
431024
public function applyRule($selector, $style)
    {
        if($selector) {
            $nodes = $this->_getNodesForCssSelector($selector);
            $style = $this->_styleToArray($style);

            foreach($nodes as $node) {
                $current = $node->hasAttribute("style") ?
                    $this->_styleToArray($node->getAttribute("style")) :
                    array();

                $current = $this->_mergeStyles($current, $style);

                $node->setAttribute("style", $this->_arrayToStyle($current));
            }
        }

        return $this;
    }
755551
public function is($selector)
    {
        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if ($selector($node, $index)) {
                        return true;
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                foreach ($selection->nodes as $result_node) {
                    foreach ($this->nodes as $node) {
                        if ($result_node->isSameNode($node)) {
                            return true;
                        }
                    }
                }
            }
        }

        return false;
    }
396416
public function iWaitXUntilISee($wait, $selector) {
		$page = $this->getSession()->getPage();

		$this->spin(function($page) use ($page, $selector){
			$element = $page->find('css', $selector);

			if(empty($element)) {
				return false;
			} else {
				return $element->isVisible();
			}
		});
	}
1139833
public function isMatch($selector){
		return $this->isMatchingTail($selector->getEnd(), $this->depth - 1, count($this->stack[$this->depth - 1]) - 1);
	}
486934
public function assertValue($selector, $value)
    {
        $actual = $this->resolver->findOrFail($selector)->getAttribute('value');

        PHPUnit::assertEquals($value, $actual);

        return $this;
    }
1219829
public function _selector($selector = null)
    {
        if ($selector === false) {
            $this->library = null;
        } elseif ($selector instanceof self) {
            $this->library = '$('.$selector.')';
        } else {
            $this->library = '$('.json_encode($selector).')';
        }

        return $this;
    }