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

[Bug]: Two hierarchically identical folders, of which the name of the second folder starts with the full name of the first folder, are executed simultaneously #34813

Open
hesselhove opened this issue Feb 15, 2025 · 2 comments · May be fixed by microsoft/playwright-vscode#614

Comments

@hesselhove
Copy link

hesselhove commented Feb 15, 2025

pw-repo.zip

Version

1.50.1

Steps to reproduce

Preparation: create the following folder structure:

  • tests
    • dev
      • accijns
        • afgehandeld.spec.ts
        • afgekeurd.spec.ts
      • accijnsgoederen
        • afgehandeld.spec.ts
        • lopend.spec.ts
      • algemeen
        • afgehandeld.spec.ts

Reproduction 1: Execute the command line: npx playwright test tests/dev/accijns --project chromium

Now the tests under 'tests/dev/accijns' are properly completed, but also the tests under 'tests/dev/accijnsgoederen'.

Reproduction 2: In VSC, select 'Run Test' on the folder '/tests/dev/accijns'.
Now the correct tests are started first, but after a few seconds also the tests under '/tests/dev/accijnsgoederen'. Self-contained reproduction provided as attachement.

Expected behavior

I expect that only the tests of the selected (sub)folder are executed. In my opinion it should not matter if there are hierarchically equal folders, where the name of one folder is completely present in the other.

Actual behavior

The system will execute all tests in all folders that are hierarchically equal and where the name of the second folder starts with the full name of the first folder.

Additional context

This problem also occurred in Playwright version 1.49.1.

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz
    Memory: 4.12 GB / 12.00 GB
  Binaries:
    Node: 23.4.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.82.2 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.50.1 => 1.50.1
    playwright: ^1.50.1 => 1.50.1
@Skn0tt
Copy link
Member

Skn0tt commented Feb 17, 2025

This is expected behaviour, see https://playwright.dev/docs/test-cli#reference. Try npx playwright test tests/dev/accijns/ (note the trailing slash).

@hesselhove
Copy link
Author

Thanx @Skn0tt! With your addition the first reproduction has been dropped.
However, the second reproduction remains valid. I have added a Self-contained reproduction as an attachment.

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

Successfully merging a pull request may close this issue.

2 participants