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]: Playwright Test for VSCode not always running global setup #32121

Closed
twalshOG opened this issue Aug 12, 2024 · 3 comments · Fixed by microsoft/playwright-vscode#524
Closed
Assignees
Labels

Comments

@twalshOG
Copy link

Version

1.46.0

Steps to reproduce

  1. Install VS Code and add the Playwright Test for VSCode extension.
  2. Clone https://github.com/twalshOG/PlaywrightBug
  3. Run the test (this project only has one test for simplicity sake) from the Playwright test explorer
    image
    Note that global setup ran

    image
  4. Run the test again via the test explorer
    image

    Note that global setup did not run

Expected behavior

I would expect global setup to run each time I run

Actual behavior

Global setup not running on subsequent runs when tests are run via the Playwright test extension for VS Code.

Additional context

Work arounds

  1. Close and reopen VS Code
  2. Manually trigger "Run global teardown"
    image
    This makes it so the next run will run global setup, but runs after that will continue to skip global setup.

Thoughts

  1. This look something was intentionally done
    1. If I am using my own test web service it stays up between runs
    2. The SETUP section of the TESTING: PLAYWRIGHT VSCode bar disables Run global setup and enables Run global teardown.
  2. Within many contexts this would work great, however it gets really unpleasant when trying to update/debug global setup

Recommendations

  1. Document when global setup/teardown should be/will be executed when using VSCode
  2. Add a setting that allows users to decide if they want to use the same global setup between test runs
    image

Environment

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 195.63 MB / 32.00 GB
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
  IDEs:
    VSCode: 1.92.0 - /opt/homebrew/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.46.0 => 1.46.0 
  Test extension:
    Playwright Test for VSCode: v1.1.7
@twalshOG
Copy link
Author

Looks like this is likely related to #32103

@pavelfeldman
Copy link
Member

A setting makes sense to me.

@Charles-Gagnon
Copy link

Would such a setting also result in globalTeardown being ran after each test run? Right now it seems like it's never ran, which means you can end up with stale state that isn't cleaned up.

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

Successfully merging a pull request may close this issue.

5 participants