public function waitUntilElementIsVisible(string $cssSelector, int $timeout = 5, TraversableElement $baseElement = null): void
    {
        $baseElement = $baseElement ?? $this->getSession()->getPage();

        try {
            $this->waitUntil($timeout, function () use ($cssSelector, $baseElement) {
                $element = $baseElement->find('css', $cssSelector);

                return isset($element) && $element->isVisible();
            });
        } catch (Exception $e) {
            throw new ElementNotVisible(sprintf('Element with selector: %s was not found', $cssSelector));
        }
    }
public function waitUntilElementIsVisible(string $cssSelector, int $timeout = 5, TraversableElement $baseElement = null): void
    {
        $baseElement = $baseElement ?? $this->getSession()->getPage();

        try {
            $this->waitUntil($timeout, function () use ($cssSelector, $baseElement) {
                $element = $baseElement->find('css', $cssSelector);

                return isset($element) && $element->isVisible();
            });
        } catch (Exception $e) {
            throw new ElementNotVisible(sprintf('Element with selector: %s was not found', $cssSelector));
        }
    }
public function waitUntilElementIsVisible ( string $ cssSelector , int $ timeout = 5 , TraversableElement $ baseElement = null ) : void { $ baseElement = $ baseElement ?? $ this -> getSession ( ) -> getPage ( ) ; try { $ this -> waitUntil ( $ timeout , function ( ) use ( $ cssSelector , $ baseElement ) { $ element = $ baseElement -> find ( 'css' , $ cssSelector ) ; return isset ( $ element ) && $ element -> isVisible ( ) ; } ) ; } catch ( Exception $ e ) { throw new ElementNotVisible ( sprintf ( 'Element with selector: %s was not found' , $ cssSelector ) ) ; } }
Waits until element is visible. If it does not appear throws exception.

@param string $cssSelector
@param int $timeout

@throws Exception when element not found or is not visible
Waits until element is visible . If it does not appear throws exception .