@stv/page-test 1.0.0

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.
@@ -0,0 +1,102 @@
1
+ import { ActionRecorder } from '@page-agent/recorder';
2
+ import { AgentConfig } from '@page-agent/core';
3
+ import { ExportFormat } from '@page-agent/recorder';
4
+ import { IntentLabel } from '@page-agent/recorder';
5
+ import { PageAgentCore } from '@page-agent/core';
6
+ import { PageControllerConfig } from '@page-agent/page-controller';
7
+ import { Panel } from '@page-agent/ui';
8
+ import { PanelAgentAdapter } from '@page-agent/ui';
9
+ import { PanelConfig } from '@page-agent/ui';
10
+ import { RecordedEvent } from '@page-agent/recorder';
11
+ import { ReplayConfig } from '@page-agent/recorder';
12
+ import { ReplayResult } from '@page-agent/recorder';
13
+ import { TestReport } from '@page-agent/core';
14
+
15
+ export declare class PageAgent extends PageAgentCore {
16
+ panel: RecordingPanel;
17
+ recorder: ActionRecorder;
18
+ constructor(config: PageAgentConfig);
19
+ /**
20
+ * Start recording user interactions
21
+ */
22
+ startRecording(): void;
23
+ /**
24
+ * Stop recording and return captured events
25
+ */
26
+ stopRecording(): RecordedEvent[];
27
+ /**
28
+ * Export recording in specified format
29
+ */
30
+ exportRecording(format: ExportFormat): string;
31
+ /**
32
+ * Get recording status
33
+ */
34
+ getRecordingStatus(): {
35
+ isRecording: boolean;
36
+ eventCount: number;
37
+ };
38
+ /**
39
+ * Get all recorded events
40
+ */
41
+ getRecordedEvents(): RecordedEvent[];
42
+ /**
43
+ * Clear all recorded events
44
+ */
45
+ clearRecording(): void;
46
+ /**
47
+ * Get the recognized intent of the recording
48
+ */
49
+ getRecordingIntent(): IntentLabel | null;
50
+ /**
51
+ * Replay recorded events
52
+ * @param events - Optional events to replay (uses current recording if not provided)
53
+ * @param config - Optional replay configuration
54
+ */
55
+ replayRecording(events?: RecordedEvent[], config?: ReplayConfig): Promise<ReplayResult>;
56
+ /**
57
+ * Load events from a JSON file and replay them
58
+ * @param filePath - Path to the recording file
59
+ * @param config - Optional replay configuration
60
+ */
61
+ replayRecordingFile(filePath: string, config?: ReplayConfig): Promise<ReplayResult>;
62
+ generateTestDSL(description: string): Promise<string>;
63
+ runTest(dsl: string): Promise<TestReport>;
64
+ saveTestSpec(name: string, dsl: string): void;
65
+ loadTestSpecs(): {
66
+ name: string;
67
+ dsl: string;
68
+ }[];
69
+ }
70
+
71
+ export declare type PageAgentConfig = AgentConfig & PageControllerConfig & Omit<PanelConfig, 'language'>;
72
+
73
+ /**
74
+ * Extended Panel with recording functionality
75
+ *
76
+ * This class extends the base Panel class to add recording UI and logic.
77
+ * All recording functionality is isolated in this extension, keeping the base Panel clean.
78
+ */
79
+ export declare class RecordingPanel extends Panel {
80
+ #private;
81
+ constructor(agent: PanelAgentAdapter, config: RecordingPanelConfig);
82
+ /**
83
+ * Dispose panel and clean up event listeners
84
+ */
85
+ dispose(): void;
86
+ }
87
+
88
+ /**
89
+ * RecordingPanel configuration
90
+ */
91
+ declare interface RecordingPanelConfig extends Omit<PanelConfig, 'recorder'> {
92
+ recorder: ActionRecorder;
93
+ /** Callback to generate test DSL from natural language */
94
+ onGenerateTestDSL?: (description: string) => Promise<string>;
95
+ /** Callback to run test from DSL */
96
+ onRunTest?: (dsl: string) => Promise<TestReport>;
97
+ }
98
+
99
+
100
+ export * from "@page-agent/core";
101
+
102
+ export { }