import type { AuthConfig, VerifySpec } from './ui-verify/types'; export interface TestConfigTarget { url?: string; base_url?: string; router_file?: string; } export interface TestCase { name: string; type: 'smoke' | 'visual' | 'api'; routes?: string[]; scenarios?: string[]; /** v8.3.353+: 精细场景(VERIFY_SPEC scenarios 结构),透传冒烟引擎完整执行 22 种动作 + 9 种断言 */ verify_scenarios?: VerifySpec['scenarios']; threshold?: 'strict' | 'normal' | 'loose'; devices?: string[]; browsers?: string[]; } export interface VisualModelConfig { provider: 'qwen-vl' | 'openai' | 'anthropic' | 'local'; model?: string; apiKey?: string; endpoint?: string; timeout?: number; } export interface TestConfig { name?: string; target?: TestConfigTarget; endpoints?: Record; tests: TestCase[]; visual_model?: VisualModelConfig; output?: string; /** 测试登录配置(v8.3.215+):冒烟/视觉测试执行前自动登录 */ auth?: AuthConfig; } /** 加载测试场景配置文件(v8.3.122+: 自动识别两种格式) */ export declare function loadTestConfig(filePath: string): Promise; /** 解析 auth 配置对象(v8.3.215+),供测试配置与环境配置复用 */ export declare function parseAuthConfig(raw: Record): AuthConfig; /** * 解析登录凭据:环境变量优先,明文兜底(v8.3.215+) * * 若配置了 username_env/password_env,从 process.env 读取; * 否则回退到明文的 username/password。 */ export declare function resolveAuthCredentials(auth: AuthConfig | undefined): { username: string; password: string; } | null; /** * 冒烟登录账号装配结果(v8.3.216+) * * 用于「开发完成、即将冒烟」的时间点,把 auth 配置解析成明确的账号/密码, * 并生成「改了什么 / 缺什么」的清单告知用户(自动模式同样可见)。 */ export interface AuthResolutionInfo { /** 最终账号名(可能为空=未确定) */ username: string; /** 最终密码(可能为空=未确定) */ password: string; /** 账号名来源说明 */ usernameSource: string; /** 密码来源说明 */ passwordSource: string; /** 验证码装配说明(v8.3.354+,如「验证码自环境变量 SIT_SMS_CODE 注入」;无验证码块时为空) */ verificationNote?: string; /** 验证码是否已就绪(未配置验证码块时为 undefined;配置了但码源缺失时为 false) */ verificationReady?: boolean; /** 账号密码是否都已就绪(可执行登录) */ ready: boolean; /** 需要用户注意/处理的项 */ warnings: string[]; } /** * 描述冒烟登录账号的装配结果(v8.3.216+) * * 解析优先级: * - 账号:username_env 环境变量 > username 明文 > 需求文档「测试账号」章节提取 > 未配置 * - 密码:password_env 环境变量 > password 明文 > 未配置 * * 不写回配置文件(密码不进 git),只在冒烟前做内存装配 + 透明告知。 */ export declare function describeAuthResolution(auth: AuthConfig, testAccountHint?: string): AuthResolutionInfo; /** 合并环境配置中的测试参数 */ export declare function mergeTestConfigWithEnv(testConfig: TestConfig, envConfig?: { tests?: { base_urls?: Record; visual_model?: VisualModelConfig; auth?: AuthConfig; }; }): TestConfig; //# sourceMappingURL=test-config.d.ts.map