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

[Feature]: --only-changed - run the global set up/teardown files in addition to changed tests #32133

Closed
lucyyyl opened this issue Aug 13, 2024 · 1 comment

Comments

@lucyyyl
Copy link

lucyyyl commented 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 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.

@lucyyyl 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
@pavelfeldman
Copy link
Member

Dupe of #32070

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

No branches or pull requests

2 participants