Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add assertCount() and component() to Laravel Dusk docs #10477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025
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
20 changes: 20 additions & 0 deletions 20 dusk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,7 @@ Dusk provides a variety of assertions that you may make against your application
[assertDontSeeIn](#assert-dont-see-in)
[assertSeeAnythingIn](#assert-see-anything-in)
[assertSeeNothingIn](#assert-see-nothing-in)
[assertCount](#assert-count)
[assertScript](#assert-script)
[assertSourceHas](#assert-source-has)
[assertSourceMissing](#assert-source-missing)
Expand Down Expand Up @@ -1757,6 +1758,15 @@ Assert that no text is present within the selector:
$browser->assertSeeNothingIn($selector);
```

<a name="assert-count"></a>
#### assertCount

Assert that elements matching the given selector appear the specified number of times:

```php
$browser->assertCount($selector, $count);
```

<a name="assert-script"></a>
#### assertScript

Expand Down Expand Up @@ -2505,6 +2515,16 @@ class ExampleTest extends DuskTestCase
}
```

The `component` method may be used to retrieve a browser instance scoped to the given component:

```php
$datePicker = $browser->component(new DatePickerComponent);

$datePicker->selectDate(2019, 1, 30);

$datePicker->assertSee('January');
```

<a name="continuous-integration"></a>
## Continuous Integration

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.