| name | playwright-e2e |
|---|---|
| description | writing, running, and debugging Playwright tests. working with their output from github actions |
Guidelines for writing and iterating on Playwright tests for VS Code extensions.
Read ALL before responding:
references/coding-playwright-tests.md- Writing testsreferences/local-setup.md- Scratch org setup (Dreamhouse, minimal, non-tracking)references/iterating-playwright-tests.md- Iterating on tests ("Things to ignore" for failure analysis)references/analyze-e2e.md- Analyzing E2E test results from CI
Shared code (helpers, locators, configuration) for tests.
Desktop workspace shapes (pick one per test):
- No folder open — fixture opens a Salesforce project, then call
prepareNoFolderOpenForPaletteTests(page)(runsWorkspaces: Close Workspace+ workbench wait). Or usecloseWorkspaceToEmptyWindowif UI is already prepared. - Folder open, no
sfdx-project.json—createDesktopTest({ emptyWorkspace: true }); workspace path comes fromcreateEmptyTestWorkspace()(also exported from the package). - Default org in workspace — pass
orgAlias: '…'(e.g.MINIMAL_ORG_ALIAS/DREAMHOUSE_ORG_ALIAS) so.sfdx/config.jsongetstarget-org. OmitorgAliasor useundefinedfor noconfig.json(no org). - Multi-package directory, no org —
multiPackageNoOrgDesktopTest(extendnoOrgDesktopTest); creates a temp workspace withsfdx-project.jsonlisting multiplepackageDirectories(force-app,extra-pkg). UsemultiPackageNoOrgTestfromfixtures/index.tsin test files.
VSIX mode (useVsix option):
createDesktopTest({ useVsix: true })— installs built VSIXs into a hash-keyed cache dir (.vscode-test/ext-<hash>/) and launches VS Code with--extensions-dirinstead of--extensionDevelopmentPath. Exercises real shipping artifact (bundleddist/,.vscodeignore,packageUpdates).- Default:
process.env.E2E_FROM_VSIX === '1'— set in CI to enable without code changes. - Requires
vscode:packageto have run first (produces.vsixin package dir). org-browsertest:desktopdepends onvscode:packagefor this reason. - Idempotent across parallel workers: atomic rename; second worker skips if cache exists.
Available local + CI/GHA.
- Output:
~/.sf/vscode-spans/—web-*.jsonl(test:web),node-*.jsonl(test:desktop) - Auto-enabled (no manual enable needed)
- CI runs: copied into package
test-results/spans/artifacts (see workflow upload/download inreferences/analyze-e2e.md) - Latest:
ls -lt ~/.sf/vscode-spans/ - Clear before run for fresh output:
rm -rf ~/.sf/vscode-spans/ - Format: JSONL; parse each line with
JSON.parse - Fields:
name,traceId,spanId,parentSpanId,durationMs,status,startTime,attributes
See .claude/skills/span-file-export/SKILL.md for enable/OTLP vs file.
If you aren't sure if orgs are set up locally,
sf org listLook for the required org aliases (e.g., minimalTestOrg, nonTrackingTestOrg, orgBrowserDreamhouseTestOrg). If missing, create them using the appropriate setup commands from references/local-setup.md.
Pro tip: Use sf org list --json | jq '.result.scratchOrgs[] | select(.alias) | .alias' to list only scratch org aliases.
When running Playwright tests (npm run test:web, test:desktop, etc.), never block >30s. Use is_background: true so tests run while the AI continues. Check terminal output or output_file later.
See references/full-suite-execution.md for complete guide on running all E2E tests locally across all 9 packages in correct dependency order with failure analysis.
To run only your new test in CI while iterating:
- Disable other workflows — add your branch to
branches-ignorein.github/workflows/*.ymlthat havepush: branches-ignore: [main, develop](e.g.testCommitExceptMain.yml,coreE2E.yml,orgBrowserE2E.yml, etc.) - Filter target workflow — add
--grep "Your Test Title"to the test run command in the workflow you care about - Optional — skip org setup steps not needed for your test (e.g. minimal/non-tracking orgs)
- Restore — remove branch from
branches-ignore, remove--grep, uncomment skipped steps
- https://playwright.dev/docs - Playwright docs