src/LinusShops/Contexts/Web.php
public function waitForSelectorExistence($cssSelector, $attempts = 10, $waitInterval = 1)
    {
        $this->waitFor(function ($context) use ($cssSelector) {
            /** @var Web $context */
            try {
                $context->assertElementExists($cssSelector);
            } catch (ElementNotFoundException $e) {
                return false;
            }

            return true;
        }, $attempts, $waitInterval);
    }
public function waitForSelectorExistence($cssSelector, $attempts = 10, $waitInterval = 1)
    {
        $this->waitFor(function ($context) use ($cssSelector) {
            /** @var Web $context */
            try {
                $context->assertElementExists($cssSelector);
            } catch (ElementNotFoundException $e) {
                return false;
            }

            return true;
        }, $attempts, $waitInterval);
    }
public function waitForSelectorExistence ( $ cssSelector , $ attempts = 10 , $ waitInterval = 1 ) { $ this -> waitFor ( function ( $ context ) use ( $ cssSelector ) { /** @var Web $context */ try { $ context -> assertElementExists ( $ cssSelector ) ; } catch ( ElementNotFoundException $ e ) { return false ; } return true ; } , $ attempts , $ waitInterval ) ; }
Runs a wait for until an cssSelector exists on the page. This will pass
even if the cssSelector is not visible on the page. It only needs to exist
in the DOM.

@Given /^selector "([^"]*)" exists$/

@param $cssSelector - The css selector to search for on the page.
@param int $attempts
@param int $waitInterval
@throws \Exception
Runs a wait for until an cssSelector exists on the page . This will pass even if the cssSelector is not visible on the page . It only needs to exist in the DOM .