Laravel 8 等待页面跳转
在给出类似 $browser->assertPathIs('/home') 路径断言时,如果 window.location.pathname 被异步更新,断言就会失败。可以使用 waitForLocation 方法等待页面跳转到给定路径:
$browser->waitForLocation('/secret'); 还可以等待被命名的路由跳转:
$browser->waitForRoute($routeName, $parameters);
在给出类似 $browser->assertPathIs('/home') 路径断言时,如果 window.location.pathname 被异步更新,断言就会失败。可以使用 waitForLocation 方法等待页面跳转到给定路径:
$browser->waitForLocation('/secret'); 还可以等待被命名的路由跳转:
$browser->waitForRoute($routeName, $parameters);