@wdio/nightwatch-devtools 1.1.1 → 1.3.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.
- package/README.md +66 -1
- package/dist/bidi-OH4ZFDN5.js +215 -0
- package/dist/bidi-OH4ZFDN5.js.map +1 -0
- package/dist/chunk-DKSBYMPM.js +191 -0
- package/dist/chunk-DKSBYMPM.js.map +1 -0
- package/dist/index.d.ts +111 -16
- package/dist/index.js +6253 -770
- package/dist/index.js.map +1 -1
- package/package.json +20 -13
- package/dist/constants.d.ts +0 -55
- package/dist/constants.js +0 -95
- package/dist/constants.js.map +0 -1
- package/dist/helpers/browserProxy.d.ts +0 -46
- package/dist/helpers/browserProxy.js +0 -314
- package/dist/helpers/browserProxy.js.map +0 -1
- package/dist/helpers/capturePerformance.d.ts +0 -5
- package/dist/helpers/capturePerformance.js +0 -53
- package/dist/helpers/capturePerformance.js.map +0 -1
- package/dist/helpers/cucumberHooks.cjs +0 -54
- package/dist/helpers/cucumberHooks.cjs.map +0 -1
- package/dist/helpers/cucumberHooks.d.cts +0 -21
- package/dist/helpers/suiteManager.d.ts +0 -43
- package/dist/helpers/suiteManager.js +0 -143
- package/dist/helpers/suiteManager.js.map +0 -1
- package/dist/helpers/testManager.d.ts +0 -45
- package/dist/helpers/testManager.js +0 -143
- package/dist/helpers/testManager.js.map +0 -1
- package/dist/helpers/utils.d.ts +0 -83
- package/dist/helpers/utils.js +0 -447
- package/dist/helpers/utils.js.map +0 -1
- package/dist/reporter.d.ts +0 -44
- package/dist/reporter.js +0 -185
- package/dist/reporter.js.map +0 -1
- package/dist/session.d.ts +0 -78
- package/dist/session.js +0 -643
- package/dist/session.js.map +0 -1
- package/dist/types.d.ts +0 -190
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,106 @@
|
|
|
1
|
+
import { ScreencastOptions, DevToolsMode, TraceFormat } from '@wdio/devtools-shared';
|
|
2
|
+
|
|
3
|
+
/** Nightwatch `eventHub` shape — only `runner` + `on()` are documented; the
|
|
4
|
+
* rest of the public surface is `unknown` to us. */
|
|
5
|
+
interface NightwatchEventHub {
|
|
6
|
+
runner?: string;
|
|
7
|
+
on(event: string, listener: (data: unknown) => void): void;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface DevToolsOptions {
|
|
11
|
+
port?: number;
|
|
12
|
+
hostname?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Screencast recording options. When enabled, a continuous video of the
|
|
15
|
+
* browser session is recorded and saved as a .webm file at the end of the
|
|
16
|
+
* test run. Polling mode only on Nightwatch (no CDP push); works on every
|
|
17
|
+
* browser Nightwatch supports.
|
|
18
|
+
*/
|
|
19
|
+
screencast?: ScreencastOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Enable WebDriver BiDi capture (browser console + JS exceptions + network
|
|
22
|
+
* via `selenium-webdriver/bidi`). Requires `webSocketUrl: true` in your
|
|
23
|
+
* capabilities and a BiDi-capable chromedriver. When attached, the per-
|
|
24
|
+
* command perf-log network capture path is gated off to avoid duplicate
|
|
25
|
+
* entries. Defaults to `false` — opt-in.
|
|
26
|
+
*/
|
|
27
|
+
bidi?: boolean;
|
|
28
|
+
/** `live` (default) launches the DevTools UI; `trace` skips it. */
|
|
29
|
+
mode?: DevToolsMode;
|
|
30
|
+
/** Trace output layout — `zip` (default) writes a single archive,
|
|
31
|
+
* `ndjson-directory` unpacks into `trace-<id>/`. Only applies in trace mode. */
|
|
32
|
+
traceFormat?: TraceFormat;
|
|
33
|
+
}
|
|
34
|
+
interface NightwatchBrowser {
|
|
35
|
+
url: (url: string) => Promise<unknown>;
|
|
36
|
+
execute: (script: string | ((...args: unknown[]) => unknown), args?: unknown[]) => Promise<unknown>;
|
|
37
|
+
executeAsync: (script: (...args: unknown[]) => unknown, args?: unknown[]) => Promise<unknown>;
|
|
38
|
+
pause: (ms: number) => Promise<unknown>;
|
|
39
|
+
capabilities?: Record<string, unknown>;
|
|
40
|
+
desiredCapabilities?: Record<string, unknown>;
|
|
41
|
+
sessionId?: string;
|
|
42
|
+
/** Driver instance from selenium-webdriver — its public shape is wide; we
|
|
43
|
+
* pass it through to BiDi attach helpers that do their own narrowing. */
|
|
44
|
+
driver?: unknown;
|
|
45
|
+
options?: {
|
|
46
|
+
testEnv?: string;
|
|
47
|
+
webdriver?: {
|
|
48
|
+
host?: string;
|
|
49
|
+
};
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
};
|
|
52
|
+
currentTest?: {
|
|
53
|
+
name?: string;
|
|
54
|
+
module?: string;
|
|
55
|
+
group?: string;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
results?: unknown;
|
|
59
|
+
queue?: unknown;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Cucumber lifecycle for the Nightwatch plugin.
|
|
64
|
+
*
|
|
65
|
+
* Extracted from the plugin class to keep `index.ts` under the file-size cap
|
|
66
|
+
* and to isolate the cucumber-specific orchestration from the per-test
|
|
67
|
+
* (Mocha/Jasmine-style) lifecycle.
|
|
68
|
+
*
|
|
69
|
+
* The plugin passes itself as a `CucumberLifecycleCtx` — a narrow interface
|
|
70
|
+
* exposing only the fields and methods this module needs. The lifecycle
|
|
71
|
+
* helpers mutate the plugin's "current execution" state via the accessors on
|
|
72
|
+
* the ctx (they can't reach the plugin's private fields directly).
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/** Minimal shapes for the Cucumber objects we touch. Cucumber's own types
|
|
76
|
+
* vary across major versions; we pin only fields we read. */
|
|
77
|
+
interface CucumberPickleStep {
|
|
78
|
+
text?: string;
|
|
79
|
+
astNodeIds?: string[];
|
|
80
|
+
location?: {
|
|
81
|
+
line?: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
interface CucumberPickle {
|
|
85
|
+
uri?: string;
|
|
86
|
+
name?: string;
|
|
87
|
+
location?: {
|
|
88
|
+
line?: number;
|
|
89
|
+
};
|
|
90
|
+
astNodeIds?: string[];
|
|
91
|
+
steps?: CucumberPickleStep[];
|
|
92
|
+
}
|
|
93
|
+
interface CucumberResult {
|
|
94
|
+
status?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
1
97
|
/**
|
|
2
98
|
* Nightwatch DevTools Plugin
|
|
3
99
|
*
|
|
4
100
|
* Integrates Nightwatch with WebdriverIO DevTools following the WDIO service pattern.
|
|
5
101
|
* Captures commands, network requests, and console logs during test execution in real-time.
|
|
6
102
|
*/
|
|
7
|
-
|
|
103
|
+
|
|
8
104
|
declare class NightwatchDevToolsPlugin {
|
|
9
105
|
#private;
|
|
10
106
|
private options;
|
|
@@ -16,24 +112,23 @@ declare class NightwatchDevToolsPlugin {
|
|
|
16
112
|
private isScriptInjected;
|
|
17
113
|
constructor(options?: DevToolsOptions);
|
|
18
114
|
before(): Promise<void>;
|
|
19
|
-
cucumberBefore(browser: NightwatchBrowser, pickle:
|
|
20
|
-
cucumberAfter(browser: NightwatchBrowser, result:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** Called from Cucumber AfterStep hook — records the step result. */
|
|
24
|
-
cucumberAfterStep(_browser: NightwatchBrowser, result: any, pickleStep: any, _pickle: any): Promise<void>;
|
|
115
|
+
cucumberBefore(browser: NightwatchBrowser, pickle: CucumberPickle): Promise<void>;
|
|
116
|
+
cucumberAfter(browser: NightwatchBrowser, result: CucumberResult, pickle: CucumberPickle): Promise<void>;
|
|
117
|
+
cucumberBeforeStep(browser: NightwatchBrowser, pickleStep: CucumberPickleStep, pickle: CucumberPickle): Promise<void>;
|
|
118
|
+
cucumberAfterStep(browser: NightwatchBrowser, result: CucumberResult, pickleStep: CucumberPickleStep, pickle: CucumberPickle): Promise<void>;
|
|
25
119
|
beforeEach(browser: NightwatchBrowser): Promise<void>;
|
|
26
120
|
afterEach(browser: NightwatchBrowser): Promise<void>;
|
|
27
121
|
after(browser?: NightwatchBrowser): Promise<void>;
|
|
28
|
-
registerEventHandlers(eventHub:
|
|
122
|
+
registerEventHandlers(eventHub: NightwatchEventHub): void;
|
|
29
123
|
}
|
|
30
|
-
|
|
31
|
-
|
|
124
|
+
declare const cucumberHooksPath: string;
|
|
125
|
+
declare function createNightwatchDevTools(options?: DevToolsOptions): {
|
|
32
126
|
asyncHookTimeout: number;
|
|
33
|
-
before: (this:
|
|
34
|
-
beforeEach: (this:
|
|
35
|
-
afterEach: (this:
|
|
36
|
-
after: (this:
|
|
37
|
-
registerEventHandlers: (eventHub:
|
|
127
|
+
before: (this: unknown) => Promise<void>;
|
|
128
|
+
beforeEach: (this: unknown, browser: NightwatchBrowser) => Promise<void>;
|
|
129
|
+
afterEach: (this: unknown, browser: NightwatchBrowser) => Promise<void>;
|
|
130
|
+
after: (this: unknown) => Promise<void>;
|
|
131
|
+
registerEventHandlers: (eventHub: NightwatchEventHub) => void;
|
|
38
132
|
};
|
|
39
|
-
|
|
133
|
+
|
|
134
|
+
export { NightwatchDevToolsPlugin, cucumberHooksPath, createNightwatchDevTools as default };
|