author-e2e-tests

Write and maintain Playwright end-to-end tests for the Positron IDE.

4.2k|179|Updated May 24, 2022
One-click install
npx skills add https://github.com/posit-dev/positron --skill author-e2e-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: author-e2e-tests
Source: https://github.com/posit-dev/positron/tree/main/.claude/skills/author-e2e-tests
Command: npx skills add https://github.com/posit-dev/positron --skill author-e2e-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing Playwright e2e tests for Positron requires following project-specific conventions (custom fixtures, suite IDs, tags, page objects) that are easy to get wrong, leading to flaky, broken, or unmaintainable tests.

Core Features & Use Cases

  • Test Authoring Guidance: Enforces the mandatory test file structure, including imports from ../_test.setup, suiteId: __filename, and platform/feature tags.
  • Fixture and Page Object Reference: Documents worker-scoped and test-scoped fixtures (app, python, r, sessions, hotKeys, settings) and the app.workbench.* page object model.
  • Flake Prevention: Catalogs common mistakes such as fixed waits, wrong retry mechanisms, missing cleanup, and hardcoded interpreter versions.
  • Use Case: When adding a new regression test for the Data Explorer, use this Skill to copy the correct file structure, pick the right fixtures and tags, and write assertions that follow Positron's retry and selector conventions.

Quick Start

Write a new Playwright e2e test for the Positron console feature following the project's test conventions.

Frequently Asked Questions about author-e2e-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Playwright e2e test for Positron?

Import test, expect, and tags from ../_test.setup rather than @playwright/test, set test.use({ suiteId: __filename }), and wrap tests in a tagged test.describe block. Use fixtures like app, python, or r and interact with the UI through app.workbench page objects.

How do I run Positron Playwright e2e tests?

Run npx playwright test <test-name>.test.ts --project e2e-electron for a single file, or point at a directory under test/e2e/tests/ for a category. Use --grep for tag filtering, --headed to watch the browser, and --debug to step through tests.

What fixtures are available in Positron e2e tests?

Core fixtures include app for page objects, page for raw Playwright access, python and r for auto-started interpreters, sessions for manual session control, hotKeys for shortcuts, settings for configuration, and cleanup for file restoration. Scopes differ between worker and test level.

Why is my Playwright e2e test flaky in Positron?

Flakiness usually comes from fixed page.waitForTimeout sleeps, missing afterEach cleanup, relying on interpreter state across tests, or wrapping already-retrying POM methods in toPass. Replace fixed waits with web-first assertions, expect.poll, or POM wait helpers.

When should I use toPass versus expect.poll in Playwright tests?

Use toPass when the action itself might need reissuing, such as a click that occasionally does not register, so action and assertion retry together. Use expect.poll for non-Locator values or matchers that Locator assertions lack, like count comparisons.