Editor extensions
NeedsEditor extension
The Piwi extension for VS Code (and Cursor, VSCodium) and the Piwi plugin for the JetBrains IDEs with the LSP API (WebStorm, IntelliJ IDEA Ultimate, Rider, from 2024.1) bring what the dashboard knows about your suite to the line you are editing. Both run the same editor service; the JetBrains plugin page lists what the plugin needs and draws differently.

Install and connect
You need a Piwi instance: the desktop app, npx @piwitests/server or the Docker image. Recording, running a test by its line, and pausing and stepping through it need none. Piwi reads Playwright Test suites in JavaScript and TypeScript.
Install Piwi from the Visual Studio Marketplace ↗ (piwitests.piwi in the extensions view) or the JetBrains Marketplace ↗ (Settings → Plugins). It starts on a trusted workspace holding a Playwright config, and reads the connection the reporter already uses: the PIWI_* variables in the environment or the workspace .env, or the desktop app. Otherwise, run Piwi: Connect… (Settings → Tools → Piwi in a JetBrains IDE) and sign in with the browser: Editor connection has the steps.
The first workspace with a Playwright config opens the first steps: VS Code's Get started with Piwi walkthrough once per machine (unless workbench.welcomePage.walkthroughs.openOnInstall is off), a JetBrains IDE's Get started tab once per installation (JetBrains plugin). Piwi: Get started opens them again. The desktop app and MCP offers follow one at a time: one per window in VS Code, per IDE session in a JetBrains IDE. VS Code 1.101 and later lists the MCP server itself.
In VS Code, the extension also opens a path clicked in the dashboard: Open in editor.
Self-hosted, zero telemetry. No file of your workspace is sent to the instance: the project's locator index, code reach and latest run are compared with your files locally.
CI failures in the Problems panel
The failures of the latest complete CI run on the checked-out branch, else the default branch, are in the Problems panel at the line that failed, with your local runs laid over them, and each failing line follows your edits until a run covers its test again. The heal, the trace, a rerun and the fix plan are quick fixes on the failure, and the failures view lists them as a tree: Failures in the editor.
The tests behind each line
Lines above the code (CodeLens):
| File | What it shows | Click |
|---|---|---|
| A spec | the tests Piwi knows in it; beside each test(…), its latest result in the gutter, a failing test's body tinted, and on hover that result's run, the pass rate, flaky score and root cause, quarantine and selections | runs those tests |
| A page object or spec | above each locator line (in a spec, unless its only test is the one around it), the tests using it, their actions, and how many fail or flake | runs those tests |
| An application file | the tests that reach it, from code reach; with coverage, each function's too | runs those tests |
A page file (Nuxt pages/**) | the tests acting on that page, its locators and how many are brittle | runs those tests |
Above a flaky test: Flake Lab's flaky N% and top suspect, then Reproduce this flake and, once reproduced, Verify the flake fix, which run piwi flake; beside a team instance, Reproduce this flake in the desktop app.
Timeouts
A test whose test.slow() is no longer needed, or whose timeout is far above its p95, gets a note and a quick fix: remove test.slow(), or set test.setTimeout to the suggested value.
Completion
- After a page and a
.in a spec or a page object: the locator chains your suite already uses on the pages this file's tests visit, most used first and brittle ones last. The page ispage,this.page, or any page the code at the cursor can use, the same ones a recording offers: another page fixture of the test (adminPage.), a page object's page field (this.root.), a page the test opens (newPage(), a popup). - Right after
expect(: the same chains on the page in use there, such aspage.getByRole('button', { name: 'Pay' }), so an assertion's locator is written in one step. - At the start of a statement: the functions of your catalog whose URL pattern matches those pages, as a call with a placeholder per parameter.
- In a
piwi:annotation: the types (piwi:owner,piwi:priority,piwi:feature,piwi:link), then the owners, priorities or features they take; intag: ['@…'], the tags your tests already use.
Brittle locators
A locator the stability rules rate brittle is a warning on its line; one worth a look is a hint. When the capture fixtures stored a stable alternative for that call site on its last passing run, the quick fix replaces the chain with it.
The locators a change breaks
In an application file, the unsaved buffer is compared with HEAD as you type, as piwi preflight compares a diff. A changed line whose string a locator finds its element by is a warning, with the chains it breaks on hover, and one quick fix that rewrites every call site.
Piwi's MCP server for the agent
In VS Code 1.101 and later, the extension provides Piwi's MCP server to the editor's agent with the connection it already has. Elsewhere, Piwi: Copy the MCP server configuration puts an entry on the clipboard: VS Code's mcp.json or Cursor's mcpServers, as you choose; in a JetBrains IDE, an mcpServers entry running mcp-remote, for your agent's MCP settings (the AI Assistant's, when it is installed and enabled). It holds your API key: keep it out of the repository.
The key carries your whole role, write tools included. For a token of the agent's own, set piwi.mcpAuthorization to sign-in (Settings → Tools → Piwi → Agents (MCP) in a JetBrains IDE): the server comes without a key, and the agent signs in in your browser when it first connects. You revoke that token with your API keys. The desktop app keeps its own token. For the runs the editor starts: Run control for agents.
Colors and hidden messages
VS Code's theme colors, set in workbench.colorCustomizations: piwi.failingTestBackground and piwi.failingLineBackground tint a failing test and the line it failed at, piwi.failingTestOverviewRuler and piwi.failingLineOverviewRuler mark them in the scrollbar; piwi.flakyForeground colors the word flaky after a flaky test's line in the Testing view; piwi.recordingBlockBackground and piwi.recordingBlockOverviewRuler mark the block a recording writes; piwi.executionPointBackground and piwi.executionPointOverviewRuler the line a test is stopped at, piwi.failurePointBackground and piwi.failurePointOverviewRuler the line it holds a failure at. The coverage marks have their own. A JetBrains IDE has the failing test, its line, the lines being recorded and the stopped line under Settings → Editor → Color Scheme → Piwi.
Don't Show Again on a message that may come again adds its kind to VS Code's piwi.hiddenMessages (Editor settings lists the kinds); remove a kind to see its message again.
VS Code's Piwi settings come in five groups, Connection, Runs, In the editor, Agents (MCP) and Advanced, as JetBrains' settings page does: Editor settings lists each one, what the editor shows among them. Your own choices (how runs start and notify, breakpoints, the status bar's alert, the agent's sign-in) hold in every workspace: a repository's .vscode/settings.json sets only the instance and the project, the failure severity, serving runs to agents and Piwi's tests in the Testing view. A JetBrains IDE keeps the same choices in its own settings, for every project, and the failure severity and serving runs to agents for each project.
Commands
Each extension's commands, under Piwi: in VS Code's command palette and Tools → Piwi in a JetBrains IDE, are listed with what they do on Editor commands. Both editors bind Ctrl+Shift+Alt+K to run the test at the cursor, Ctrl+Shift+Alt+F to re-run the failing tests, Ctrl+Shift+Alt+R to record at the cursor and stop the recording, and Ctrl+Shift+Alt+B to open the failures, in a JavaScript or TypeScript file or Piwi's views; Cmd for Ctrl on macOS. Some JetBrains keymaps, macOS's among them, take other letters: Keys. Preferences: Open Keyboard Shortcuts changes them in VS Code (search piwi), Settings → Keymap in a JetBrains IDE (search Piwi).
JetBrains IDEs
The plugin runs with the project's Node.js interpreter, 20 or later, and shows the failures in the Piwi tool window, the lines above the code with Code Vision, and its actions under Tools → Piwi: JetBrains plugin.
Related
- Failures in the editor: the CI failures, their quick fixes and the failures view.
- Runs from the editor: run tests, and follow them in the status bar.
- Record tests from the editor: steps written at the cursor as you take them.
- Write, run and fix a test: the loop across tools.