You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In VS Code with the PW Plugin installed., Create/open an empty folder.
VS Codes command pallet and Install: Playwright
Look at Test Explorer, ensure the stock sample project was installed, should see in the test explorer "get started link"
open the terminal in VS Code and run, first few work then...
npx playwright test "get started link"
Running 1 test using 1 worker
[1/1] [firefox] › example.spec.ts:10:5 › get started link (works as expected.)
npx playwright test --grep "get.+link"
[1/1] [firefox] › example.spec.ts:10:5 › get started link (works as expected.)
-- Note the regex for begins with and ends with...
8. npx playwright test --grep "^get.+link$" No tests found.
Expected behavior
the last command example in the repro steps should have worked...
Actual behavior
No tests are run when adding in regex meta characters for begins with it seems.
Additional context
none -- should be really straight forward...
other than help has no docs on the "Flavor of regex" if unqualified all regex commands should be valid as is, and shouldn't be language specific. Such as javascript might requires like the '//ig' regex command format. If required "internal" then one shouldn't need to enter them on the command line if always needed the plug in should add them...? So:
npx playwright test --grep "/<>/ig" seems unnecessary if --grep has already been entered?
On other note, it seems this is related to when tag annotations, i swear i use to have batch files for running test and --grep worked exactly as expected, not running them for a while i might bet the issue came in with overloading grep with tags. Honestly it seem there should be a --grep only for tests titles, and --grepTag for searching tags and the two, however fancy one is trying to be, they should be completely separate. What if i have s collision of a test title that might pick up tests with the tag but wish only one to run... With the test title and tags searched, not sure how to get so only one will run, or not include something not desired to run... But i'd agree a separate issue, but just feels to me the grep functionality broke with the 'tag functionality...' So kind of related and something to consider this when fixing this...?
Finally would assert any regex that works when references www.regex101.com if it matches then it should work...
One thing to note is that regardless of whether this is an "issue" as such or not, it does create some awkward behaviour, since it's not possible to easily use grep to match on a full test name.
For example, if you have two tests:
"foo"
"foo bar"
If you only want to match the first one, you can't match on ^foo$ since that doesn't work - you'd have to include project name, file name, test name and tags - which is somewhat painful.
Version
1.44.0
Steps to reproduce
In VS Code with the PW Plugin installed., Create/open an empty folder.
VS Codes command pallet and Install: Playwright
Look at Test Explorer, ensure the stock sample project was installed, should see in the test explorer "get started link"
open the terminal in VS Code and run, first few work then...
npx playwright test "get started link"
Running 1 test using 1 worker
[1/1] [firefox] › example.spec.ts:10:5 › get started link
(works as expected.)
npx playwright test --grep "get.+link"
[1/1] [firefox] › example.spec.ts:10:5 › get started link
(works as expected.)
-- Note the regex for begins with and ends with...
8. npx playwright test --grep "^get.+link$"
No tests found.
Expected behavior
the last command example in the repro steps should have worked...
Actual behavior
No tests are run when adding in regex meta characters for begins with it seems.
Additional context
none -- should be really straight forward...
other than help has no docs on the "Flavor of regex" if unqualified all regex commands should be valid as is, and shouldn't be language specific. Such as javascript might requires like the '//ig' regex command format. If required "internal" then one shouldn't need to enter them on the command line if always needed the plug in should add them...? So:
npx playwright test --grep "/<>/ig" seems unnecessary if --grep has already been entered?
On other note, it seems this is related to when tag annotations, i swear i use to have batch files for running test and --grep worked exactly as expected, not running them for a while i might bet the issue came in with overloading grep with tags. Honestly it seem there should be a --grep only for tests titles, and --grepTag for searching tags and the two, however fancy one is trying to be, they should be completely separate. What if i have s collision of a test title that might pick up tests with the tag but wish only one to run... With the test title and tags searched, not sure how to get so only one will run, or not include something not desired to run... But i'd agree a separate issue, but just feels to me the grep functionality broke with the 'tag functionality...' So kind of related and something to consider this when fixing this...?
Finally would assert any regex that works when references www.regex101.com if it matches then it should work...
Environment
The text was updated successfully, but these errors were encountered: