Skip to content
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

[Docs]: Documentation for --grep command line argument gives incorrect string used for matching #30895

Closed
marshmn opened this issue May 18, 2024 · 3 comments · Fixed by #30940
Labels

Comments

@marshmn
Copy link
Contributor

marshmn commented May 18, 2024

Page(s)

https://playwright.dev/docs/test-cli#reference

Description

The documentation for --grep states this regarding the string that is used for matching:
"The regular expression will be tested against the string that consists of the test file name, test.describe titles if any, test title and all test tags, separated by spaces, e.g. my-test.spec.ts my-suite my-test @smoke."

In reality, from my own testing, it appears that the string used to match against also includes the project name.

For example, this fails to match:

--grep "^mytestfile.spec.ts\smy\stest$"

Whereas, this does match:

--grep "^chromium\smytestfile.spec.ts\smy\stest$"

This makes a difference if you are trying to match on the whole string in order to avoid potential sub-string matches.

@marshmn
Copy link
Contributor Author

marshmn commented May 18, 2024

FYI: this issue came to light through discussion in a Discord thread: https://discord.com/channels/807756831384403968/1241331291425869844

@pavelfeldman
Copy link
Member

Would you be interested in sending a PR?

@marshmn
Copy link
Contributor Author

marshmn commented May 21, 2024

Yes, sure - will do.

marshmn added a commit to marshmn/playwright that referenced this issue May 21, 2024
The documentation for command line usage of `--grep` did not provide the
correct string used for comparisons. This has now been fixed to include
the project name.

Fixes microsoft#30895
pavelfeldman pushed a commit that referenced this issue May 22, 2024
The documentation for command line usage of `--grep` did not provide the
correct string used for comparisons. This has now been fixed to include
the project name.

Fixes #30895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants