skills/e2e-testing/SKILL.md
# E2E Testing Skill ## Trigger - Keywords: `teste`, `e2e`, `playwright`, `browser test`, `visual test`, `smoke test` - Aufruf: `/e2e-test [suite] [--flags]` ## Beschreibung Automatisierter E2E-Test mit menschlichem Verhalten für Preview und Production. Nutzt Chrome MCP oder Playwright MCP für Browser-Automatisierung. ## Test-Suiten | Suite | Dauer | Beschreibung | | ---------- | ----- | --------------------------------------------- | | `smoke` | 30s
npx skillsauth add svenja-dev/claude-code-skills skills/e2e-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
teste, e2e, playwright, browser test, visual test, smoke test/e2e-test [suite] [--flags]Automatisierter E2E-Test mit menschlichem Verhalten für Preview und Production. Nutzt Chrome MCP oder Playwright MCP für Browser-Automatisierung.
| Suite | Dauer | Beschreibung |
| ---------- | ----- | --------------------------------------------- |
| smoke | 30s | Login, Upload, Basis-UI (Default bei "teste") |
| full | 5min | Alle P0+P1 Szenarien |
| visual | 2min | Nur Screenshot-Vergleiche |
| upload | 1min | Alle Dateiformate |
| download | 2min | Export-Funktionen |
| login | 30s | Auth Flow |
| api | 1min | API-Endpoint Tests |
| Flag | Beschreibung |
| -------------------- | -------------------------------------- |
| --preview | Nur localhost testen |
| --production | Nur Production-URL testen |
| --quick | Nur P0-Szenarien (schnellster Test) |
| --human | Chrome MCP mit echtem Browser |
| --headless | Playwright MCP headless (CI/CD) |
| --update-baselines | Screenshot-Baselines aktualisieren |
| --mobile | Mobile Viewports testen (375px, 768px) |
1. UMGEBUNGS-CHECK
- Prüfe ob localhost läuft (curl/fetch)
- Prüfe ob Production-URL erreichbar
- Wähle Test-Umgebung basierend auf Flags
2. BROWSER-SETUP
- Wenn --human: Nutze Chrome MCP (mcp__claude-in-chrome__)
- Sonst: Nutze Playwright MCP (mcp__playwright__)
- Viewport: 1280x720 (Desktop) oder 375x667 (Mobile)
3. HUMAN BEHAVIOR AKTIVIEREN
- Randomisierte Delays: 200-800ms zwischen Aktionen
- Typing-Speed: 50-150ms pro Taste
- Hover vor Click (200-500ms Pause)
- Smooth Scroll statt instant
4. TEST-SUITE AUSFÜHREN
- Für jeden Test: Screenshot vorher/nachher
- Bei Fehler: Screenshot + Console Logs speichern
- Download-Verifizierung: Dateigröße prüfen
5. REPORT GENERIEREN
- Markdown-Report in .playwright-mcp/reports/
- Diff-Images bei visuellen Abweichungen
- Zusammenfassung mit Pass/Fail/Flaky Status
- Navigiere zu URL
- Warte auf Hauptelement sichtbar
- Prüfe Logo/Branding sichtbar
- Screenshot: landing-page.png
- Klicke auf Login Button
- Warte auf Modal/Page-Animation
- Prüfe Auth-Optionen sichtbar (OAuth, Email, etc.)
- Screenshot: login-modal.png
- Finde Language Toggle
- Klicke mit Human Delay
- Warte auf Text-Änderung
- Verifiziere UI-Texte geändert
- Screenshot: language-toggle.png
- Klicke auf Upload-Bereich
- Wähle Testdatei
- Warte auf Bestätigung
- Prüfe Dateiname angezeigt
- Screenshot: file-uploaded.png
- Führe primäre App-Funktion aus
- Warte auf Loading-State
- Warte auf Ergebnis (max 60s)
- Prüfe Ergebnis-Inhalt vorhanden
- Screenshot: result.png
- Klicke Download Button
- Warte auf Download-Event
- Verifiziere Dateiformat korrekt
- Verifiziere Dateigröße > Minimum
- Screenshot: download-complete.png
- Klicke auf Navigation-Element
- Warte auf Animation
- Prüfe korrekter Content geladen
- Finde Theme-Toggle
- Notiere aktuelle Farben
- Klicke Toggle
- Verifiziere Farben geändert
- Screenshot: theme-toggle.png
- Setze Viewport auf 375x667
- Prüfe Mobile-Navigation sichtbar
- Prüfe Hauptfunktionen erreichbar
- Screenshot: mobile-view.png
- Provoziere Fehler (ungültige Eingabe)
- Warte auf Error-Message
- Prüfe Error ist benutzerfreundlich
- Screenshot: error-state.png
// Randomisierter Delay (200-800ms)
async function humanDelay() {
const delay = 200 + Math.random() * 600;
await page.waitForTimeout(delay);
}
// Menschliches Tippen (50-150ms pro Taste)
async function humanType(selector: string, text: string) {
await page.click(selector);
await humanDelay();
for (const char of text) {
await page.keyboard.type(char);
await page.waitForTimeout(50 + Math.random() * 100);
}
}
// Hover -> Pause -> Click Pattern
async function humanClick(selector: string) {
await page.hover(selector);
await page.waitForTimeout(200 + Math.random() * 300);
await page.click(selector);
await humanDelay();
}
// Smooth Scroll
async function humanScroll(pixels: number) {
await page.evaluate((px) => {
window.scrollTo({ top: px, behavior: "smooth" });
}, pixels);
await page.waitForTimeout(500);
}
## E2E Test Report - [DATUM] [UHRZEIT]
### Umgebung
- **URL**: [getestete URL]
- **Browser**: Chromium [version]
- **Viewport**: 1280x720
- **Suite**: smoke
### Ergebnisse
| # | Test | Status | Dauer | Screenshot |
| --- | ----------------- | ------- | ----- | ----------------------- |
| 1 | Landing Page Load | PASS | 0.8s | [view](landing-page.png)|
| 2 | Login Modal | PASS | 1.2s | [view](login-modal.png) |
| 3 | File Upload | PASS | 2.1s | [view](file-uploaded.png)|
| 4 | Main Action | SLOW | 45.2s | [view](result.png) |
| 5 | Download | FAIL | 3.4s | [view](error.png) |
### Zusammenfassung
- **Gesamt**: N Tests
- **Passed**: X (Y%)
- **Failed**: A (B%)
- **Slow/Flaky**: C (D%)
- **Dauer**: Zs
.playwright-mcp/
├── baselines/ # Goldene Referenz (git-tracked)
│ ├── landing-page-desktop.png
│ ├── landing-page-mobile.png
│ ├── login-modal.png
│ ├── result.png
│ └── error-state.png
├── current/ # Aktuelle Screenshots (gitignored)
├── diffs/ # Pixel-Differenzen (gitignored)
└── reports/ # Test-Reports (gitignored)
User: "teste"
-> Führt smoke-Suite auf verfügbarer Umgebung aus
User: "teste upload"
-> Führt nur Upload-Suite aus
User: "teste production visual"
-> Führt Visual-Suite auf Production aus
User: "teste --quick --human"
-> Schnelltest mit echtem Chrome Browser
User: "teste --headless --full"
-> Alle Tests headless für Pipeline
Localhost nicht erreichbar:
Production nicht erreichbar:
Test-Timeout (>60s):
Visueller Diff erkannt:
Optionale .e2e-config.json im Projekt-Root:
{
"previewUrl": "http://localhost:5173",
"productionUrl": "https://your-app.com",
"defaultSuite": "smoke",
"timeouts": {
"navigation": 10000,
"action": 60000,
"download": 30000
},
"viewports": {
"desktop": { "width": 1280, "height": 720 },
"tablet": { "width": 768, "height": 1024 },
"mobile": { "width": 375, "height": 667 }
},
"humanBehavior": {
"enabled": true,
"minDelay": 200,
"maxDelay": 800,
"typingSpeed": { "min": 50, "max": 150 }
},
"screenshots": {
"onEveryStep": false,
"onFailure": true,
"fullPage": false
}
}
package.json.e2e-config.json für Projekt-KonfigurationDresden AI Insights - https://dresdenaiinsights.com
development
Protects design and theme files from unintended changes. Locks tailwind.config, global CSS, and theme variables. Requires explicit confirmation before modifying UI components. Activate on changes to CSS, theme config, or layout components.
tools
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.
development
Erzwingt striktes Test-Driven Development mit Red-Green-Refactor Zyklus. Blockiert Code-Generierung ohne vorherige Tests. Dokumentiert 13 ungueltige Rationalisierungen. Aktivieren bei neuen Features, Bug Fixes, Refactoring.
development
Enforces TypeScript best practices when writing code. Automatically enables strict typing for TypeScript projects, prevents `any` usage, and recommends generic constraints. Activate on TS/TSX files, new features, code reviews.