testing
Use when running or interpreting MDE Vitest, Playwright, smoke and CI tests, or writing and executing test-first RED/GREEN regressions. For coverage design without execution use tests; for full user journeys use e2e.
- License 许可
- MIT
- 所属仓库
- amoai-tech/mdeai
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 1
01 前言 Front Matter
- name
- testing
- tags
- testing, vitest, playwright, evals, claude-code, e2e, mdeai
- title
- Testing — mdeai.co toolchain + Claude-assisted layers
- impact
- HIGH
- description
- Use when running or interpreting MDE Vitest, Playwright, smoke and CI tests, or writing and executing test-first RED/GREEN regressions. For coverage design without execution use tests; for full user journeys use e2e.
- impactDescription
- Vitest/Playwright/MCP recipes + generic layers + evals
02 资源文件 18
- 参考文档evals/evals.json1.1 KB
- 参考文档evals/trigger-evals.json1.2 KB
- 参考文档exploratory.md6.1 KB
- 参考文档playwright.md4.3 KB
- 脚本references/examples/console_logging.py1.0 KB
- 脚本references/examples/element_discovery.py1.4 KB
- 脚本references/examples/static_html_automation.py953 B
- 参考文档references/issue-taxonomy.md3.6 KB
- 参考文档references/mocking.md1.4 KB
- 参考文档references/resource-hub.md1.8 KB
- 参考文档references/tdd.md2.2 KB
- 参考文档references/testing-layers.md3.5 KB
- 参考文档references/testing-strategy.md1.2 KB
- 参考文档references/tests.md2.2 KB
- 参考文档references/writing-good-tests.md8.1 KB
- 脚本scripts/with_server.py4.0 KB
- 参考文档templates/dogfood-report-template.md1.5 KB
- 参考文档vitest.md5.4 KB
03 SKILL.md 正文
testing — mdeai.co + cross-stack test layers
Ownership
testing owns executing existing tests, interpreting test output, and writing and running test-first regressions. tests owns designing cases, matrices, coverage or grading criteria when the user does not ask to run anything. If the request includes both design and execution, testing owns the job and can consult tests as a reference, not start another owner. For an unknown failure, start with errors to reproduce and localize the cause; consult systematic-debugging only for deeper tracing, then return to testing for regression proof.
Select testing: “Run the existing Vitest suite and diagnose failures” or “Write a failing test and run the RED/GREEN fix.”
Select tests instead: “List the tests needed for webhook idempotency without running them.”
Select e2e instead: “Verify checkout from the browser through a persisted ticket.”
Stop when: Report the exact command, real pass/fail output, what was exercised, the remaining untested risk and the next action. If tests cannot run, report NOT RUN with the blocker; do not claim the suite passed.
For test-first RED → GREEN → REFACTOR work, read references/tdd.md. For broader strategy, read references/testing-strategy.md.
When NOT to use
- Design-only coverage or test matrices without executing anything — use
tests. - A complete multi-layer browser → API → persisted-state user journey — use
e2e. - Load / soak testing as the primary ask (no mdeai harness yet)—keep scope to shipped gates in CLAUDE.md
Pick the topic that matches the work, then load it.
| Intent | Read |
|---|---|
| Component tests, unit tests, jsdom, Vitest config, mocks | vitest.md |
| Playwright e2e, real browser, login flow, multi-step | playwright.md |
| Chrome DevTools MCP — traces, network panel, real-browser inspection | Use the configured Chrome DevTools tooling directly; keep test ownership in testing |
| LCP / Core Web Vitals verification | Use current performance tooling; performance implementation ownership stays with the affected framework/deploy domain |
| Manual exploratory testing, dogfood session, bug discovery | exploratory.md |
| Choosing what to test (pyramid, ROI, coverage strategy) | references/testing-strategy.md |
| Common bug patterns / triage taxonomy | references/issue-taxonomy.md |
| Map of layers (unit → E2E → visual → mobile → agentic → evals) | references/testing-layers.md |
| Curated external links (subagents, marketplace, Anthropic eval docs) | references/resource-hub.md |
| Browser/MCP tool itself failing to connect | errors for diagnosis; consult systematic-debugging for deeper tracing |
Browser surfaces — pick one
Choose the lightest surface that proves the behavior:
| Surface | When to pick |
|---|---|
| Playwright | Repeatable E2E/user journeys, auth flows, regression coverage, CI-safe browser proof |
| Chrome DevTools tooling | Network/console/performance traces, Lighthouse/Core Web Vitals, runtime inspection |
| Interactive authenticated browser tooling | A real signed-in session is required and the configured environment explicitly provides it |
Resolve available browser tooling from the current environment; do not assume a historical MCP/plugin is installed. Never hardcode test-user passwords or tokens in a skill.
mdeai recipes
| Job | Surface | Owner skill |
|---|---|---|
LCP regression on /coffee |
current browser performance tooling | testing for proof; affected framework/deploy skill for implementation |
| Lighthouse audit on a Vercel preview URL | Chrome DevTools tooling (lighthouse_audit --mode navigation --device mobile) |
nextjs |
| Bundle / Core Web Vitals trace | current performance tooling | testing for proof; nextjs for implementation ownership |
| Supabase email/OAuth sign-in regression | Playwright or configured authenticated browser | testing → playwright.md |
| Stripe checkout end-to-end | authenticated browser/Playwright path | e2e owns the complete journey; consult stripe for payment rules |
| UI four-state visual verify | Playwright | testing → playwright.md |
| RLS / 403 debugging during a UI flow | Chrome DevTools tooling (list_console_messages --types error + list_network_requests --resourceTypes Fetch) | supabase for known RLS; errors if source unknown |
| Console-error sweep before commit | Playwright or current DevTools tooling | testing |
Repo-specific pointers (mdeai.co)
- Vitest entry:
npm run test(run once) /npm run test:watch - Playwright E2E coverage exists under
e2e/; use focused specs first instead of the full suite for narrow changes. - Required-states pattern in the MDE UI state contract: every data-fetching component handles loading/error/empty/success — tests must cover all four
- Resolve the active dev/preview command and port from current repo configuration instead of hardcoding a historical port.
Route by intent (task lifecycle)
| User need | Open |
|---|---|
| Task lifecycle Phase 4 routing | tasks + this testing skill |
| Test-first implementation / regression proof | references/tdd.md |
| Ship checklist + deploy gates | tasks + task-verifier + current deploy/runtime checks |
Decision tree (thin)
Goal
├─ Only choosing framework / layer / CI shape for a greenfield app → testing-layers.md
├─ External guides + subagent checklist → resource-hub.md
├─ This repo (Vitest, Playwright, npm scripts) → vitest.md / playwright.md
└─ Ship checklist + deploy gates → tasks + task-verifier + current deploy/runtime checks
Principles (always)
- Fast feedback first — unit + lint before heavy E2E.
- One golden runner per layer per repo; don't mix incompatible assertion styles.
- Flakes are defects — fix or quarantine; don't mask with infinite retries.
- Agentic loops need fresh context — long chains degrade quality; reset or compact between batches (workflow notes).
- LLM evals need frozen rubrics — version the judge prompt and golden set like code.
- Security "light sweeps" ≠ pentest — escalate real assurance to specialists.
Quick framework peek
| Layer | Typical tools |
|---|---|
| Unit | Vitest, Jest, JUnit, XCTest |
| Web UI | Playwright, Cypress |
| Mobile | Detox, Appium, Espresso, XCUITest |
| API | Supertest, REST Assured, contract checks |
Full table + workflows → testing-layers.md.
Resources in this folder
examples/— console logging, element discovery, static HTML automation snippetsscripts/with_server.py— wrap test runs around a dev servertemplates/— dogfood session templates
Skill composition note
Authored using the shared skill-authoring standard: thin SKILL.md, progressive disclosure via references/, explicit anti-triggers in YAML description.
04 同仓库更多 Skills
mde-pr-review-supabase
Use when reviewing MDE Supabase SQL, Auth and RLS changes in a pull request.
mde-pr-review-stripe
Use when reviewing MDE Stripe payments and webhooks changes in a pull request.
mde-pr-review-nextjs
Use when reviewing MDE Next.js App Router changes in a pull request.
mde-pr-review-mastra
Use when reviewing MDE Mastra agent, tool and workflow changes in a pull request.
mde-pr-review-maps
Use when reviewing MDE Google Maps and Places changes in a pull request.
mde-pr-review-copilotkit
Use when reviewing MDE CopilotKit and AG-UI changes in a pull request.