Index of every page on this site: llms.txt
All skills
zenstudiolab avatar

/extension-testing-expert-skill

@032d25b
Run it yourself

Expert guidance for writing and running end-to-end (E2E) tests for browser extensions using Playwright. Use when: (1) Setting up E2E testing for a new extension project, (2) Adding new test cases to an existing extension, (3) Debugging flaky extension tests, (4) Optimizing CI/CD pipelines for extension testing (e.g., XVFB setup).

  • 5 files
  • 12.5 KB
  • Updated 9 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/zenstudiolab/skills/extension-testing-expert-skill

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈91 tokens for metadata: the name and description. ≈648 when used: this file. ≈798 more on demand in 2 files.

Description uses 4.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈362 characters, or 4.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Playwright Extension Testing Expert

This skill provides a "gold standard" for browser extension E2E testing, specifically optimized for MV3 and frameworks like WXT. Extensions require unique handling for persistent browser contexts, non-headless modes, and onboarding flows.

Core Mandates

  1. Non-Headless is Mandatory: Browser extensions do NOT load properly in standard headless mode. Use headless: false.
  2. Persistent Context: Extensions require launchPersistentContext to maintain state and load correctly.
  3. XVFB for Linux/CI: Always prefix test commands with xvfb-run -a on Linux/CI to provide a virtual display for the non-headless browser.
  4. Data-TestId First: Prohibit text-based locators. Always add data-testid to source code if missing.
  5. Dismiss Onboarding: Every test must dismiss welcome banners/onboarding dialogs before interacting with the UI.
  6. Complementary Usage: This skill is highly specialized for extensions. For general Playwright best practices (locators, assertions, reporting), you MUST check if playwright-expert or playwright-skill is available and use them in tandem.

Available Boilerplate (Assets)

This skill provides pre-configured boilerplate to jumpstart a project. See the assets/boilerplate/ directory.

  • extension-helper.ts: A robust Playwright fixture setup including extensionId discovery and onboarding dismissal.
  • playwright.config.ts: The recommended configuration for extension testing.

Workflow: Setting Up a New Project

  1. Identify Project Structure: Determine where the built extension output is located (e.g., .output/chrome-mv3).
  2. Inject Boilerplate: Use the read_file tool to extract the boilerplate from this skill's assets/ and write them to the target project's tests/e2e/ directory.
  3. Verify Build Step: Remind the user that extensions must be built BEFORE running E2E tests (yarn build).
  4. Run First Test: Use xvfb-run -a playwright test to verify the setup.

Best Practices

The "Dismissal" Loop

Always use the dismissWelcomeBanner helper provided in the boilerplate. Extensions often have multiple layers of onboarding (e.g., "Grant Access", "Get Started").

Storage Management

The boilerplate's extensionId fixture automatically clears chrome.storage.local and chrome.storage.sync before each test. Ensure tests don't assume state exists unless they create it.

Waiting for UI Settle

Extensions can be slower to load than standard web pages. Use a 3000ms settle time after navigation or dismissal.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 032d25b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 9 months ago

README badge

README badge for zenstudiolab/skills/extension-testing-expert-skill