@be-link/smart-test 1.0.1-beta.2 → 1.0.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ai-assistant.d.ts","sourceRoot":"","sources":["../../src/core/ai-assistant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAC;AAI7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAuE7G"}
1
+ {"version":3,"file":"ai-assistant.d.ts","sourceRoot":"","sources":["../../src/core/ai-assistant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAC;AAI7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAgE7G"}
package/dist/index.esm.js CHANGED
@@ -114,8 +114,6 @@ async function aiReviewScreenshot(page, options) {
114
114
  const screenshot = await page.screenshot({
115
115
  fullPage: opts.fullPage !== false,
116
116
  });
117
- // 保存截图(如果启用)
118
- let screenshotPath;
119
117
  // 构建 AI 请求
120
118
  const prompt = buildPrompt(opts.expected);
121
119
  const openai = new OpenAI({
@@ -146,18 +144,14 @@ async function aiReviewScreenshot(page, options) {
146
144
  // 解析 AI 响应
147
145
  const content = completion?.choices[0]?.message?.content || '';
148
146
  const result = parseAiResponse(content);
149
- return {
150
- ...result,
151
- screenshotPath,
152
- rawResponse: content,
153
- };
147
+ return { ...result, rawResponse: content };
154
148
  }
155
149
  catch (error) {
156
150
  console.error('[smart-test] AI 检查失败:', error);
157
151
  return {
158
152
  ok: true,
159
153
  skipped: true,
160
- reason: `AI 检查失败: ${error instanceof Error ? error.message : String(error)}`,
154
+ reason: `[smart-test] AI 检查失败: ${error instanceof Error ? error.message : String(error)}`,
161
155
  };
162
156
  }
163
157
  }
package/dist/index.js CHANGED
@@ -116,8 +116,6 @@ async function aiReviewScreenshot(page, options) {
116
116
  const screenshot = await page.screenshot({
117
117
  fullPage: opts.fullPage !== false,
118
118
  });
119
- // 保存截图(如果启用)
120
- let screenshotPath;
121
119
  // 构建 AI 请求
122
120
  const prompt = buildPrompt(opts.expected);
123
121
  const openai$1 = new openai.OpenAI({
@@ -148,18 +146,14 @@ async function aiReviewScreenshot(page, options) {
148
146
  // 解析 AI 响应
149
147
  const content = completion?.choices[0]?.message?.content || '';
150
148
  const result = parseAiResponse(content);
151
- return {
152
- ...result,
153
- screenshotPath,
154
- rawResponse: content,
155
- };
149
+ return { ...result, rawResponse: content };
156
150
  }
157
151
  catch (error) {
158
152
  console.error('[smart-test] AI 检查失败:', error);
159
153
  return {
160
154
  ok: true,
161
155
  skipped: true,
162
- reason: `AI 检查失败: ${error instanceof Error ? error.message : String(error)}`,
156
+ reason: `[smart-test] AI 检查失败: ${error instanceof Error ? error.message : String(error)}`,
163
157
  };
164
158
  }
165
159
  }
@@ -0,0 +1,47 @@
1
+ import type { NetworkRequest, HARData } from './types';
2
+ /**
3
+ * HAR 转换器
4
+ */
5
+ export declare class HARConverter {
6
+ /**
7
+ * 将网络请求转换为 HAR 格式
8
+ */
9
+ toHAR(requests: NetworkRequest[]): HARData;
10
+ /**
11
+ * 将单个请求转换为 HAR 条目
12
+ */
13
+ private requestToHAREntry;
14
+ /**
15
+ * 保存 HAR 文件
16
+ */
17
+ saveHAR(requests: NetworkRequest[], outputPath: string): Promise<string>;
18
+ /**
19
+ * 从 HAR 生成 Mock 数据对象
20
+ */
21
+ generateMockData(requests: NetworkRequest[]): Record<string, any>;
22
+ /**
23
+ * 提取 API 路径(去除域名和查询参数)
24
+ */
25
+ private extractApiPath;
26
+ /**
27
+ * 生成 Mock 数据的 key
28
+ */
29
+ private generateMockKey;
30
+ /**
31
+ * 生成 Playwright Mock 代码
32
+ */
33
+ generateMockCode(requests: NetworkRequest[], pageName: string): string;
34
+ /**
35
+ * 生成 URL 匹配模式
36
+ */
37
+ private generateUrlPattern;
38
+ /**
39
+ * 首字母大写
40
+ */
41
+ private capitalize;
42
+ /**
43
+ * 保存 Mock 代码
44
+ */
45
+ saveMockCode(requests: NetworkRequest[], outputPath: string, pageName: string): Promise<string>;
46
+ }
47
+ //# sourceMappingURL=har-converter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"har-converter.d.ts","sourceRoot":"","sources":["../../src/recorder/har-converter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAY,MAAM,SAAS,CAAC;AAGjE;;GAEG;AACH,qBAAa,YAAY;IACvB;;OAEG;IACH,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO;IAiB1C;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA8BzB;;OAEG;IACG,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW9E;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAyCjE;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,eAAe;IAWvB;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IA2CtE;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAUtG"}
@@ -0,0 +1,67 @@
1
+ import type { Page } from '@playwright/test';
2
+ import type { PageElement } from './pom-generator';
3
+ import type { SmartTestConfig } from '../config/config-schema';
4
+ /**
5
+ * 操作建议类型
6
+ */
7
+ export interface ActionSuggestion {
8
+ id: string;
9
+ type: 'fill' | 'click' | 'select' | 'verify' | 'wait' | 'navigate' | 'finish';
10
+ element?: PageElement;
11
+ description: string;
12
+ value?: string;
13
+ priority: number;
14
+ reason?: string;
15
+ }
16
+ /**
17
+ * AI 交互式引导
18
+ */
19
+ export declare class InteractiveGuide {
20
+ private page;
21
+ private config;
22
+ private openai;
23
+ private pomGenerator;
24
+ private context;
25
+ constructor(page: Page, config: SmartTestConfig);
26
+ /**
27
+ * 启动交互式引导
28
+ */
29
+ start(): Promise<void>;
30
+ /**
31
+ * 分析页面当前上下文
32
+ */
33
+ private analyzePageContext;
34
+ /**
35
+ * 生成操作建议
36
+ */
37
+ private generateSuggestions;
38
+ /**
39
+ * 构建 AI 提示词
40
+ */
41
+ private buildSuggestionsPrompt;
42
+ /**
43
+ * 生成基础建议(不使用 AI)
44
+ */
45
+ private generateBasicSuggestions;
46
+ /**
47
+ * 获取基础建议描述
48
+ */
49
+ private getBasicSuggestionDescription;
50
+ /**
51
+ * 展示建议并获取用户选择
52
+ */
53
+ private displaySuggestions;
54
+ /**
55
+ * 获取优先级图标
56
+ */
57
+ private getPriorityIcon;
58
+ /**
59
+ * 执行操作
60
+ */
61
+ private executeAction;
62
+ /**
63
+ * 获取执行的操作历史
64
+ */
65
+ getExecutedActions(): ActionSuggestion[];
66
+ }
67
+ //# sourceMappingURL=interactive-guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-guide.d.ts","sourceRoot":"","sources":["../../src/recorder/interactive-guide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI/D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC9E,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD;;GAEG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,MAAM;IANhB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,OAAO,CAAe;gBAGpB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,eAAe;IAoBjC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C5B;;OAEG;YACW,kBAAkB;IAehC;;OAEG;YACW,mBAAmB;IA+DjC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAqC9B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAoChC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAgBrC;;OAEG;YACW,kBAAkB;IAqDhC;;OAEG;IACH,OAAO,CAAC,eAAe;IAOvB;;OAEG;YACW,aAAa;IA2D3B;;OAEG;IACH,kBAAkB,IAAI,gBAAgB,EAAE;CAGzC"}
@@ -0,0 +1,44 @@
1
+ import { type Page } from '@playwright/test';
2
+ import type { NetworkRequest, RecordOptions } from './types';
3
+ /**
4
+ * 网络请求录制器
5
+ */
6
+ export declare class NetworkRecorder {
7
+ private browser;
8
+ private context;
9
+ private page;
10
+ private requests;
11
+ /**
12
+ * 启动录制
13
+ */
14
+ start(options: RecordOptions): Promise<Page>;
15
+ /**
16
+ * 开始录制网络请求
17
+ */
18
+ private startRecording;
19
+ /**
20
+ * 判断是否应该录制该请求
21
+ */
22
+ private shouldRecordRequest;
23
+ /**
24
+ * 停止录制
25
+ */
26
+ stop(): Promise<NetworkRequest[]>;
27
+ /**
28
+ * 获取当前录制的请求
29
+ */
30
+ getRequests(): NetworkRequest[];
31
+ /**
32
+ * 获取页面实例
33
+ */
34
+ getPage(): Page | null;
35
+ /**
36
+ * 等待用户操作
37
+ */
38
+ waitForUserInteraction(timeout?: number): Promise<void>;
39
+ /**
40
+ * 显示录制统计
41
+ */
42
+ displayStats(): void;
43
+ }
44
+ //# sourceMappingURL=network-recorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-recorder.d.ts","sourceRoot":"","sources":["../../src/recorder/network-recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE3G,OAAO,KAAK,EAAE,cAAc,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AAG9E;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,QAAQ,CAAwB;IAExC;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA0ClD;;OAEG;IACH,OAAO,CAAC,cAAc;IAuDtB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAiBvC;;OAEG;IACH,WAAW,IAAI,cAAc,EAAE;IAI/B;;OAEG;IACH,OAAO,IAAI,IAAI,GAAG,IAAI;IAItB;;OAEG;IACG,sBAAsB,CAAC,OAAO,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCjE;;OAEG;IACH,YAAY,IAAI,IAAI;CAwBrB"}
@@ -0,0 +1,64 @@
1
+ import type { Page } from '@playwright/test';
2
+ import type { SmartTestConfig } from '../config/config-schema';
3
+ /**
4
+ * 页面元素信息
5
+ */
6
+ export interface PageElement {
7
+ /**
8
+ * 元素类型
9
+ */
10
+ type: 'input' | 'button' | 'link' | 'select' | 'textarea' | 'other';
11
+ /**
12
+ * 选择器
13
+ */
14
+ selector: string;
15
+ /**
16
+ * 元素描述(AI 生成或启发式)
17
+ */
18
+ description: string;
19
+ /**
20
+ * 元素属性
21
+ */
22
+ attributes: Record<string, string>;
23
+ /**
24
+ * 元素文本内容
25
+ */
26
+ text?: string;
27
+ }
28
+ /**
29
+ * Page Object Model 生成器
30
+ */
31
+ export declare class POMGenerator {
32
+ private config;
33
+ private openai;
34
+ constructor(config: SmartTestConfig);
35
+ /**
36
+ * 从页面提取元素信息
37
+ */
38
+ extractElements(page: Page): Promise<PageElement[]>;
39
+ /**
40
+ * 生成 Page Object 代码
41
+ */
42
+ generatePOM(pageName: string, pageUrl: string, elements: PageElement[]): Promise<string>;
43
+ /**
44
+ * 使用 AI 优化元素命名
45
+ */
46
+ private optimizeElementNames;
47
+ /**
48
+ * 生成基础 POM(无元素)
49
+ */
50
+ private generateBasicPOM;
51
+ /**
52
+ * 将描述转换为属性名
53
+ */
54
+ private toPropertyName;
55
+ /**
56
+ * 保存 POM 文件
57
+ */
58
+ savePOM(pomCode: string, outputPath: string, pageName: string): Promise<string>;
59
+ /**
60
+ * 首字母大写
61
+ */
62
+ private capitalize;
63
+ }
64
+ //# sourceMappingURL=pom-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pom-generator.d.ts","sourceRoot":"","sources":["../../src/recorder/pom-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAEpE;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,YAAY;IAGX,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,MAAM,CAAuB;gBAEjB,MAAM,EAAE,eAAe;IAW3C;;OAEG;IACG,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA0IzD;;OAEG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAiE9F;;OAEG;YACW,oBAAoB;IAqElC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUrF;;OAEG;IACH,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,35 @@
1
+ import type { NetworkRequest } from './types';
2
+ import type { SmartTestConfig } from '../config/config-schema';
3
+ /**
4
+ * AI 测试用例生成器
5
+ */
6
+ export declare class TestGenerator {
7
+ private config;
8
+ private openai;
9
+ constructor(config: SmartTestConfig);
10
+ /**
11
+ * 从录制数据生成测试用例
12
+ */
13
+ generateTest(url: string, pageName: string, requests: NetworkRequest[], mockFileName: string): Promise<string>;
14
+ /**
15
+ * 构建 AI 提示词
16
+ */
17
+ private buildPrompt;
18
+ /**
19
+ * 总结请求信息
20
+ */
21
+ private summarizeRequests;
22
+ /**
23
+ * 生成基础测试模板(不使用 AI)
24
+ */
25
+ private generateBasicTest;
26
+ /**
27
+ * 保存测试文件
28
+ */
29
+ saveTest(testCode: string, outputPath: string, pageName: string): Promise<string>;
30
+ /**
31
+ * 首字母大写
32
+ */
33
+ private capitalize;
34
+ }
35
+ //# sourceMappingURL=test-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-generator.d.ts","sourceRoot":"","sources":["../../src/recorder/test-generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;GAEG;AACH,qBAAa,aAAa;IAGZ,OAAO,CAAC,MAAM;IAF1B,OAAO,CAAC,MAAM,CAAuB;gBAEjB,MAAM,EAAE,eAAe;IAW3C;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA+CpH;;OAEG;IACH,OAAO,CAAC,WAAW;IA4BnB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA4BzB;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUvF;;OAEG;IACH,OAAO,CAAC,UAAU;CAGnB"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * 网络请求信息
3
+ */
4
+ export interface NetworkRequest {
5
+ /**
6
+ * 请求 URL
7
+ */
8
+ url: string;
9
+ /**
10
+ * HTTP 方法
11
+ */
12
+ method: string;
13
+ /**
14
+ * 请求头
15
+ */
16
+ headers: Record<string, string>;
17
+ /**
18
+ * POST 数据
19
+ */
20
+ postData?: string;
21
+ /**
22
+ * 请求时间戳
23
+ */
24
+ timestamp: number;
25
+ /**
26
+ * 响应数据
27
+ */
28
+ response?: NetworkResponse;
29
+ }
30
+ /**
31
+ * 网络响应信息
32
+ */
33
+ export interface NetworkResponse {
34
+ /**
35
+ * HTTP 状态码
36
+ */
37
+ status: number;
38
+ /**
39
+ * 响应头
40
+ */
41
+ headers: Record<string, string>;
42
+ /**
43
+ * 响应体
44
+ */
45
+ body: string;
46
+ /**
47
+ * 响应时间戳
48
+ */
49
+ timestamp: number;
50
+ }
51
+ /**
52
+ * HAR(HTTP Archive)格式
53
+ */
54
+ export interface HARData {
55
+ log: {
56
+ version: string;
57
+ creator: {
58
+ name: string;
59
+ version: string;
60
+ };
61
+ entries: HAREntry[];
62
+ };
63
+ }
64
+ /**
65
+ * HAR 条目
66
+ */
67
+ export interface HAREntry {
68
+ startedDateTime: string;
69
+ time: number;
70
+ request: {
71
+ method: string;
72
+ url: string;
73
+ headers: Array<{
74
+ name: string;
75
+ value: string;
76
+ }>;
77
+ postData?: {
78
+ mimeType: string;
79
+ text: string;
80
+ };
81
+ };
82
+ response: {
83
+ status: number;
84
+ headers: Array<{
85
+ name: string;
86
+ value: string;
87
+ }>;
88
+ content: {
89
+ mimeType: string;
90
+ text: string;
91
+ };
92
+ };
93
+ }
94
+ /**
95
+ * 录制配置
96
+ */
97
+ export interface RecordOptions {
98
+ /**
99
+ * 页面 URL
100
+ */
101
+ url: string;
102
+ /**
103
+ * 输出目录
104
+ */
105
+ output?: string;
106
+ /**
107
+ * 是否手动操作
108
+ */
109
+ manual?: boolean;
110
+ /**
111
+ * 是否交互式引导
112
+ */
113
+ interactive?: boolean;
114
+ /**
115
+ * 浏览器类型
116
+ */
117
+ browser?: 'chromium' | 'firefox' | 'webkit';
118
+ /**
119
+ * 视口大小
120
+ */
121
+ viewport?: {
122
+ width: number;
123
+ height: number;
124
+ };
125
+ /**
126
+ * 录制超时时间(秒)
127
+ */
128
+ timeout?: number;
129
+ }
130
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/recorder/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAChD,QAAQ,CAAC,EAAE;YACT,QAAQ,EAAE,MAAM,CAAC;YACjB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;KACH,CAAC;IACF,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAChD,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC;YACjB,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/smart-test",
3
- "version": "1.0.1-beta.2",
3
+ "version": "1.0.1-beta.3",
4
4
  "type": "module",
5
5
  "description": "AI-powered visual testing for Playwright - 基于 AI 视觉模型的 Playwright 测试工具",
6
6
  "homepage": "https://github.com/snowmountain-top/be-link",