e2e-testing
Skill644 starsChanged 10 months agoMITView on GitHub
Playwright E2E testing and Lighthouse performance auditing. Use when setting up E2E tests, running Playwright tests, performing Lighthouse audits, or debugging E2E test failures.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 231
Fix: Start the E2E server first:
- Distinctive: line 253
Fix: Use the auth bypass server:
- Distinctive: line 264
Fix: Ensure you're using the correct tenant URLs:
“Common” is measured: kept by at least 6 in 10 of the 38 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
E2E Testing & Lighthouse Audits
This skill covers Playwright browser testing and Lighthouse performance auditing for PropertyWebBuilder.
E2E Environment Setup
Initial Setup (One-time)
# 1. Install Playwright browsers
npx playwright install
# 2. Reset and seed the E2E database
RAILS_ENV=e2e bin/rails playwright:resetStarting the E2E Server
The E2E environment runs on port 3001 with two test tenants.
# Standard server (requires login)
RAILS_ENV=e2e bin/rails playwright:server
# Server with admin auth bypass (for UI testing without login)
RAILS_ENV=e2e bin/rails playwright:server_bypass_authTest Tenants:
- Tenant A: http://tenant-a.e2e.localhost:3001
- Tenant B: http://tenant-b.e2e.localhost:3001
Test Users (per tenant):
- Admin:
admin@tenant-a.test/password123 - Regular:
user@tenant-a.test/password123 - (Same pattern for tenant-b)
Re-seeding Data
# Full reset (drop, create, migrate, seed)
RAILS_ENV=e2e bin/rails playwright:reset
# Re-seed only (faster, keeps schema)
RAILS_ENV=e2e bin/rails playwright:seedRunning Playwright Tests
Run All Tests
# Run all tests (server must be running)
npx playwright test
# Run with UI mode (interactive)
npx playwright test --ui
# Run with headed browser (see the browser)
npx playwright test --headedRun Specific Tests
# Run a specific test file
npx playwright test tests/e2e/public/property-search.spec.js
# Run tests matching a pattern
npx playwright test -g "property search"
# Run only admin tests
npx playwright test --project=chromium-admin
# Run only public tests
npx playwright test --project=chromiumDebug Failing Tests
# Run with debug mode (step through)
npx playwright test --debug
# Run with trace viewer
npx playwright test --trace on
# Show HTML report after run
npx playwright show-reportTest File Structure
tests/e2e/
├── fixtures/
│ ├── test-data.js # TENANTS, ADMIN_USERS, ROUTES constants
│ └── helpers.js # loginAsAdmin, goToTenant, resetWebsiteSettings
├── public/ # Public-facing page tests (parallel)
│ ├── property-search.spec.js
│ ├── property-details.spec.js
│ └── contact-form.spec.js
├── admin/ # Admin tests (run serially)
│ ├── editor.spec.js
│ ├── properties-settings.spec.js
│ └── site-settings.spec.js
├── auth/ # Authentication tests
│ └── sessions.spec.js
└── global-setup.js # Verifies E2E databaseWriting E2E Tests
Basic Test Pattern
const { test, expect } = require('@playwright/test');
const { TENANTS, ROUTES } = require('./fixtures/test-data');
const { goToTenant, loginAsAdmin } = require('./fixtures/helpers');
test.describe('Feature Name', () => {
test('should do something', async ({ page }) => {
await goToTenant(page, TENANTS.A, ROUTES.HOME);
await expect(page).toHaveTitle(/Expected Title/);
});
});Admin Test Pattern
const { ADMIN_USERS, ROUTES } = require('../fixtures/test-data');
const { loginAsAdmin, goToAdminPage } = require('../fixtures/helpers');
test.describe('Admin Feature', () => {
test.beforeEach(async ({ page }) => {
// With auth bypass server:
await goToAdminPage(page, ADMIN_USERS.TENANT_A.tenant, ROUTES.ADMIN.DASHBOARD);
// OR with regular server:
await loginAsAdmin(page, ADMIN_USERS.TENANT_A);
});
test('should manage settings', async ({ page }) => {
// test code
});
});Available Helpers
// Navigation
await goToTenant(page, TENANTS.A, '/en/buy');
await goToAdminPage(page, tenant, '/site_admin');
// Authentication
await loginAsAdmin(page, ADMIN_USERS.TENANT_A);
await expectToBeLoggedIn(page);
await expectToBeOnLoginPage(page);
// Forms
await fillField(page, 'Email', 'test@example.com');
await submitFormWithCsrf(page, 'form.contact-form');
await saveAndWait(page, 'Save Changes');
// Test data reset
await resetWebsiteSettings(page, tenant);
await resetAllTestData(page, tenant);
// Environment check
const isE2e = await isE2eEnvironment(page, tenant);Lighthouse Performance Audits
Run Lighthouse Locally
# Run Lighthouse CI (starts server automatically)
npx lhci autorun
# Run against running server
npx lhci collect --url=http://localhost:3000/
npx lhci assertLighthouse Configuration
The lighthouserc.js file configures:
URLs Audited:
- Homepage: http://localhost:3000/
- Buy page: http://localhost:3000/buy
- Rent page: http://localhost:3000/rent
Performance Budgets:
| Metric | Threshold | Level |
| Performance Score | ≥70% | error |
| Accessibility Score | ≥90% | error |
| Best Practices | ≥90% | warn |
| SEO Score | ≥90% | error |
| LCP | ≤4.0s | error |
| CLS | ≤0.25 | error |
| FCP | ≤2.5s | warn |
| TBT | ≤500ms | warn |
View Lighthouse Reports
# After running lhci autorun, reports are in .lighthouseci/
open .lighthouseci/lhr-*.html
# Or view the uploaded report URL (shown in terminal)Troubleshooting
Server Not Running
Error: page.goto: net::ERR_CONNECTION_REFUSEDFix: Start the E2E server first:
RAILS_ENV=e2e bin/rails playwright:serverDatabase Not Initialized
Error: E2E database not initializedFix: Reset the database:
RAILS_ENV=e2e bin/rails playwright:resetAuth Bypass Not Working
Error: Auth bypass not working! Redirected to login.Fix: Use the auth bypass server:
RAILS_ENV=e2e bin/rails playwright:server_bypass_authTenant Not Found
Error: Could not find website for subdomainFix: Ensure you're using the correct tenant URLs:
http://tenant-a.e2e.localhost:3001http://tenant-b.e2e.localhost:3001
Stale Test Data
Tests failing with unexpected dataFix: Reset test data:
RAILS_ENV=e2e bin/rails playwright:reset
# Or via helper in test:
await resetAllTestData(page, TENANTS.A);CI/CD Integration
GitHub Actions Workflow
The .github/workflows/lighthouse.yml runs Lighthouse on push/PR:
- Uploads results to temporary public storage
- Posts score summary as PR comment
- Fails build if performance budgets not met
Running E2E in CI
- name: Setup E2E database
run: RAILS_ENV=e2e bin/rails playwright:reset
- name: Start E2E server
run: RAILS_ENV=e2e bin/rails playwright:server_bypass_auth &
- name: Run Playwright tests
run: npx playwright testQuick Reference
| Task | Command |
| Setup E2E database | RAILS_ENV=e2e bin/rails playwright:reset |
| Start E2E server | RAILS_ENV=e2e bin/rails playwright:server |
| Start server (no auth) | RAILS_ENV=e2e bin/rails playwright:server_bypass_auth |
| Run all E2E tests | npx playwright test |
| Run tests with UI | npx playwright test --ui |
| Debug failing test | npx playwright test --debug |
| View test report | npx playwright show-report |
| Run Lighthouse | npx lhci autorun |
| Reseed test data | RAILS_ENV=e2e bin/rails playwright:seed |
Other versions89 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 89
- affaan-m/ECC★ 246ksame name
- langflow-ai/langflow★ 156ksame name
- OpenHands/OpenHands★ 92ksame name
- All-Hands-AI/OpenHands★ 91ksame name
- pulsejet/memories★ 3.9ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- paradigmxyz/centaur★ 1.4ksame name
- nodetool-ai/nodetool★ 588same name
- Opentrons/opentrons★ 525same name
- loulanyue/awesome-claude-notes★ 272same name
79 more not listed
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.
Used alongsideProjects with it also use everything-claude-code, investor-materials and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
InfopibeSkilleverything-claude-code
Also in 10 projects that use this
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 27 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
tpavanipradeepSkillbun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
Also in 18 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 8 projects that use this
niloykumarbarmanSkillproduct-capability
Translate PRD intent, roadmap asks, or product discussions into an implementation-ready capability plan that exposes constraints, invariants, interfaces, and unresolved decisions before multi-service work starts. Use when the user needs an ECC-native PRD-to-SRS lane instead of vague planning prose.
Also in 9 projects that use this
- +1 more from Infopibe
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- rails-testingSkill
- seed-packsSkill
- theme-creationSkill
- theme-evaluationSkill
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.

