Skip to content

Commit

Permalink
[8.x] Fix waitForReload example (laravel#7551)
Browse files Browse the repository at this point in the history
* Update dusk.md

* Update dusk.md
  • Loading branch information
SjorsO authored Jan 4, 2022
1 parent 864d870 commit 98c4fee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,13 +813,14 @@ You may also wait for a [named route's](/docs/{{version}}/routing#named-routes)
<a name="waiting-for-page-reloads"></a>
#### Waiting for Page Reloads

If you need to make assertions after a page has been reloaded, use the `waitForReload` method:
If you need to wait for a page to reload after performing an action, use the `waitForReload` method:

use Laravel\Dusk\Browser;

$browser->waitForReload(function (Browser $browser) {
$browser->assertSee('something');
});
$browser->press('Submit');
})
->assertSee('Success!');

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

Expand Down

0 comments on commit 98c4fee

Please sign in to comment.