Laravel Dusk test for remote site not work

2019-08-27 00:34发布

问题:

...
$this->browse(function (Browser $browser) {
 $browser->visit(url()->route('login'))
  ->type('email', 'user.one@email.com')
  ->type('password', 'something')
  ->press('Login')
  ->pause(60*60*1000)
  ->assertRouteIs('dashboard')
...

It works on local which is use APP_URL something like 'https://project.dev' but not work for remote 'https://project.com' and 'http://123.123.12.12'.

Errors or Problems

  • login test on remote site not work

Different between local and remote

  • dusk installed in local
  • dusk not installed in remote

What i did to try solve it

  • I read that Chrome need HTTPS. I given https to it. Still not work.