用途:该技能用于创建和维护验收测试套件,覆盖黄瓜(cucumber-js)与 behave 两个技术栈,并统一处理以规范为源(spec-as-source)的 Gherkin 规格。主要能力包括:从 openspec/specs 与 openspec/changes 下的 spec.md 中抽取 Gherkin 步骤,按 Markdown 标题结构合成 Feature、Rule、Scenario;在 acceptance-tests/ 中生成 .extracted 目录下的 .feature 文件;通过 cucumber-js 或 behave 执行有效规格与源规格回归;用共享的 gherkin-lint 与 .gherkin-lintrc 对抽取结果做 lint;并生成 HTML 报告。使用方式:技术栈在 openspec/config.yaml 中以 stack: 声明,可为 javascript 或 python;若缺失且存在 acceptance-tests/ 则据 cucumber.cjs 或 behave.ini 推断,否则需询问,不静默猜测。运行时先抽取后 lint,例如 node .agents/skills/acceptance-test-authoring/references/javascript/extract-gherkin.cjs openspec acceptance-tests/.extracted,再执行 npx gherkin-lint --config .agents/skills/acceptance-test-authoring/references/gherkin-lintrc.json acceptance-tests/.extracted;Python 抽取器为 python .agents/skills/acceptance-test-authoring/references/python/extract_gherkin.py openspec acceptance-tests/.extracted。步骤定义要求只调用页面对象与断言,选择器、正则与 URL 全部封装在页面对象内。限制:spec-as-source 为可选模式,未启用时不覆盖已有 OpenSpec 架构模板;.extracted/ 每次运行重建、不手工编辑;变更增量中被 MODIFIED/REMOVED 覆盖的源规则不得进入运行器也不得报告为跳过;归档改动不得执行;跨栈契约变更需先改共享契约并同步两栈实现。
acceptance-test-authoring
测试与质量
更新于 10-16 06:18