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] run tests only against changed files #15075

Open
SimonGolms opened this issue Jun 23, 2022 · 12 comments
Open

[Feature] run tests only against changed files #15075

SimonGolms opened this issue Jun 23, 2022 · 12 comments
Assignees
Labels
feature-test-runner Playwright test specific issues v1.47

Comments

@SimonGolms
Copy link

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

Preferred Solution

Enhancement of the cli commands, e.g.

npx playwright test --only-changed
@jfgreffier
Copy link
Contributor

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 ?

@jfgreffier
Copy link
Contributor

WIP, I just pushed documentation

@jfgreffier
Copy link
Contributor

The PR is completed since a while. Waiting for feedback and review.

@pavelfeldman
Copy link
Member

I think the missing piece is running the tests for the modified components.

@joeflan
Copy link

joeflan commented Mar 14, 2023

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

@y-nk
Copy link

y-nk commented Apr 3, 2023

what's the status here? opened but not merged. can someone have a look? it seems like a pretty nice feature.

@sayers24
Copy link

sayers24 commented Aug 7, 2023

@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.

@max-mykhailenko
Copy link

Waiting for this so much. Do you have it in your roadmap?

@visualjeff
Copy link

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?

@maxfieldegaj
Copy link

This would be awesome for my team!

@Proryanator
Copy link

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.

@MindaugasMateika
Copy link
Contributor

MindaugasMateika commented Mar 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-test-runner Playwright test specific issues v1.47
Projects
None yet
Development

Successfully merging a pull request may close this issue.