public function screenshot(string $filename): Dusk
    {
        if (substr($filename, 0, 1) !== "/") {
            $filename = "/tmp/{$filename}";
        }

        if (substr($filename, -4) !== ".png") {
            $filename .= ".png";
        }

        $this->getDriver()->takeScreenshot($filename);

        return $this;
    }
public function screenshot(string $filename): Dusk
    {
        if (substr($filename, 0, 1) !== "/") {
            $filename = "/tmp/{$filename}";
        }

        if (substr($filename, -4) !== ".png") {
            $filename .= ".png";
        }

        $this->getDriver()->takeScreenshot($filename);

        return $this;
    }
public function screenshot ( string $ filename ) : Dusk { if ( substr ( $ filename , 0 , 1 ) !== "/" ) { $ filename = "/tmp/{$filename}" ; } if ( substr ( $ filename , - 4 ) !== ".png" ) { $ filename .= ".png" ; } $ this -> getDriver ( ) -> takeScreenshot ( $ filename ) ; return $ this ; }
Take a screenshot and store it on disk.

@param string $filename The filename to store (no extension)

@return $this
Take a screenshot and store it on disk .