laravel / dusk

Laravel Dusk provides simple end-to-end testing and browser automation.
https://laravel.com/docs/dusk
MIT License
1.88k stars 323 forks source link

Dusk Doesn't Recognize Attribute-based Grouping #1128

Closed paulrrogers closed 1 month ago

paulrrogers commented 2 months ago

Dusk Version

8.2.5

Laravel Version

11.22

PHP Version

8.2

PHPUnit Version

11

Database Driver & Version

No response

Description

Dusk doesn't recognize attribute grouping (#[Group('special')]), while PHPUnit 11 complains about /** @group … */ comments:

WARN Metadata found in doc-comment for class … . Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12. Update your test code to use attributes instead.

Steps To Reproduce

  1. put #[Group('special')] above a Dusk test method
  2. php artisan dusk --group=special
  3. expect to see just that test run, yet "No tests found" appears instead
github-actions[bot] commented 2 months ago

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

nielsvh2103 commented 2 months ago

yeah i think dusk needs to update their testcase for it to work with attributes, i have the same thing, but thats gonna be an issue starting from phpunit 12, for now you only get a warning

crynobone commented 1 month ago

Did you import the correct attribute class?

use PHPUnit\Framework\Attributes\Group;
crynobone commented 1 month ago

Hey there,

We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.