lib/WebDriverExpectedCondition.php
public static function invisibilityOfElementLocated(WebDriverBy $by)
    {
        return new static(
            function (WebDriver $driver) use ($by) {
                try {
                    return !$driver->findElement($by)->isDisplayed();
                } catch (NoSuchElementException $e) {
                    return true;
                } catch (StaleElementReferenceException $e) {
                    return true;
                }
            }
        );
    }
public static function invisibilityOfElementLocated(WebDriverBy $by)
    {
        return new static(
            function (WebDriver $driver) use ($by) {
                try {
                    return !$driver->findElement($by)->isDisplayed();
                } catch (NoSuchElementException $e) {
                    return true;
                } catch (StaleElementReferenceException $e) {
                    return true;
                }
            }
        );
    }
public static function invisibilityOfElementLocated ( WebDriverBy $ by ) { return new static ( function ( WebDriver $ driver ) use ( $ by ) { try { return ! $ driver -> findElement ( $ by ) -> isDisplayed ( ) ; } catch ( NoSuchElementException $ e ) { return true ; } catch ( StaleElementReferenceException $ e ) { return true ; } } ) ; }
An expectation for checking that an element is either invisible or not present on the DOM.

@param WebDriverBy $by The locator used to find the element.
@return static Condition returns whether no visible element located.
An expectation for checking that an element is either invisible or not present on the DOM .