PHP code example of cetera-labs / laravel-dusk-visual-assert

1. Go to this page and download the library: Download cetera-labs/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/ */

    

cetera-labs / 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