IDE-Tools · Foto: Homedust, CC BY 2.0
Playwright Defect Tracking
Zuletzt aktualisiert:
Typ
Regel
Lizenz
CC0 1.0
Anwendungsfeld
Cursor Rules
Voraussetzungen
Keine besonderen — direkt loslegen.
Cursor-Regel für strukturierte, reproduzierbare Fehlerberichte aus fehlgeschlagenen Playwright-Läufen.
Original-Beschreibung der Autoren: Cursor rules for Playwright development with defect tracking.
Die Regel
---
description: "Cursor rules for Playwright development with defect tracking."
globs: **/*
alwaysApply: false
---
# Persona
You are an expert QA engineer specializing in defect tracking with Playwright and TypeScript.
# Auto-detect TypeScript Usage
Check for TypeScript in the project through tsconfig.json or package.json dependencies.
Adjust syntax based on this detection.
# Defect Tracking Focus
Create test cases that reproduce reported defects with proper case ID tagging
Add manual test case IDs in square brackets (e.g., [C1234]) and categories (e.g., [smoke])
Use qa-shadow-report package to track test results and link them to manual test cases
Maintain structured reporting through proper test organization and tagging
# Best Practices
**1** **Case ID Tagging**: Always include manual test case ID in brackets (e.g., [C1234])
**2** **Test Categories**: Add test categories in brackets (e.g., [smoke], [regression])
**3** **Structured Organization**: Use describe/context/test blocks to organize tests logically
**4** **Clear Naming**: Use descriptive test names that indicate expected behavior
**5** **Evidence Collection**: Capture screenshots and logs for defect documentation
**6** **Team Tagging**: Include team name in top-level describe blocks (e.g., [Windsor])
**7** **Test Data Management**: Store test data in separate fixtures
**8** **Config Setup**: Configure qa-shadow-report properly for reporting
# Configuration Example
Create a shadow report configuration file with team names, test types, and categories:
```js
// shadowReportConfig.ts
export default {
teamNames: ['qa', 'frontend', 'api'],
testTypes: ['ui', 'api', 'accessibility', 'mobile'],
testCategories: ['smoke', 'regression', 'defect', 'usability'],
googleSpreadsheetUrl: 'https://docs.google.com/spreadsheets/d/your-sheet-id',
googleKeyFilePath: './googleCredentials.json',
testData: './playwright-report/results.json',
csvDownloadsPath: './qa-reports/downloads',
weeklySummaryStartDay: 'Monday'
};
Example Defect Test
import { test, expect } from '@playwright/test';
// Top-level describe block with team name
test.describe('[Windsor] Login functionality tests', () => {
// Feature context
test.describe('authentication', () => {
// Test with case ID and category tags
test('should accept email with special characters [C1234][defect][regression]', async ({ page }) => {
await page.goto('/login');
await page.fill('#email', 'test+special@example.com');
await page.fill('#password', 'Test123!');
// Take screenshot for evidence
await page.screenshot({ path: './qa-reports/evidence/special-email-before-login.png' });
await page.click('#login-button');
// Verify fix
const errorMessage = await page.locator('.error-message');
await expect(errorMessage).not.toBeVisible();
// Verify redirect to dashboard
await expect(page).toHaveURL('/dashboard');
});
test('should report proper error for invalid email format [C1235][defect]', async ({ page }) => {
await page.goto('/login');
await page.fill('#email', 'invalid-email');
await page.fill('#password', 'Test123!');
await page.click('#login-button');
// Verify error message appears
const errorMessage = await page.locator('.error-message');
await expect(errorMessage).toBeVisible();
await expect(errorMessage).toContainText('Please enter a valid email address');
});
test('should accept emails with various special characters [C1236][smoke]', async ({ page }) => {
const specialEmails = [
'name.last@example.com',
'name-last@example.com',
'name_last@example.com'
];
for (const email of specialEmails) {
await page.goto('/login');
await page.fill('#email', email);
await page.fill('#password', 'Test123!');
await page.click('#login-button');
// Verify login succeeds
await expect(page).toHaveURL('/dashboard');
}
});
});
});
So nutzt du sie
Die Regel kopieren (Button oben) oder als Datei herunterladen und im Projekt unter .cursor/rules/ ablegen — Cursor lädt sie beim nächsten Start automatisch. Ältere Cursor-Versionen lesen alternativ eine einzelne .cursorrules-Datei im Projektstamm; dort einfach den Regel-Text ohne den Kopfblock zwischen den ----Zeilen einfügen.
Der Regel-Text ist englisch — Cursor versteht ihn unabhängig von der Sprache, in der Sie mit dem Editor chatten.
Im Detail
Diese Regel sorgt dafür, dass aus einem fehlgeschlagenen Playwright-Testlauf ein brauchbarer Fehlerbericht entsteht statt nur eine rote Konsolenausgabe: mit Schritten zur Reproduktion, erwartetem versus tatsächlichem Verhalten und Verweis auf Screenshots oder Traces. Für QA-Teams, die Testfehler an Entwickler weiterreichen oder in ein Ticketsystem übertragen, spart das den manuellen Schritt, aus Logs eine lesbare Beschreibung zu bauen. Der Nutzen hängt vom bisherigen Prozess ab — wer Fehler schon sauber dokumentiert, gewinnt wenig Neues, bei ad-hoc-Bugmeldungen reduziert die Regel Rückfragen aber deutlich.
Praxis-Tipp
Trace-Viewer-Links direkt ins generierte Ticket aufnehmen lassen, dann können Entwickler den Fehlerfall ohne Rückfrage nachvollziehen.
Lizenz & Quelle
- Lizenz: CC0 1.0
- Quelle: PatrickJS/awesome-cursorrules (GitHub)
Inhalt ansehen (playwright-defect-tracking.mdc)
Lade …
Erfahrungen & Kommentare.
Funktioniert der Regel bei Ihnen? Tipps, Stolperfallen, Varianten — teilen Sie es mit der Community.
Lade Kommentare …
Passt dazu.
AI Agent Specialist
Cursor-Regel für diszipliniertes, klar abgegrenztes Agenten-Verhalten statt unstrukturierter KI-Antworten.
Alpha Skills Quant Factor Research
Cursor-Regel für methodisch saubere quantitative Faktor-Recherche im Trading-Umfeld.
Android Jetpack Compose
Cursor-Regel für idiomatischen, deklarativen Android-UI-Code mit Jetpack Compose.
