@tigerhill/core
v0.2.6
Published
TigerHill core library
Downloads
72
Readme
@tigerhill/core
TigerHill 核心库,提供资产加载、脚本生成、测试运行和修复管线功能。
主要功能
- 资产加载:加载 Spec、Case、Navigator (site-map.yaml)
- 脚本生成:从 Case 生成 Playwright 测试脚本
- Locator 验证:检测无效 locator 并自动转换
- 测试运行:封装 Playwright 执行并收集证据
- 修复管线:分析失败、生成候选修复、验证通过
安装
pnpm add @tigerhill/core使用
import { loadCase, generateScriptFromCase, runTest } from '@tigerhill/core';
// 加载 Case
const testCase = await loadCase('cases/ui/login/TC_LOGIN_001.case.yaml');
// 生成脚本
const script = generateScriptFromCase(testCase, 'http://localhost:3000');
// 运行测试
const result = await runTest({ scriptPath: 'scripts/ui/login/TC_LOGIN_001.spec.ts' });导出
详见 src/index.ts 中的导出列表。
