Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,15 @@ You may also wait for a [named route's](/docs/{{version}}/routing#named-routes)

If you need to make assertions after a page has been reloaded, use the `waitForReload` method:

$browser->click('.some-action')
->waitForReload()
use Laravel\Dusk\Browser;

$browser->waitForReload(function (Browser $browser) {
$browser->assertSee('something');
});

Since the need to wait for the page to reload typically occurs after clicking a button, you may use the `clickAndWaitForReload` method for convenience:

$browser->clickAndWaitForReload('.selector')
->assertSee('something');

<a name="waiting-on-javascript-expressions"></a>
Expand Down