playwright
playwright copied to clipboard
[Feature] run tests only against changed files
Description
As a user, I want to run my component tests only on changed files, as it would be a use case in a git hook (pre-push
)
Alternatives
- https://jestjs.io/docs/cli#--onlychanged
- https://vitest.dev/guide/cli.html#changed
Preferred Solution
Enhancement of the cli commands, e.g.
npx playwright test --only-changed
I propose something inspired by Vitest, that can check for uncommited changes, or changes compared to a commit.
npx playwright test --changed
npx playwright test --changed d819f97f40386c9bd31a53525240c6e9997a10f4
npx playwright test --changed main
What do you think ?
WIP, I just pushed documentation
The PR is completed since a while. Waiting for feedback and review.
I think the missing piece is running the tests for the modified components.
The PR is completed since a while. Waiting for feedback and review.
I saw the PR was closed. Any chance of re-opening and taking a look at this again? It's something that would greatly benefit our team
what's the status here? opened but not merged. can someone have a look? it seems like a pretty nice feature.
@pavelfeldman - Looks like you had feedback before closing the PR. Is there any direction? My team is blocked on merging tests due to untouched tests failing.
Waiting for this so much. Do you have it in your roadmap?
This would be helpful for our organization. We don't need to run tests on stories that haven't changed. Any updates on this feature?
This would be awesome for my team!
Also would like this too, having moved from Selenium to Playwright, this would be a huge feature. It is easy to fetch changed *.spec.ts
files with git via some cli stuff, but also having it just built in, with support for also identifying used objects to determine what tests to run would be amazing.
Also would like this too, having moved from Selenium to Playwright, this would be a huge feature. It is easy to fetch changed
*.spec.ts
files with git via some cli stuff, but also having it just built in, with support for also identifying used objects to determine what tests to run would be amazing.
Problem is this feature requires two options / implementations which is more complex than just parsing git diff. One option to run changed tests based on test code change, another is to run tests based on, for example, component code changes like what Jest is doing with --only-changed
option.