Collect-UI 测试用例生成指南

Generate and validate JSON test cases for collect-ui components.

1|1|Updated Dec 31, 2024
One-click install
npx skills add https://github.com/collect-ui/collect-ui --skill collect-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Collect-UI 测试用例生成指南
Source: https://github.com/collect-ui/collect-ui/tree/main/.opencode/skill/collect-ui-error-solution
Command: npx skills add https://github.com/collect-ui/collect-ui --skill collect-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Collect-UI 在测试场景中经常需要大量符合严格 JSON 规范的测试用例。本技能提供一个系统化的指南和流程,帮助团队快速生成、验证并修复 JSON 测试用例,减少格式错误和结构偏差。

Core Features & Use Cases

  • 标准化流程:提供生成测试用例的步骤、检查清单和错误场景的系统化处理。
  • 结构正确性保障:强调键名必须带引号、children 必须是数组、变量引用要符合规范等要点。
  • 验证与示例:包含示例模板、常见错误速查表以及通过 jsonlint 的自动校验流程,适用于 demo、test 数据等场景。
  • Use Case: QA 或自动化工程师在为 collect-ui 组件编写测试用例时,能够快速创建并验证 JSON 配置,确保上线前的稳定性。

Quick Start

  1. 阅读并遵守指南中的规则,创建新的测试用例 JSON 文件在 demo/data/test/ 目录下; 2) 使用 jsonlint 进行格式验证,例如 npx jsonlint your-file.json; 3) 在应用中注册并加载测试用例,确保路由和数据绑定无误。

Frequently Asked Questions about Collect-UI 测试用例生成指南

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate JSON test cases for UI configurations?

You validate JSON test cases for UI configurations by running them through jsonlint to detect syntax errors, ensuring quoted keys, array-based children, and proper template syntax. This automated validation process enforces strict JSON rules before loading demo and test data.

What is the best way to generate lint-ready JSON for UI components?

The best way to generate lint-ready JSON for UI components is to follow a standardized process that enforces explicit JSON rules such as quoted keys and array-based children. This produces correct, structurally valid test data ready for immediate validation with jsonlint.

How do I fix common JSON syntax errors in UI test data?

To fix common JSON syntax errors in UI test data, you use a validation tool like jsonlint to identify failures and then apply rules such as quoting all keys, making children arrays, and correcting template syntax. An error quick-reference checklist guides the repair process.

Where should I place JSON test case files for UI demo workflows?

You should place JSON test case files for UI demo workflows in the demo/data/test/ directory. After creating the files there, you run jsonlint for format validation and then register and load the test cases in the application to verify routing and data binding.

Does jsonlint work for validating collect-ui component test cases?

Yes, jsonlint works for validating collect-ui component test cases by detecting structural and syntax errors. It verifies that your generated JSON configurations meet strict formatting rules, ensuring the test data is correct and stable before application deployment.

Why does my JSON test case fail validation when using template variables?

Your JSON test case fails validation when using template variables because the syntax does not conform to strict JSON rules. You must ensure proper template syntax, quote all keys, and structure children as arrays to pass jsonlint validation for your UI configurations.