通过自然语言 AI 测试进行质量保证(QA)
AI 驱动的自然语言端到端测试框架。
您的浏览器不支持 video 标签。如果有帮助,这里有一个简短视频!
使用 shortest init 命令可以简化在新项目或现有项目中的设置流程。
shortest init 命令将:
npx @antiwork/shortest init这将:
@antiwork/shortest 包作为开发依赖(如果尚未安装)shortest.config.ts 文件,包含样板配置.env.local 文件(如果不存在),其中包含所需环境变量的占位符,例如 ANTHROPIC_API_KEY.env.local 和 .shortest/ 添加到 .gitignoreshortest.config.ts 中添加你的 Anthropic API 密钥:import type { ShortestConfig } from "@antiwork/shortest";
export default {
headless: false,
baseUrl: "http://localhost:3000",
browser: {
contextOptions: {
ignoreHTTPSErrors: true
},
},
testPattern: "**/*.test.ts",
ai: {
provider: "anthropic",
},
} satisfies ShortestConfig;Anthropic API 密钥默认使用 SHORTEST_ANTHROPIC_API_KEY / ANTHROPIC_API_KEY 环境变量。可以通过 ai.config.apiKey 覆盖。
(可选)您可以在配置文件中使用 browser.contextOptions 属性来配置浏览器行为。这允许您传递自定义的 Playwright 浏览器上下文选项。
app/login.test.tsimport { shortest } from "@antiwork/shortest";
shortest("Log暂无开放 Issues,或尚未同步最近议题。