PHP code example of rossjcooper / laravel-dusk-visual-assert

1. Go to this page and download the library: Download rossjcooper/laravel-dusk-visual-assert 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/ */

    

rossjcooper / laravel-dusk-visual-assert example snippets


$browser->assertScreenshot(string $name, float|null $threshold = null, int|null $metric = null)

$this->browse(function (Browser $browser) {
        $browser->visit('/')
            ->assertScreenshot('home');
    });

$browser->assertResponsiveScreenshots(string $name, float|null $threshold = null, int|null $metric = null)

$this->browse(function (Browser $browser) {
        $browser->visit('/')
            ->assertResponsiveScreenshots('home');
    });
bash
php artisan vendor:publish --tag=visual-assert-config