author-e2e-tests
FreeNo executable scriptsNot checkedUse when writing or maintaining Playwright e2e tests for Positron -- new test files, test cases, test infrastructure, or performance/metric tests. For a named…
by posit-dev★ 4,361 GitHub starsAbout this skill
Positron Playwright E2E Testing
Purpose
Provides specialized knowledge and patterns for writing correct, reliable Playwright e2e tests that follow Positron's established conventions and avoid common mistakes.
Philosophy: What Makes a Good E2E Test
Prefer the smallest test that confidently protects the intended user-visible behavior. Do not add additional scenarios or assertions simply because they are easy to write -- extra setup, incidental checks, and duplicate assertions add maintenance cost and flake surface without adding confidence.
A good e2e test:
- validates observable user behavior, not implementation details
- exercises a complete workflow, not a fragment of one
- minimizes setup to what the regression actually needs
- remains deterministic -- no reliance on fixed waits, execution order, or leftover state
- isolates the single regression it protects, so a failure points at one cause
Before You Start: Is E2E the Right Level?
Check the "Where should I put my test?" table in CLAUDE.md first.
If what would break can be checked without a running app (a CSS selector, a pure function, a component's props), write a Vitest test instead and tell the dev why.
Signs you're about to over-reach: the test switches settings or themes several times to check a static file, or asserts on computed styles rather than a user workflow.
When to Use This Skill
Load this skill when:
- Creating new e2e test files
- Adding test cases to existing test files
- Debugging flaky or failing tests
- Understanding the test fixture system
- Working with page objects
- Choosing correct selectors and assertions
Start Here: Read a Neighbor Test
Before writing anything, open an existing test in test/e2e/tests/<feature>/ for the area you're working on and skim it. The reference docs below tell you how to verify a method and why a pattern exists; the existing tests show you what a correct test actually looks like, including the flake-avoiding details that live in no doc, such as which panes overlap the view under test, how cell/output values render (numeric grid cells come back as strings, for instance), and which tags a suite in that area carries. Copy the closest neighbor's structure, then adjust it. Use the reference docs to confirm each method name against source and to understand the gotchas.
Critical: Test File Structure
Every test file MUST follow this structure:
import { test, expect, tags } from '../_test.setup';
// REQUIRED: Each test file needs a unique suiteId
test.use({
suiteId: __filename
});
test.describe('Feature Name', {
tag: [tags.WEB, tags.WIN, tags.CRITICAL, tags.FEATURE_TAG]
}, () => {
test.beforeEach(async ({ app }) => {
// Optional setup for each test
});
test.afterEach(async ({ app, hotKeys }) => {
// Cleanup after each test
await hotKeys.closeAllEditors();
});
test('Test description', async ({ app, python }) => {
// Test implementation
});
});
MANDATORY REQUIREMENTS:
- Import from
../_test.setup- NOT from@playwright/test. Import only what the file uses:testandtagsalways,expectonly if you write raw assertions (a file whose assertions all go through POM methods doesn't importexpect, and an unused import fails lint). - Set
suiteId: __filename- Required for app isolation - Add appropriate tags for platform filtering
Quick Reference: Available Fixtures
| Fixture | Use Case |
|---|---|
app |
Access workbench page objects: app.workbench.console, etc. |
page |
Direct Playwright page access: page.getByLabel(...) |
python |
Auto-start Python interpreter before test |
r |
Auto-start R interpreter before test |
sessions |
Manual session management: await sessions.start('python') |
executeCode |
Execute code: await executeCode('Python', 'print("hi")'); |
openFile |
Open file: await openFile('workspaces/test/file.py'); |
hotKeys |
Keyboard shortcuts: await hotKeys.closeAllEditors(); |
settings |
Change settings: await settings.set({ 'key': value }); |
See references/fixtures.md for complete fixture documentation.
Page Objects
UI interactions go through app.workbench.* page objects, not raw locators. Before writing any interaction: check for an existing method, then consider adding a reusable one, and only fall back to a raw locator when neither fits -- see references/common-mistakes.md #15 for the full workflow, and references/page-objects.md for usage idioms and "Finding the Exact Source" for looking up the exact signature in test/e2e/pages/*.ts. Never guess or paraphrase a method name -- copy it from the source file.
Assertions
Standard Playwright web-first assertions apply, with the project's 15s default timeout covering most checks -- don't add { timeout } reflexively. See references/assertions.md for choosing between toPass, expect.poll, and plain web-first assertions, selector priority, and what makes an assertion w
Install author-e2e-tests in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the author-e2e-tests skill do?
Use when writing or maintaining Playwright e2e tests for Positron -- new test files, test cases, test infrastructure, or performance/metric tests. For a named test that is already failing or flaking, in CI or on your machine, use debug-e2e-test instead.
How do I install the author-e2e-tests skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the author-e2e-tests skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic