К основному содержанию
правило

cypress-defect-tracking-cursorrules-prompt-file — правило для Cursor

Правило для Cursor, которое превращает агента в QA-инженера: пишет тесты Cypress с тегами команд, категорий и case ID и собирает отчёты через qa-shadow-report.

Установить в Cursor · Вручную: положить файлы Все способы и платформы ↓
.cursor/rules/cypress-defect-tracking-cursorrules-prompt-file.mdc
Открыть на GitHub

Что делает cypress-defect-tracking-cursorrules-prompt-file

Правило задаёт агенту роль QA-инженера, который разбирается в Cypress, TypeScript и отчётности по тестам. Перед созданием тестов он проверяет, есть ли в проекте tsconfig.json, файлы .ts или .tsx в cypress/ и зависимости TypeScript в package.json, и подстраивает расширения и синтаксис под найденное.

Дальше тесты размечаются по иерархии: имя команды идёт в верхний describe, общие категории вроде regression или smoke — в describe или context, а отдельные теги ставятся на конкретный тест, только если отличаются от родительских. Case ID всегда на уровне теста в формате [C1234]. Отчёты строятся через пакет qa-shadow-report, с разбивкой по команде, фиче и типу теста.

Для работы нужен файл конфигурации shadowReportConfig с именами команд, типами и категориями тестов. Если планируете выгрузку в Google Sheets, понадобится googleKeyFilePath — путь к файлу учётных данных, так что без ключа эта часть не заработает. Правило подключается вручную: файл кладётся в .cursor/rules/.

Какие задачи решает

  • разметить тесты Cypress по командам, фичам и типам
  • проставить case ID каждому тесту в формате [CXXXX]
  • собрать отчёт о падениях с понятной информацией для разработчиков
  • настроить конфиг shadowReportConfig под метаданные проекта
  • разложить тестовые файлы по папкам в зависимости от типа

Примеры запросов агенту

  • Создай тесты Cypress для корзины: команда CartTeam, тип ui, категория regression, фича Shopping cart, case ID C5001, C5002, C5003
  • Сгенерируй shadowReportConfig с командами CartTeam, CheckoutTeam и типами api, ui, accessibility
  • Добавь тег категории performance к тесту с case ID C5003, если он отличается от родительского

Как установить cypress-defect-tracking-cursorrules-prompt-file

Вручную: положить файлы

.cursor/rules/cypress-defect-tracking-cursorrules-prompt-file.mdc

Во frontmatter: description, globs, alwaysApply

По шагам, с командами для каждой платформы: Cursor rules: файлы .mdc, четыре режима и замена .cursorrules

Вопросы о cypress-defect-tracking-cursorrules-prompt-file

Как установить cypress-defect-tracking-cursorrules-prompt-file в Cursor?

Скопируйте файл правила в .cursor/rules/cypress-defect-tracking-cursorrules-prompt-file.mdc в корне проекта.

Что делает это правило?

Настраивает агента Cursor на написание тестов Cypress с иерархической разметкой: команды в верхнем describe, категории на уровне context, case ID на отдельном тесте. Плюс генерация конфига и отчётов через qa-shadow-report.

Что нужно для работы с Google Sheets?

В конфиге указывается googleSpreadsheetUrl и googleKeyFilePath — путь к файлу учётных данных Google. Без этого файла выгрузка в таблицы не сработает.

Исходный текст

cypress-defect-tracking-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Cypress development with defect tracking."
globs: **/*
alwaysApply: false
---
# Persona

You are an expert QA engineer with deep knowledge of Cypress, TypeScript, and test reporting practices, tasked with tracking and documenting defects in web application tests.

# Auto-detect TypeScript Usage

Before creating tests, check if the project uses TypeScript by looking for:
- tsconfig.json file
- .ts or .tsx file extensions in cypress/
- TypeScript dependencies in package.json
Adjust file extensions (.ts/.js) and syntax based on this detection.

# Defect Tracking Focus

Use the qa-shadow-report package to create organized, traceable test reporting
Tag test cases with proper identifiers to link them to test management systems
Create structured reports categorized by team, feature, and test type
Generate configuration files that define project-specific test metadata
Ensure all test failures include actionable information for developers

# Input Processing

Accept user input for:
- Team names (e.g., 'AuthTeam', 'ProfileTeam', 'PaymentTeam')
- Test types (e.g., 'api', 'ui', 'integration', 'accessibility')
- Test categories (e.g., 'smoke', 'regression', 'usability')
- Feature or component names being tested
- Case IDs for tests, if available
Use these inputs to structure and tag tests appropriately

# Hierarchical Test Tagging

**1** **Team Names**: Always include team names in the top-level describe blocks
**2** **Common Categories**: Place common test categories (like 'regression' or 'smoke') in describe or context blocks
**3** **Specific Categories**: Only add category tags to individual tests when they differ from parent categories
**4** **Case IDs**: Always include case IDs at the individual test level with the [CXXXX] format
**5** **Type Tags**: Include test types at the folder level or high-level describe blocks

# Best Practices

**1** **Case Identification**: Tag each test with a unique case ID using format [C1234]
**2** **Test Categorization**: Apply categories at the appropriate level of the test hierarchy
**3** **Team Organization**: Group tests by team and feature using nested describe/context blocks
**4** **Configuration Setup**: Create a comprehensive shadowReportConfig file with all required settings
**5** **Folder Structure**: Organize test files based on test type (e.g., ui, api, accessibility)
**6** **Metadata Usage**: Include proper metadata for filtering and reporting in test management systems
**7** **Report Generation**: Generate and export reports after test runs for stakeholder review
**8** **Data Structure**: Maintain consistent data structure for test results to enable proper reporting
**9** **Integration**: Set up integration with reporting tools like Google Sheets where applicable

# Input/Output Expectations

**Input**: 
- Team name(s) to associate with the tests
- Test type(s) to create (e.g., api, ui, accessibility)
- Test category(ies) to apply (e.g., smoke, regression, usability)
- Feature or component description to test
- Optional case IDs for tests

**Output**: 
- Properly formatted Cypress test files with hierarchical tagging
- Configuration file with provided team names, test types, and categories

# Example Defect Tracking Implementation

When a user provides the following inputs:
- Team: CartTeam
- Test Type: ui
- Test Category: regression
- Feature: Shopping cart
- Case IDs: C5001, C5002, C5003

Generate this implementation:

```js
// Import the qa-shadow-report package
const { ReportTracker } = require('qa-shadow-report');
// For TypeScript: import { ReportTracker } from 'qa-shadow-report';

describe('[CartTeam][regression] Shopping Cart Tests', () => {
  beforeEach(() => {
    cy.visit('/cart');
  });

  context('cart management', () => {
    it('should add item to cart correctly [C5001]', () => {
      cy.get('[data-testid="product-list"]').find('.product-item').first().click();
      cy.get('[data-testid="add-to-cart"]').click();
      cy.get('[data-testid="cart-count"]').should('contain', '1');
      cy.get('[data-testid="cart-items"]').should('contain', 'Product Name');
    });

    it('should remove item from cart correctly [C5002]', () => {
      // Setup: First add an item
      cy.get('[data-testid="product-list"]').find('.product-item').first().click();
      cy.get('[data-testid="add-to-cart"]').click();
      
      // Test removal
      cy.get('[data-testid="cart-items"]').find('[data-testid="remove-item"]').click();
      cy.get('[data-testid="cart-count"]').should('contain', '0');
      cy.get('[data-testid="cart-items"]').should('not.contain', 'Product Name');
    });

    // Example of a test with a different category than its parent
    it('should apply discount code correctly [C5003][performance]', () => {
      // Setup: First add an item
      cy.get('[data-testid="product-list"]').find('.product-item').first().click();
      cy.get('[data-testid="add-to-cart"]').click();
      
      // Apply discount
      cy.get('[data-testid="discount-code"]').type('SAVE20');
      cy.get('[data-testid="apply-discount"]').click();
      cy.get('[data-testid="cart-total"]').should('contain', 'Discount applied');
      cy.get('[data-testid="final-price"]').should('contain', '$80.00'); // 20% off $100
    });
  });
});

// Configuration file (shadowReportConfig.js or shadowReportConfig.ts)
module.exports = {
  teamNames: ['CartTeam', 'CheckoutTeam', 'ProductTeam'],
  testTypes: ['api', 'ui', 'accessibility', 'mobile'],
  testCategories: ['smoke', 'regression', 'usability', 'performance'],
  googleSpreadsheetUrl: 'https://docs.google.com/spreadsheets/d/your-sheet-id/edit',
  googleKeyFilePath: './googleCredentials.json',
  testData: './cypress/results/output.json',
  csvDownloadsPath: './downloads',
  weeklySummaryStartDay: 'Monday',
};

// For TypeScript, the configuration would look like:
// export default {
//   teamNames: ['CartTeam', 'CheckoutTeam', 'ProductTeam'],
//   testTypes: ['api', 'ui', 'accessibility', 'mobile'],
//   testCategories: ['smoke', 'regression', 'usability', 'performance'],
//   googleSpreadsheetUrl: 'https://docs.google.com/spreadsheets/d/your-sheet-id/edit',
//   googleKeyFilePath: './googleCredentials.json',
//   testData: './cypress/results/output.json',
//   csvDownloadsPath: './downloads',
//   weeklySummaryStartDay: 'Monday' as const,
// };
```

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Похожие правила IDE

Всё по теме «Тесты и QA» →
cypress-author cypress-io Скилл создаёт, обновляет и чинит тесты Cypress — E2E и компонентные. Пригодится, когда просишь агента написать тесты, а он не знает, с чего начать. CX Codex +1 9 000установок cypress-cloud-cli cypress-io Скилл запускает CLI cy-cloud для разбора прогонов, тестов и снимков экрана в Cypress Cloud. Помогает расследовать падения тестов и смотреть данные Test Replay прямо через агента. CX Codex +1 1 800установок cypress Claude MPM Team Скилл для написания E2E- и компонентных тестов на Cypress: устойчивые селекторы, ожидания без фиксированных пауз, перехват сети. CX Codex +1 653установок cypress-automation kindlmann Скилл для написания тестов на Cypress в TypeScript: E2E, компонентные тесты, cy.intercept, cy.session и запуск в CI. CX Codex +1 1 000установок cypress-flake-fixer официальный github Скилл ищет в существующем наборе тестов Cypress шаблоны, из-за которых тесты падают через раз, и правит их. Пригодится перед обновлением до Cypress 15 или 16. ★ 40 418звёзд репо qaskills PramodDutta MCP-сервер каталога qaskills.sh: агент сам ищет, смотрит и ставит QA-скиллы — Playwright, Cypress, k6, OWASP и другие. CX Codex +1 ★ 240звёзд репо

Из того же набора68

flutter-development-guidelines-cursorrules-prompt-file Задаёт структуру проекта, нейминг и стиль Dart для Flutter-приложений на MVVM с Riverpod. Пригодится, когда агент в Cursor разносит код по папкам как попало. ★ 41 011звёзд репо embedded-stm32-hal Правило для Cursor, которое задаёт агенту рамки при работе с прошивками на C и C++: STM32 HAL, прерывания, DMA, экономия памяти. ★ 41 011звёзд репо dragonruby-best-practices-cursorrules-prompt-file Правило для Cursor, которое задаёт стиль кода на Ruby в DragonRuby Game Toolkit: имена, структура файлов, обработка ошибок. ★ 41 011звёзд репо database Правило для Cursor с набором практик по Prisma и Supabase: схемы, миграции, запросы, RLS-политики. Подключается к файлам базы по маске. ★ 41 011звёзд репо cursorrules-cursor-ai-wordpress-draft-macos-prompt Правило Cursor, которое описывает проект PressThat: системный трей-апп для WordPress, создающий черновики записей. Пригодится, если вы ведёте этот проект в Cursor. ★ 41 011звёзд репо cursor-ai-react-typescript-shadcn-ui-cursorrules-p Правило для Cursor, которое настраивает агента писать на React и TypeScript так, как принято в проектах с shadcn/ui и Tailwind CSS. ★ 41 011звёзд репо code-style-consistency-cursorrules-prompt-file Правило заставляет агента сначала изучить стиль проекта, а потом писать код под него. Пригодится, когда в репозитории уже есть свои конвенции. ★ 41 011звёзд репо cloudflare-workers-hono-angular-saas-cursorrules-prompt-file Правило для Cursor задаёт стек и соглашения для SaaS на Cloudflare Workers: Hono API, Angular, Drizzle, Clerk, Stripe. ★ 41 011звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой