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
When tests have dependencies, namely a global.setup.ts / global.teardown.ts file then these should run in addition to changed test when the cli option --only-changed is run.
Either as default or as an extra flag such as: --only-changed --setup --teardown or --only-changed --dependencies
Example
A file exists called global.setup.ts which is defined as part of a projects dependencies in the playwright.config file and 1 test file is changed
Without extra flag:
when this command is run npx playwright test --only-changed then global.setup.ts runs before the 1 changed test file
With extra flag (setup, teardown or dependencies):
when this command is run npx playwright test --only-changed --dependencies then global.setup.ts runs before the 1 changed test file
Motivation
My tests all rely on a global set up file where authentication is completed and saved as storageState which are used within the tests. I would like to be able to use the --only-changed CLI command but can't at the moment as it doesn't run this set up file therefore my test users aren't authenticated.
The text was updated successfully, but these errors were encountered:
lucyyyl
changed the title
[Feature]: --only-change - run the global set up/teardown files in addition to changed tests
[Feature]: --only-changed - run the global set up/teardown files in addition to changed tests
Aug 13, 2024
🚀 Feature Request
When tests have dependencies, namely a global.setup.ts / global.teardown.ts file then these should run in addition to changed test when the cli option --only-changed is run.
Either as default or as an extra flag such as:
--only-changed --setup --teardown
or--only-changed --dependencies
Example
A file exists called
global.setup.ts
which is defined as part of a projects dependencies in the playwright.config file and 1 test file is changedWithout extra flag:
when this command is run
npx playwright test --only-changed
then global.setup.ts runs before the 1 changed test fileWith extra flag (setup, teardown or dependencies):
when this command is run
npx playwright test --only-changed --dependencies
then global.setup.ts runs before the 1 changed test fileMotivation
My tests all rely on a global set up file where authentication is completed and saved as storageState which are used within the tests. I would like to be able to use the --only-changed CLI command but can't at the moment as it doesn't run this set up file therefore my test users aren't authenticated.
The text was updated successfully, but these errors were encountered: