jeudi 26 juillet 2018

Laravel dusk return error but working on local

I'm using laravel 5.6

And I'm trying to run default Dusk test (tests/Browser/ExampleTest.php)

public function testBasicExample()
{
    $this->browse(function (Browser $browser) {
        $browser->visit('/')
                ->assertSee( config('app.name', 'Laravel') );
    });
}

But Dusk return me this error

There was 1 failure:

1) Tests\Browser\ExampleTest::testBasicExample
Did not see expected text [Laravel] within element [body].
Failed asserting that false is true.

C:\wamp64\www\projects\laravel\vendor\laravel\dusk\src\Concerns\MakesAssertions.php:348
C:\wamp64\www\projects\laravel\vendor\laravel\dusk\src\Concerns\MakesAssertions.php:319
C:\wamp64\www\projects\laravel\tests\Browser\ExampleTest.php:20
C:\wamp64\www\projects\laravel\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:67
C:\wamp64\www\projects\laravel\tests\Browser\ExampleTest.php:21

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

The log is

[
    {
        "level": "SEVERE",
        "message": "http:\/\/laravel\/ - Failed to load resource: the server responded with a status of 500 (Internal Server Error)",
        "source": "network",
        "timestamp": 1532599309955
    }
]

And the screenshot of failure is the Whoops, looks like something went wrong error here

But when I browse "manually" the homepage is well displayed and I see the Customize - test in the body title. No error and everything is working fine.

My .env contains APP_NAME=Laravel

Is it possible that Dusk is failing for a reason or another?

PS: If I create a new project from scratch it's working well. So I'm not sure how to debug this in my current project

Aucun commentaire:

Enregistrer un commentaire