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 .
Update .env
file. Set APP_URL
property
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.