Skip to content

Conversation

@ktsm-th
Copy link
Contributor

@ktsm-th ktsm-th commented Jan 31, 2025

This PR adds a new helper to assert the number of matching elements on the page.

It's useful when assertions are performed on DOM elements that are tied to factories:

Books::factory()
    ->times(3)
    ->sequence(['stock' => true], ['stock' => true], ['stock' => false])
    ->create();

$browser->assertCount('input[name="books_in_stock"]:checked', 2);

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@ktsm-th ktsm-th marked this pull request as ready for review January 31, 2025 16:41
@taylorotwell taylorotwell merged commit f0e6870 into laravel:8.x Feb 5, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants