Working with Laravel Dusk to Test Application

Submitted by azazqadir - 4 months ago

This article provides a brief introduction of Laravel Dusk, how you can setup Laravel Dusk and then go into the process of testing the ToDo application. Laravel Dusk is a browser automation testing tool introduced in Laravel 5.4. It is the perfect tool for testing applications and API. It uses ChromeDriver by default but you can use any Selenium compatible drivers. source: https://www.cloudways.com/blog/laravel-dusk-testing-todo-app/

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Laravel\Dusk\DuskServiceProvider;
class AppServiceProvider extends ServiceProvider
{
    /**
* Bootstrap any application services.
*
* @return void
*/
    public function boot()
    {
        //
        Schema::defaultStringLength(191);
    }
    /**
* Register any application services.
*
* @return void
*/
    public function register()
    {
        if ($this->app->environment('local', 'testing')) {
            $this->app->register(DuskServiceProvider::class);
        }
    }
}

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks