PHP code example of stechstudio / laravel-visual-testing

1. Go to this page and download the library: Download stechstudio/laravel-visual-testing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stechstudio / laravel-visual-testing example snippets


$browser->visit('/auth/login')
        ->snapshot();

$browser->visit('/auth/login')
        ->snapshot('Login page');

$browser->visit('/auth/login')
        ->snapshot('Login page', [ 'widths' => [768, 992, 1200] ]);

public function testBasicExample()
{
    $this->browse(function (Browser $browser) {
        $browser->visit('/')
            ->snapshot('basic-example') // <-- add this
            ->assertSee('Laravel');
                
    });
}

php artisan dusk

php artisan dusk