ivanmiranda
4 months ago
25
11
Laravel

Laravel Dusk Example test failing - Can't load URL

Posted 4 months ago by ivanmiranda

Hello everyone,

Here is my problem: i'm trying to develop a piece of code with Laravel Dusk that allows me to automatize a few tasks on Chrome browser. However, despite of applying correctly all the documentation steps, ExampleTest.php file is throwing this error:

 "No se puede cargar la URL: El dominio de esta URL no está incluido en los dominios de la aplicación. Para poder cargar esta URL, añade todos los dominios y subdominios de tu a
plicación al campo de dominios de la aplicación en la configuración de tu aplicación."

It seems, according with what forums says on the internet, that Facebook security rules have become tighter and more restrictive, using only oauth URL's. One of the solutions it is supposed to be include all the domains of your app in Facebook app configuration panel, but my question is: i'm running this locally, which means my url's at the moment are http://localhost/etc.

This is really bothering me. Anybody could help, please? Thanks in advance.

Leave some pics of the code:

<?php

namespace Tests\Browser;

use Tests\DuskTestCase;
use Laravel\Dusk\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;

class ExampleTest extends DuskTestCase
{
    /**
     * A basic browser test example.
     *
     * @return void
     */
    public function testBasicExample()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                    ->assertSee('Laravel');
        });
    }
}

And in AppServiceProvider i've also included:

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; 
use Laravel\Dusk\DuskServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->register(DuskServiceProvider::class);
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);
    }
}

Please sign in or create an account to participate in this conversation.