src/Browser.php
public function with($selector, Closure $callback)
    {
        $browser = new static(
            $this->driver, new ElementResolver($this->driver, $this->resolver->format($selector))
        );

        if ($this->page) {
            $browser->onWithoutAssert($this->page);
        }

        if ($selector instanceof Component) {
            $browser->onComponent($selector, $this->resolver);
        }

        call_user_func($callback, $browser);

        return $this;
    }
public function with($selector, Closure $callback)
    {
        $browser = new static(
            $this->driver, new ElementResolver($this->driver, $this->resolver->format($selector))
        );

        if ($this->page) {
            $browser->onWithoutAssert($this->page);
        }

        if ($selector instanceof Component) {
            $browser->onComponent($selector, $this->resolver);
        }

        call_user_func($callback, $browser);

        return $this;
    }
public function with ( $ selector , Closure $ callback ) { $ browser = new static ( $ this -> driver , new ElementResolver ( $ this -> driver , $ this -> resolver -> format ( $ selector ) ) ) ; if ( $ this -> page ) { $ browser -> onWithoutAssert ( $ this -> page ) ; } if ( $ selector instanceof Component ) { $ browser -> onComponent ( $ selector , $ this -> resolver ) ; } call_user_func ( $ callback , $ browser ) ; return $ this ; }
Execute a Closure with a scoped browser instance.

@param  string  $selector
@param  \Closure  $callback
@return $this
Execute a Closure with a scoped browser instance .