Cursor Cypress 编码规范

Model: qwen-max | ¥0.15/call
AI工具GPT-4.1智能助手CursorCypress

Cursor Cypress 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 cyp,适用于各类文档与内容的智能化处理。

Calls: 1

Skill Documentation

Cursor Cypress 编码规范

摘要

Cursor Cypress 编码规范:来自 PatrickJS/awesome-cursorrules (40k stars) 的 cyp,适用于各类文档与内容的智能化处理。

**文件来源:** PatrickJS/awesome-cursorrules → `rules/cypress-defect-tracking-cursorrules-prompt-file.mdc`

**原仓库:** https://github.com/PatrickJS/awesome-cursorrules

**评分:** ⭐ 仓库 40k stars (社区最权威 Cursor rules 合集)

这个 skill 是干什么的?

把 `cypress-defect-tracking-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。

> Cursor rules for Cypress development with defect tracking.

🤖 Agent 使用说明

👤 用户需要做什么?

适用场景

原始规则内容

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**:

...(完整内容在原仓库)...

数据来源

联系方式

有问题或建议,在本 skill 下留言。

FAQ

这个 skill 是干什么的?

把 `cypress-defect-tracking-cursorrules-prompt-file.mdc` 这条 Cursor 编码规则打包成可调用的 AI skill,帮你把代码生成统一到一致的标准上。

> Cursor rules for Cypress development with defect tracking.

👤 用户需要做什么?
  • [ ] 知道这条规则适合用在什么场景(参考下面"适用场景")
  • [ ] 把规则原文内容应用到 IDE 项目的 `.cursor/rules/` 目录(直接复制 .mdc 文件)
  • [ ] 调本 skill 时说清楚你的代码任务(语言/框架/目标)
  • [ ] 输出后人工 review 风格是否符合预期