@wdio/selenium-devtools 0.0.1 → 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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +15 -15
  3. package/dist/assertPatcher.d.ts +0 -11
  4. package/dist/assertPatcher.js +0 -123
  5. package/dist/assertPatcher.js.map +0 -1
  6. package/dist/bidi.d.ts +0 -6
  7. package/dist/bidi.js +0 -222
  8. package/dist/bidi.js.map +0 -1
  9. package/dist/constants.d.ts +0 -75
  10. package/dist/constants.js +0 -146
  11. package/dist/constants.js.map +0 -1
  12. package/dist/driverPatcher.d.ts +0 -4
  13. package/dist/driverPatcher.js +0 -256
  14. package/dist/driverPatcher.js.map +0 -1
  15. package/dist/helpers/detachedBackend.d.ts +0 -7
  16. package/dist/helpers/detachedBackend.js +0 -34
  17. package/dist/helpers/detachedBackend.js.map +0 -1
  18. package/dist/helpers/runtime.d.ts +0 -3
  19. package/dist/helpers/runtime.js +0 -47
  20. package/dist/helpers/runtime.js.map +0 -1
  21. package/dist/helpers/suiteManager.d.ts +0 -19
  22. package/dist/helpers/suiteManager.js +0 -131
  23. package/dist/helpers/suiteManager.js.map +0 -1
  24. package/dist/helpers/testManager.d.ts +0 -47
  25. package/dist/helpers/testManager.js +0 -158
  26. package/dist/helpers/testManager.js.map +0 -1
  27. package/dist/helpers/utils.d.ts +0 -26
  28. package/dist/helpers/utils.js +0 -187
  29. package/dist/helpers/utils.js.map +0 -1
  30. package/dist/helpers/videoEncoder.d.ts +0 -2
  31. package/dist/helpers/videoEncoder.js +0 -89
  32. package/dist/helpers/videoEncoder.js.map +0 -1
  33. package/dist/index.d.ts +0 -15
  34. package/dist/index.js +0 -801
  35. package/dist/index.js.map +0 -1
  36. package/dist/reporter.d.ts +0 -18
  37. package/dist/reporter.js +0 -72
  38. package/dist/reporter.js.map +0 -1
  39. package/dist/rerunManager.d.ts +0 -8
  40. package/dist/rerunManager.js +0 -78
  41. package/dist/rerunManager.js.map +0 -1
  42. package/dist/runnerHooks.d.ts +0 -6
  43. package/dist/runnerHooks.js +0 -594
  44. package/dist/runnerHooks.js.map +0 -1
  45. package/dist/screencast.d.ts +0 -11
  46. package/dist/screencast.js +0 -179
  47. package/dist/screencast.js.map +0 -1
  48. package/dist/session.d.ts +0 -48
  49. package/dist/session.js +0 -480
  50. package/dist/session.js.map +0 -1
  51. package/dist/setupConsole.d.ts +0 -1
  52. package/dist/setupConsole.js +0 -13
  53. package/dist/setupConsole.js.map +0 -1
  54. package/dist/types.d.ts +0 -235
  55. package/dist/types.js +0 -5
  56. package/dist/types.js.map +0 -1
package/dist/types.d.ts DELETED
@@ -1,235 +0,0 @@
1
- export interface DevToolsOptions {
2
- port?: number;
3
- hostname?: string;
4
- /** Open a Chrome window pointing at the UI. Default true. */
5
- openUi?: boolean;
6
- /** Capture screenshots after each command. Default true. */
7
- captureScreenshots?: boolean;
8
- /** Command template for per-test rerun. {{testName}} is substituted. */
9
- rerunCommand?: string;
10
- /** Per-session screencast recording. Disabled by default. */
11
- screencast?: ScreencastOptions;
12
- /**
13
- * Force the *test* browser into headless mode by injecting --headless=new
14
- * into Chrome capabilities. The dashboard window (auto-opened by openUi)
15
- * is unaffected. Defaults to false to preserve user-supplied options.
16
- */
17
- headless?: boolean;
18
- }
19
- export interface ScreencastFrame {
20
- /** Base64-encoded image data — JPEG/PNG. */
21
- data: string;
22
- /** Unix timestamp in milliseconds. */
23
- timestamp: number;
24
- }
25
- export interface ScreencastOptions {
26
- /** Enable screencast recording for this session (default: false). */
27
- enabled?: boolean;
28
- /** Image format for individual frames (default: 'jpeg'). Chromium-only. */
29
- captureFormat?: 'jpeg' | 'png';
30
- /** JPEG quality 0–100 (default: 70). Chromium-only. */
31
- quality?: number;
32
- /** Max frame width in px Chrome sends over CDP (default: 1280). Chromium-only. */
33
- maxWidth?: number;
34
- /** Max frame height in px Chrome sends over CDP (default: 720). Chromium-only. */
35
- maxHeight?: number;
36
- /**
37
- * Polling interval for non-Chromium fallback (default: 200 ms).
38
- * Used when CDP isn't available — calls driver.takeScreenshot() at this rate.
39
- */
40
- pollIntervalMs?: number;
41
- }
42
- export interface CommandLog {
43
- command: string;
44
- args: any[];
45
- result?: any;
46
- error?: {
47
- name: string;
48
- message: string;
49
- stack?: string;
50
- };
51
- timestamp: number;
52
- callSource?: string;
53
- screenshot?: string;
54
- testUid?: string;
55
- performance?: PerformanceData;
56
- cookies?: string;
57
- documentInfo?: DocumentInfo;
58
- id?: number;
59
- }
60
- export interface PerformanceData {
61
- navigation?: {
62
- url: string;
63
- timing: {
64
- loadTime?: number;
65
- domReady?: number;
66
- responseTime?: number;
67
- dnsLookup?: number;
68
- tcpConnection?: number;
69
- serverResponse?: number;
70
- };
71
- };
72
- resources?: Array<{
73
- url: string;
74
- duration: number;
75
- size: number;
76
- type: string;
77
- startTime: number;
78
- responseEnd: number;
79
- }>;
80
- }
81
- export interface DocumentInfo {
82
- url: string;
83
- title: string;
84
- headers: {
85
- userAgent: string;
86
- language: string;
87
- platform: string;
88
- };
89
- documentInfo: {
90
- readyState: string;
91
- referrer: string;
92
- characterSet: string;
93
- };
94
- }
95
- export type LogLevel = 'trace' | 'debug' | 'log' | 'info' | 'warn' | 'error';
96
- export interface ConsoleLog {
97
- timestamp: number;
98
- type: LogLevel;
99
- args: any[];
100
- source: string;
101
- }
102
- export interface TestStats {
103
- uid: string;
104
- cid: string;
105
- title: string;
106
- fullTitle: string;
107
- parent: string;
108
- state: 'passed' | 'failed' | 'skipped' | 'pending' | 'running';
109
- start: Date;
110
- end: Date | null;
111
- type: 'test';
112
- file: string;
113
- retries: number;
114
- _duration: number;
115
- error?: {
116
- name: string;
117
- message: string;
118
- stack?: string;
119
- };
120
- hooks?: any[];
121
- callSource?: string;
122
- }
123
- export interface SuiteStats {
124
- uid: string;
125
- cid: string;
126
- title: string;
127
- fullTitle: string;
128
- type: 'suite';
129
- file: string;
130
- start: Date;
131
- state?: 'pending' | 'running' | 'passed' | 'failed' | 'skipped';
132
- end?: Date | null;
133
- tests: (string | TestStats)[];
134
- suites: SuiteStats[];
135
- hooks: any[];
136
- _duration: number;
137
- parent?: string;
138
- callSource?: string;
139
- }
140
- export declare enum TraceType {
141
- Testrunner = "testrunner"
142
- }
143
- export interface Metadata {
144
- type: TraceType;
145
- url?: string;
146
- options?: any;
147
- capabilities?: any;
148
- viewport?: any;
149
- }
150
- export interface NetworkRequest {
151
- id: string;
152
- url: string;
153
- method: string;
154
- status?: number;
155
- statusText?: string;
156
- timestamp: number;
157
- startTime: number;
158
- endTime?: number;
159
- time?: number;
160
- type: string;
161
- requestHeaders?: Record<string, string>;
162
- responseHeaders?: Record<string, string>;
163
- size?: number;
164
- error?: string;
165
- }
166
- /**
167
- * Minimal shape of a selenium-webdriver `WebDriver` instance that the plugin
168
- * relies on. We don't import the type from selenium-webdriver to avoid a hard
169
- * dependency on the user's installed version — Selenium types vary across
170
- * minor versions and we only touch a small surface.
171
- */
172
- export interface SeleniumDriverLike {
173
- executeScript: (script: string | Function, ...args: any[]) => Promise<any>;
174
- takeScreenshot?: () => Promise<string>;
175
- getSession?: () => Promise<{
176
- getId: () => string;
177
- }>;
178
- getCapabilities?: () => Promise<any>;
179
- manage?: () => any;
180
- quit?: () => Promise<void>;
181
- close?: () => Promise<void>;
182
- [key: string]: any;
183
- }
184
- export interface CapturedCommand {
185
- command: string;
186
- args: any[];
187
- result: any;
188
- rawResult?: any;
189
- error: Error | undefined;
190
- callSource: string | undefined;
191
- timestamp: number;
192
- fromElement: boolean;
193
- }
194
- export interface DriverPatcherHooks {
195
- onBeforeBuild?: (builder: any) => void;
196
- onDriverCreated: (driver: SeleniumDriverLike) => void | Promise<void>;
197
- onCommand: (cmd: CapturedCommand) => void;
198
- onBeforeQuit?: (driver: SeleniumDriverLike) => Promise<void>;
199
- waitForReady?: () => Promise<void>;
200
- }
201
- export interface DriverOriginals {
202
- takeScreenshot?: (driver: SeleniumDriverLike) => Promise<string>;
203
- executeScript?: (driver: SeleniumDriverLike, script: string, ...args: any[]) => Promise<any>;
204
- manage?: (driver: SeleniumDriverLike) => any;
205
- }
206
- export interface ElementOriginals {
207
- getText?: (element: any) => Promise<string>;
208
- getTagName?: (element: any) => Promise<string>;
209
- }
210
- export interface BidiHandlerSinks {
211
- pushConsoleLog: (entry: ConsoleLog) => void;
212
- pushNetworkRequest: (entry: NetworkRequest) => void;
213
- replaceNetworkRequest: (id: string, entry: NetworkRequest) => void;
214
- }
215
- export interface MochaTestCtx {
216
- title?: string;
217
- file?: string;
218
- state?: 'passed' | 'failed' | 'pending' | 'running' | 'skipped';
219
- duration?: number;
220
- parent?: {
221
- title?: string;
222
- };
223
- }
224
- export interface RunnerHookCallbacks {
225
- onTestStart: (name: string, file?: string, callSource?: string, suiteName?: string, suiteCallSource?: string) => void;
226
- onTestEnd: (state: 'passed' | 'failed' | 'skipped' | 'pending') => void;
227
- onScenarioStart?: (name: string, file?: string, callSource?: string, featureName?: string, featureCallSource?: string) => void;
228
- onScenarioEnd?: (state: 'passed' | 'failed' | 'skipped' | 'pending') => void;
229
- onTestRunComplete?: (summary: {
230
- passed: number;
231
- failed: number;
232
- pending: number;
233
- durationMs: number;
234
- }) => void;
235
- }
package/dist/types.js DELETED
@@ -1,5 +0,0 @@
1
- export var TraceType;
2
- (function (TraceType) {
3
- TraceType["Testrunner"] = "testrunner";
4
- })(TraceType || (TraceType = {}));
5
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAuIA,MAAM,CAAN,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,sCAAyB,CAAA;AAC3B,CAAC,EAFW,SAAS,KAAT,SAAS,QAEpB"}