简体   繁体   中英

Laravel Dusk opens incorrect site URL

So I am running my site as http://localhost:8080 , below is my test:

public function testExample() {
        $this->browse( function ( Browser $browser ) {
            $browser->visit( '/' )
                    ->assertTitle( 'Welcome to Mysite' );
        } );
    }

On running php artisan dusk , it opens wrong URL that is http://localhost . if I mention complete URL then it works.

How to make it open correct URL?

Thanks @Sven for the answer .

  1. Update .env file. Set APP_URL property

  2. Check config/app.php file. The url property should be like this 'url' => env('APP_URL', 'http://localhost') (in my case that's was the problem)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM