write-e2e-test
Skill7 starsChanged 3 months agoISCView on GitHub
Write Playwright E2E tests following project patterns for components and user interactions. Use when adding tests for new features, testing accessibility, or validating responsive behavior.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- chattermate/chattermate.chattheir own version, first seen Oct 13, 2026
- authgear/authgear-servertheir own version, first seen Oct 8, 2026
- baserow/baserowtheir own version, first seen Oct 8, 2026
- usebruno/brunotheir own version, first seen Oct 8, 2026
- tlolkema/skills-explainedtheir own version, first seen Feb 3, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- usebruno/bruno★ 48ksame name
- baserow/baserow★ 6.3ksame name
- authgear/authgear-server★ 2.1ksame name
- chattermate/chattermate.chat★ 156same name
- tlolkema/skills-explained★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-primitiveSkill
- add-providerSkill
- advisorSkill
- co-authorSkill
- create-componentSkill
- create-pageSkill
- generate-llmsSkill
- page-stylingSkill
- refresh-provider-docsSkill
- semantic-commitSkill
- theme-stylingSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Create Playwright E2E tests for agentconfig.org following project patterns.
- Very specific: line 12
All E2E tests live in site/tests/e2e/:
- Distinctive: line 49
Use the most resilient locators, in this order of preference:
- Distinctive: line 136
Test at multiple viewport sizes:
- Distinctive: line 158
Test both light and dark modes:
- Distinctive: line 181
Don't rely on state from previous tests
- Very specific: line 182
Use beforeEach for common setup
- Distinctive: line 187
Use Playwright's built-in assertions (auto-waiting):
- Distinctive: line 203
Use descriptive names that explain the expected behavior:
- Distinctive: line 227
Before considering tests complete:
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write E2E Test
Create Playwright E2E tests for agentconfig.org following project patterns.
Test File Location
All E2E tests live in site/tests/e2e/:
site/tests/e2e/
├── app.spec.ts
├── comparison.spec.ts
├── fileTree.spec.ts
├── navigation.spec.ts
├── primitiveCards.spec.ts
└── theme.spec.tsTest File Structure
import { test, expect } from '@playwright/test'
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/')
})
test('should do something specific', async ({ page }) => {
// Arrange
const element = page.getByRole('button', { name: 'Click me' })
// Act
await element.click()
// Assert
await expect(page.getByText('Success')).toBeVisible()
})
})Locator Strategy (Priority Order)
Use the most resilient locators, in this order of preference:
1. Role + Name (most resilient)
page.getByRole('button', { name: 'Submit' })
page.getByRole('heading', { name: 'Welcome' })
page.getByRole('navigation')2. Label/Placeholder (for form elements)
page.getByLabel('Email address')
page.getByPlaceholder('Enter your email')3. Text content (for static text)
page.getByText('Learn more')
page.getByText(/welcome/i) // regex for flexible matching4. Test ID (when others don't work)
page.getByTestId('file-tree-node')5. CSS selectors (last resort)
page.locator('.custom-component')Common Test Patterns
Navigation
test('should scroll to section when nav link is clicked', async ({ page }) => {
const navLink = page.getByRole('link', { name: 'File Tree' })
const section = page.getByRole('region', { name: 'File Tree' })
await navLink.click()
await expect(section).toBeInViewport()
})Theme Toggle
test('should toggle between light and dark mode', async ({ page }) => {
const toggle = page.getByRole('button', { name: /theme/i })
await expect(page.locator('html')).toHaveAttribute('data-theme', 'light')
await toggle.click()
await expect(page.locator('html')).toHaveAttribute('data-theme', 'dark')
})Expandable Content
test('should expand tree node on click', async ({ page }) => {
const treeNode = page.getByRole('button', { name: '.github/' })
const childNode = page.getByRole('button', { name: 'copilot-instructions.md' })
await expect(childNode).not.toBeVisible()
await treeNode.click()
await expect(childNode).toBeVisible()
})Copy to Clipboard
test('should copy template to clipboard', async ({ page, context }) => {
await context.grantPermissions(['clipboard-read', 'clipboard-write'])
const copyButton = page.getByRole('button', { name: 'Copy template' })
await copyButton.click()
const clipboardText = await page.evaluate(() => navigator.clipboard.readText())
expect(clipboardText).toContain('expected content')
})Responsive Testing
Test at multiple viewport sizes:
test.describe('Mobile viewport', () => {
test.use({ viewport: { width: 375, height: 667 } })
test('should show mobile navigation', async ({ page }) => {
await expect(page.getByRole('button', { name: 'Menu' })).toBeVisible()
})
})
test.describe('Desktop viewport', () => {
test.use({ viewport: { width: 1280, height: 720 } })
test('should show full navigation', async ({ page }) => {
await expect(page.getByRole('navigation')).toBeVisible()
})
})Theme Testing
Test both light and dark modes:
test.describe('Dark mode', () => {
test.use({ colorScheme: 'dark' })
test('should render with dark theme colors', async ({ page }) => {
// Verify dark mode specific styling
})
})
test.describe('Light mode', () => {
test.use({ colorScheme: 'light' })
test('should render with light theme colors', async ({ page }) => {
// Verify light mode specific styling
})
})Test Independence
Each test must be independent:
- Don't rely on state from previous tests
- Use
beforeEachfor common setup - Clean up any side effects
Assertions
Use Playwright's built-in assertions (auto-waiting):
// Good - auto-waits for element
await expect(page.getByText('Hello')).toBeVisible()
await expect(page.getByRole('button')).toBeEnabled()
await expect(page.locator('.item')).toHaveCount(3)
await expect(page.getByRole('link')).toHaveAttribute('href', '/about')
// Bad - doesn't auto-wait
const text = await page.textContent('.item')
expect(text).toBe('Hello')Test Naming
Use descriptive names that explain the expected behavior:
// Good
test('should expand tree node when clicked', ...)
test('should scroll to File Tree section when nav link is clicked', ...)
test('should display error message when copy fails', ...)
// Bad
test('click test', ...)
test('tree works', ...)
test('test 1', ...)Running Tests
cd site
bun run test # Run all tests
bun run test:ui # Interactive test UIChecklist
Before considering tests complete:
- Uses resilient locators (role > text > testid > css)
- Each test is independent
- Test name describes expected behavior
- Uses Playwright auto-waiting assertions
- Covers happy path and edge cases
- Tests responsive behavior if relevant
- Tests both themes if relevant
- No hardcoded waits (
page.waitForTimeout)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

