界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

quality-e2e-testing

quality-e2e-testing

【开发与工程】End-to-end testing skill using Playwright. Includes advanced mocking, network manipulation, and chaos engineering.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: quality-e2e-testing description: > End-to-end testing skill using Playwright. Includes advanced mocking, network manipulation, and chaos engineering. version: "2.0.0" author: "j4flmao" license: "MIT" type: skill compatibility: claude-code: true cursor: true codex: true windsurf: true tags:

  • testing
  • playwright
  • e2e

Quality E2E Testing

Purpose

Comprehensive end-to-end testing capabilities for robust applications. Includes Playwright, chaos engineering, and more.

Core Principles

  1. Determinism over speed.
  2. Isolate test states.
  3. Network layer is fully controlled.
  4. Assume nothing, test everything.
  5. Chaos engineering uncovers hidden limits.

Agent Protocol

  • Triggers: e2e test request
  • Input Context Required: application url, auth state
  • Output Artifact: test report
  • Response Formats:
{ "status": "pass", "coverage": "90%" }

Decision Matrix

[E2E Request]
    |
    v
 Is local? ---> (Yes) -> Run headless Playwright
    |
   (No) -> Run in container

Detailed Architectural Overview

[Browser] <--> [Playwright] <--> [Test Runner]

Lifecycle:
Init -> Setup State -> Execute -> Teardown

Workflow Steps

Phase 1: Setup

  1. Init browser
  2. Load state
  3. Route mock
  4. Wait ready

Phase 2: Execution

  1. Navigate
  2. Interact
  3. Assert
  4. Cleanup

Phase 3: Chaos

  1. Drop packets
  2. Throttle CPU
  3. Assert recovery
  4. Analyze

Phase 4: Reporting

  1. Collect traces
  2. Generate HTML
  3. Upload artifacts
  4. Alert

Phase 5: Cleanup

  1. Close browser
  2. Clean state
  3. Notify
  4. End

Phase 6: Analysis

  1. Parse logs
  2. Find flakiness
  3. Update metrics
  4. Store

Extended Troubleshooting Guide

SymptomPrimary CauseMitigation Action
TimeoutNetwork slowIncrease timeout
FlakyAsync raceUse waitForSelector
No AuthBad tokenRefresh session
CrashOOMIncrease memory limit
Element not foundDOM changedUpdate locators
Blank pageJS errorCheck console logs

Complete Execution Scenario

Start -> Mock -> Test -> Success -> End

Rules and Guidelines

  1. No arbitrary waits.
  2. Always mock external APIs.
  3. Keep tests isolated.
  4. Clean up after each test.
  5. Use page object model.

Reference Guides

Handoff

See ci-integration for pipelines.

我的收藏