Add Playwright end-to-end tests for the extension's UI, following Positron's e2e pattern
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- playwright, typescript
- Ambito
- ci-cd, developer-experience, testing-qa
Direzione di ricerca
Start by comparing Positron's test/e2e layout with the existing yarn test-positron and @vscode/test-electron setup; use the proposed apps/vscode/test/e2e or apps/vscode-e2e and playwright.config.ts as entry points. Run npx playwright test --project e2e-electron once the driver exists, and consider the milestone complete when the project, CI HTML report, visual-editor specs, and test-author README or CLAUDE.md are in place.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Our end-to-end tests (yarn test-vscode, yarn test-positron) run inside the extension host and drive VS Code through its API. They can open documents, run commands, and query symbols, completions and diagnostics. They can't see anything rendered in a webview, and that's where a lot of the extension lives:
- The visual editor (ProseMirror, and CodeMirror in code cells). The roundtrip tests in
quartoDoc.test.tscheck the markdown that comes back, usingquarto.test_isVisualEditorSynced(#1167), but nothing can check the cell toolbar, syntax highlighting, autocomplete, search, spelling underlines, dialogs, or the outline. The two visual-editor tests inquartoEditor.test.tsaretest.skip. - The notebook renderer and the help panel.
- The packaged VSIX. CI tests the dev build, not the artifact we publish.
So every dependency PR that touches these areas ends with a "manual smoke test" checklist. CodeMirror 6.43 in #1176 is a recent example, and ProseMirror and React upgrades are next. Pure rendering logic is being moved into snapshot tests (#1174); this issue covers the interactive UI.
Proposal: follow the Positron e2e pattern
posit-dev/positron's test/e2e uses Playwright Test to drive the real Positron app, as Electron or in a browser. We'll set up the same structure here, driving VS Code (and Positron) with our extension installed. What that pattern consists of:
- Layout. Everything lives under a single test directory:
infra/: the app driver (launch, Electron/browser/external-server modes, logging, teardown).pages/: one page-object class per area, which owns the selectors and actions for that area.tests/<area>/: specs, one directory per feature.
- Driver. Positron's
infra/descends from VS Code's own smoke-test automation driver (playwrightDriver.ts,playwrightElectron.ts,code.ts); those files carry Microsoft's MIT header. - Fixtures. A shared
tests/_test.setup.tsextends Playwright'stestwith fixtures such asapp,page,openFile,settings/settingsFile,hotKeys,runCommand,logger, and automatic screenshot, trace and log attachment. Each area can have its own_test.setup.tsthat extends it with its own settings;tests/quarto/_test.setup.tsenablesquarto.inlineOutput.enabled, for example.- Each spec file declares
test.use({ suiteId: __filename }), so it gets a fresh app instance. - Workspaces are provisioned from an in-repo
test-files/directory. - There's a commented example spec (
tests/example.test.ts) and aCLAUDE.mdfor test authors.
- Each spec file declares
- Playwright projects for each target:
e2e-electron(the default),e2e-chromium/e2e-server(browser), ande2e-windows/e2e-macOS-ci, filtered by tag. - Tags. Tests carry tags such as
@:critical,@:quartoand@:web.@:criticalalways runs on PRs. Other tags run when they appear in the PR description, or when changed paths map to them (.github/workflows/test-tag-paths-map.json). - CI. Retries once in CI and not locally; 3 workers; 2-minute test and 15 s expect timeouts. Traces, screenshots and logs are captured on failure and published as an HTML report artifact.
- Tests are run and debugged locally from the command line (
npx playwright test --project e2e-electron), UI mode, or the Playwright Test extension.
Adapting it here
- Put it in a new workspace, e.g.
apps/vscode/test/e2eor a separateapps/vscode-e2e, with its ownplaywright.config.ts. - Launch VS Code (downloaded with
@vscode/test-electron, which we already use) with the extension, preferably the packaged VSIX so we test what ships. Add a Positron project that reuses the download logic fromyarn test-positron. - Start with a small set of page objects:
visualEditor(toggle mode, the cell toolbar, typing in a code cell, completion popups, spelling marks),outline,helpPanel, andnotebookRenderer. For locators in our own webviews, adddata-testidattributes rather than rely on generated class names, as Positron does ([data-testid="quarto-kernel-status"]). - Start with a
@:criticalset that runs on every PR, and path-mapped tags later if the suite grows. - Scope out a browser-only project for the editor bundle (
apps/vscode-editor, with the host messages stubbed) as a possible faster lane. It would also cover panmirror for RStudio.
Things to settle
- Licensing. Positron's e2e tests, page objects and fixtures are under the Elastic License 2.0; this repo is MIT. We can follow the structure and conventions freely, but copying Positron-authored code needs a decision from Posit. VS Code's MIT-licensed smoke-test driver files can be used either way.
- Overlap with Positron's own tests. Positron already has
tests/quarto/specs that exercise this extension inside Positron: inline output, the outline, the Python and R cells. We should coordinate so we don't duplicate them. Ideally a Positron-specific regression found here becomes a test there, and the reverse. - CI cost. Decide which OS runs on every PR, and whether R, Python and the Quarto CLI need installing in CI for the first tests. The first visual-editor tests shouldn't need any of them.
First milestone
- The driver, one
e2e-electronproject, and CI wired up with an HTML report artifact. - Visual editor specs that cover what the tranche 4 PRs (#1174, #1176) left to manual testing:
- open a
.qmdin visual mode; - edit a code cell, check highlighting, and use the cell toolbar;
- trigger autocomplete;
- check spelling marks;
- switch back to source mode, and check the text roundtrips.
- open a
- The
CLAUDE.md/ README for test authors, including how to run a single spec and open the trace.
🤖 Generated with Claude Code
- Lingua principale
- TypeScript
- Stelle
- 655
- Fork
- 64
- Merge medio
- 8h 45m
- PR unite (30g)
- 36
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/quarto
-
VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)Forse già presa @Bondrewd-K l’ha presa 5 giorni fa. Apertabug vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/quarto#1194 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto#1139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
quarto-dev/quarto#1138 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
quarto-dev/quarto#1137 ·
I maintainer di solito rispondono entro 1 giorno
-
Add dependabot?Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarto-dev/quarto#1135 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/quarto
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
simkimsia/netlify-axi#19 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
subhranshudash13-dotcom/Contribo#74 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement frontend good first issue Stellar Wave trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Godgift-care/sci-healthcare-frontend#166 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
backend good first issue security Stellar Wave trivial
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Godgift-care/sci-healthcare-backend#171 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno