protected function ensure_node_is_visible($node) {

        if (!$this->running_javascript()) {
            return;
        }

        // Exception if it timesout and the element is still there.
        $msg = 'The "' . $node->getXPath() . '" xpath node is not visible and it should be visible';
        $exception = new ExpectationException($msg, $this->getSession());

        // It will stop spinning once the isVisible() method returns true.
        $this->spin(
            function($context, $args) {
                if ($args->isVisible()) {
                    return true;
                }
                return false;
            },
            $node,
            self::get_extended_timeout(),
            $exception,
            true
        );
    }
protected function ensure_node_is_visible($node) {

        if (!$this->running_javascript()) {
            return;
        }

        // Exception if it timesout and the element is still there.
        $msg = 'The "' . $node->getXPath() . '" xpath node is not visible and it should be visible';
        $exception = new ExpectationException($msg, $this->getSession());

        // It will stop spinning once the isVisible() method returns true.
        $this->spin(
            function($context, $args) {
                if ($args->isVisible()) {
                    return true;
                }
                return false;
            },
            $node,
            self::get_extended_timeout(),
            $exception,
            true
        );
    }
protected function ensure_node_is_visible ( $ node ) { if ( ! $ this -> running_javascript ( ) ) { return ; } // Exception if it timesout and the element is still there. $ msg = 'The "' . $ node -> getXPath ( ) . '" xpath node is not visible and it should be visible' ; $ exception = new ExpectationException ( $ msg , $ this -> getSession ( ) ) ; // It will stop spinning once the isVisible() method returns true. $ this -> spin ( function ( $ context , $ args ) { if ( $ args -> isVisible ( ) ) { return true ; } return false ; } , $ node , self :: get_extended_timeout ( ) , $ exception , true ) ; }
Ensures that the provided node is visible and we can interact with it.

@throws ExpectationException
@param NodeElement $node
@return void Throws an exception if it times out without the element being visible
Ensures that the provided node is visible and we can interact with it .