[Feature]: Run both global setup & teardown from VS Code “Run Test”
🚀 Feature Request
In https://github.com/microsoft/playwright-vscode/pull/524 a toggle was added to the VS Code extension to automatically run global setup when executing a test via the editor. But it does not automatically run global teardown. Global teardown runs only when I re-run a test.
This leads to inconsistent behavior:
- CLI with
test.only()→ runs global setup and global teardown - VS Code “Run Test” → runs global setup but not global teardown (only runs on re-run)
Proposal
When the toggle is enabled, executing a test from VS Code should run both global setup (before the test), and global teardown (after the test) for every single run, without requiring a re-run.
This was briefly discussed in https://github.com/microsoft/playwright/issues/33193, but I’d like to formally request this feature.
Example
No response
Motivation
- Aligns VS Code behavior with the CLI (
test.only()). - Ensures proper cleanup
Yes please, I believe this should be implemented as it's a core feature.
yes please, because beginners may think their global teardown aren't working, at least a warning saying "You have a global teardown file to execute, want to execute this every time all tests finishes?"
Surely this is less feature request, more bug? If it's been defined in the projects as a project to run or added via a teardown prop in the config, this should run each time?
@agg23 could this be bumped as a bug and picked up soon? It's pretty annoying when running large test suites that require a large amount of teardown (in our case, data deletion).