-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
🚀 Feature Request
The ask is that flags such as --grep, --grep-invert and --project are exposed as part of test.info(). For example, we might use the below command with flags:
npx playwright test --project=chrome --grep @smoke-tests
However, I may also have a global setup dependency for the chrome project which sets up authentication various types of users. Let's say, regularuser, adminuser and superuser.
In the above command, I am opting to only run the smoke tests and only regularuser is actually being used in those tests. As part of my global setup dependency, I would like to be able to check (using the newly exposed CLI flag) what --grep was such that I can choose to set up authentication for the relevant users.
Example
Currently, I would use npx playwright test --project=chrome --grep @smoke-tests and I would end up with users being set up for all types of users. regularuser, adminuser and superuser.
Instead, I would run the same command and as part of my global setup being able to detect what tests were being run, only regularuser would be set up.
Motivation
Improve flexibility of using playwrights config when writing fixtures. Needed to support large playwright suites where multiple different types of users are used. Avoids using custom solutions which can bypass the playwright test runner