Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 983 Bytes

web-browser-automation.md

File metadata and controls

32 lines (26 loc) · 983 Bytes
title description
Web Browser Automation
Web Browser Automation with Laravel Dusk

Web Browser Automation

Using the app:install Artisan command you can install the console-dusk component:

php <your-app-name> app:install console-dusk

The Console Dusk allows the usage of Laravel Dusk in Artisan commands. However, in Laravel Zero you can use Laravel Dusk for web tasks that should be automated. Let's take a look at the usage:

class VisitLaravelZeroCommand extends Command
{
    public function handle(): void
    {
        $this->browse(function ($browser) {
            $browser->visit('https://laravel-zero.com')
                ->assertSee('Laravel Zero');
        });
    }
}

Output example:

Get more details: https://github.com/nunomaduro/laravel-console-dusk.