PluginBench
Rule

playwright defect tracking

via PatrickJS/awesome-cursorrules

Playwright test framework with defect tracking, case ID tagging, and qa-shadow-report integration.

What is playwright defect tracking?

This rule configures Playwright tests to track defects with structured case IDs, team tags, and test categories. Use it when building QA test suites that need to link test cases to defect reports and maintain organized evidence collection through the qa-shadow-report package.

  • Auto-detect TypeScript configuration and adjust test syntax accordingly
  • Tag tests with manual case IDs (e.g., [C1234]) and categories (e.g., [smoke], [regression]) for defect tracking
  • Organize tests with team names in top-level describe blocks for team-based reporting
  • Capture screenshots and logs as evidence for defect documentation
  • Configure qa-shadow-report to link test results to manual test cases and generate structured reports
  • Structure test data in separate fixtures and organize tests with describe/context/test blocks

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

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:

// 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');
      }
    });
  });
});

Related rules

Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.

**/*
41k
via PatrickJS/awesome-cursorrules

Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.

**/*
41k
via PatrickJS/awesome-cursorrules

Android development with Jetpack Compose, clean architecture, and Material Design 3.

**/*
41k
via PatrickJS/awesome-cursorrules

Angular development with Novo Elements UI library using standalone components.

**/*
41k
via PatrickJS/awesome-cursorrules

Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.

**/*
41k
via PatrickJS/awesome-cursorrules

Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.

**/*.sh +5
41k
via PatrickJS/awesome-cursorrules