@wdio/nightwatch-devtools 1.1.0 → 1.2.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 +65 -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 +106 -16
- package/dist/index.js +3875 -760
- package/dist/index.js.map +1 -1
- package/package.json +18 -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/reporter.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import logger from '@wdio/logger';
|
|
2
|
-
import { DEFAULTS } from './constants.js';
|
|
3
|
-
import { extractTestMetadata, generateStableUid, resetSignatureCounters } from './helpers/utils.js';
|
|
4
|
-
const log = logger('@wdio/nightwatch-devtools:Reporter');
|
|
5
|
-
export class TestReporter {
|
|
6
|
-
#report;
|
|
7
|
-
#currentSpecFile;
|
|
8
|
-
#testNamesCache = new Map();
|
|
9
|
-
#currentSuite;
|
|
10
|
-
#allSuites = [];
|
|
11
|
-
constructor(report) {
|
|
12
|
-
this.#report = report;
|
|
13
|
-
resetSignatureCounters();
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Called when a suite starts
|
|
17
|
-
*/
|
|
18
|
-
onSuiteStart(suiteStats) {
|
|
19
|
-
this.#currentSpecFile = suiteStats.file;
|
|
20
|
-
this.#currentSuite = suiteStats;
|
|
21
|
-
const rerunLabel = process.env.DEVTOOLS_RERUN_ENTRY_TYPE === 'test'
|
|
22
|
-
? process.env.DEVTOOLS_RERUN_LABEL?.trim()
|
|
23
|
-
: undefined;
|
|
24
|
-
// Generate stable UID only if not already set
|
|
25
|
-
if (!suiteStats.uid) {
|
|
26
|
-
suiteStats.uid = generateStableUid(suiteStats);
|
|
27
|
-
}
|
|
28
|
-
// Extract test names from source file
|
|
29
|
-
if (this.#currentSpecFile &&
|
|
30
|
-
!this.#testNamesCache.has(this.#currentSpecFile)) {
|
|
31
|
-
const metadata = extractTestMetadata(this.#currentSpecFile);
|
|
32
|
-
const testNames = rerunLabel
|
|
33
|
-
? metadata.testNames.filter((name) => name === rerunLabel)
|
|
34
|
-
: metadata.testNames;
|
|
35
|
-
if (testNames.length > 0) {
|
|
36
|
-
this.#testNamesCache.set(this.#currentSpecFile, testNames);
|
|
37
|
-
log.info(`📝 Extracted ${testNames.length} test names from ${this.#currentSpecFile}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
this.#allSuites.push(suiteStats);
|
|
41
|
-
this.#sendUpstream();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Clear execution data when a rerun starts.
|
|
45
|
-
* Resets test name cache and suites so they're repopulated fresh during the new run.
|
|
46
|
-
*/
|
|
47
|
-
clearExecutionData() {
|
|
48
|
-
this.#testNamesCache.clear();
|
|
49
|
-
this.#allSuites = [];
|
|
50
|
-
this.#currentSuite = undefined;
|
|
51
|
-
this.#currentSpecFile = undefined;
|
|
52
|
-
resetSignatureCounters();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Update the upstream reporter callback (used after a WebDriver session change
|
|
56
|
-
* so suite data is sent over the new WebSocket without rebuilding the reporter).
|
|
57
|
-
*/
|
|
58
|
-
updateUpstream(report) {
|
|
59
|
-
this.#report = report;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Update the suites data (send to UI)
|
|
63
|
-
*/
|
|
64
|
-
updateSuites() {
|
|
65
|
-
this.#sendUpstream();
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get the current suite
|
|
69
|
-
*/
|
|
70
|
-
getCurrentSuite() {
|
|
71
|
-
return this.#currentSuite;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Called when a test starts
|
|
75
|
-
*/
|
|
76
|
-
onTestStart(testStats) {
|
|
77
|
-
// Generate stable UID (hashed, so consistent even if called multiple times)
|
|
78
|
-
if (!testStats.uid || testStats.uid.includes('temp-')) {
|
|
79
|
-
testStats.uid = generateStableUid(testStats);
|
|
80
|
-
}
|
|
81
|
-
// Search for test by title within parent suite
|
|
82
|
-
for (const suite of this.#allSuites) {
|
|
83
|
-
const testIndex = suite.tests.findIndex((t) => {
|
|
84
|
-
if (typeof t === 'string') {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
// Match by title and parent suite
|
|
88
|
-
return t.title === testStats.title && t.parent === suite.uid;
|
|
89
|
-
});
|
|
90
|
-
if (testIndex !== -1) {
|
|
91
|
-
// Update existing test
|
|
92
|
-
suite.tests[testIndex] = testStats;
|
|
93
|
-
this.#sendUpstream();
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// Test not found in any suite, add it to current suite (legacy behavior)
|
|
98
|
-
if (this.#currentSuite) {
|
|
99
|
-
this.#currentSuite.tests.push(testStats);
|
|
100
|
-
}
|
|
101
|
-
this.#sendUpstream();
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Called when a test ends
|
|
105
|
-
*/
|
|
106
|
-
onTestEnd(testStats) {
|
|
107
|
-
// Search all suites for this test (not just current suite)
|
|
108
|
-
for (const suite of this.#allSuites) {
|
|
109
|
-
const testIndex = suite.tests.findIndex((t) => (typeof t === 'string' ? t : t.uid) === testStats.uid);
|
|
110
|
-
if (testIndex !== -1) {
|
|
111
|
-
suite.tests[testIndex] = testStats;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
this.#sendUpstream();
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Called when a suite ends - create skipped tests
|
|
119
|
-
*/
|
|
120
|
-
onSuiteEnd(suiteStats) {
|
|
121
|
-
// Get all test names from cache
|
|
122
|
-
const cachedNames = this.#testNamesCache.get(suiteStats.file) || [];
|
|
123
|
-
const processedTestNames = new Set(suiteStats.tests
|
|
124
|
-
.map((t) => (typeof t === 'string' ? t : t.title))
|
|
125
|
-
.filter((title) => Boolean(title)));
|
|
126
|
-
// Create skipped tests for tests that didn't run
|
|
127
|
-
cachedNames.forEach((testName) => {
|
|
128
|
-
if (!processedTestNames.has(testName)) {
|
|
129
|
-
const skippedTest = {
|
|
130
|
-
uid: generateStableUid({
|
|
131
|
-
file: suiteStats.file,
|
|
132
|
-
fullTitle: `${suiteStats.title} ${testName}`
|
|
133
|
-
}),
|
|
134
|
-
cid: DEFAULTS.CID,
|
|
135
|
-
title: testName,
|
|
136
|
-
fullTitle: `${suiteStats.title} ${testName}`,
|
|
137
|
-
parent: suiteStats.uid,
|
|
138
|
-
state: 'skipped',
|
|
139
|
-
start: new Date(),
|
|
140
|
-
end: new Date(),
|
|
141
|
-
type: 'test',
|
|
142
|
-
file: suiteStats.file,
|
|
143
|
-
retries: DEFAULTS.RETRIES,
|
|
144
|
-
_duration: DEFAULTS.DURATION,
|
|
145
|
-
hooks: []
|
|
146
|
-
};
|
|
147
|
-
suiteStats.tests.push(skippedTest);
|
|
148
|
-
log.info(`Created skipped test "${testName}" (never executed)`);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
this.#sendUpstream();
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Update a specific suite and send to UI (used when updating suite title)
|
|
155
|
-
*/
|
|
156
|
-
updateSuite(suiteStats) {
|
|
157
|
-
// Find and remove the old suite by file
|
|
158
|
-
const index = this.#allSuites.findIndex((s) => s.file === suiteStats.file);
|
|
159
|
-
if (index !== -1) {
|
|
160
|
-
// Remove the old suite entry (with old UID)
|
|
161
|
-
this.#allSuites.splice(index, 1);
|
|
162
|
-
}
|
|
163
|
-
// Add the updated suite with new UID
|
|
164
|
-
this.#allSuites.push(suiteStats);
|
|
165
|
-
// Update current suite reference
|
|
166
|
-
this.#currentSuite = suiteStats;
|
|
167
|
-
this.#sendUpstream();
|
|
168
|
-
}
|
|
169
|
-
#sendUpstream() {
|
|
170
|
-
const payload = [];
|
|
171
|
-
for (const suite of this.#allSuites) {
|
|
172
|
-
if (suite && suite.uid) {
|
|
173
|
-
// Each suite becomes an object with its UID as the key
|
|
174
|
-
payload.push({ [suite.uid]: suite });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (payload.length > 0) {
|
|
178
|
-
this.#report(payload);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
get report() {
|
|
182
|
-
return this.#allSuites;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
//# sourceMappingURL=reporter.js.map
|
package/dist/reporter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings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
|
package/dist/session.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { CommandLog, ConsoleLog, NightwatchBrowser } from './types.js';
|
|
2
|
-
export declare class SessionCapturer {
|
|
3
|
-
#private;
|
|
4
|
-
commandsLog: CommandLog[];
|
|
5
|
-
sources: Map<string, string>;
|
|
6
|
-
consoleLogs: ConsoleLog[];
|
|
7
|
-
mutations: any[];
|
|
8
|
-
traceLogs: string[];
|
|
9
|
-
networkRequests: any[];
|
|
10
|
-
metadata?: any;
|
|
11
|
-
constructor(devtoolsOptions?: {
|
|
12
|
-
hostname?: string;
|
|
13
|
-
port?: number;
|
|
14
|
-
}, browser?: NightwatchBrowser);
|
|
15
|
-
cleanup(): void;
|
|
16
|
-
get isReportingUpstream(): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Wait for WebSocket to connect
|
|
19
|
-
*/
|
|
20
|
-
waitForConnection(timeoutMs?: number): Promise<boolean>;
|
|
21
|
-
captureCommand(command: string, args: any[], result: any, error: Error | undefined, testUid?: string, callSource?: string, timestamp?: number): Promise<boolean>;
|
|
22
|
-
/** Send a command to the UI (only if not already sent) */
|
|
23
|
-
sendCommand(command: CommandLog & {
|
|
24
|
-
_id?: number;
|
|
25
|
-
}): void;
|
|
26
|
-
/**
|
|
27
|
-
* Replace an already-captured command entry (used for retried commands so
|
|
28
|
-
* only the final execution result is shown in the UI).
|
|
29
|
-
* Removes the old entry from commandsLog, revokes its sent-status so the
|
|
30
|
-
* replacement can be sent, and returns the new entry together with the
|
|
31
|
-
* old entry's timestamp (so the UI can locate and replace it in-place).
|
|
32
|
-
*/
|
|
33
|
-
replaceCommand(oldId: number, command: string, args: any[], result: any, error: Error | undefined, testUid?: string, callSource?: string, timestamp?: number): {
|
|
34
|
-
entry: CommandLog & {
|
|
35
|
-
_id?: number;
|
|
36
|
-
};
|
|
37
|
-
oldTimestamp: number;
|
|
38
|
-
};
|
|
39
|
-
/** Send a replace-command event to the UI (swaps old entry in-place) */
|
|
40
|
-
sendReplaceCommand(oldTimestamp: number, command: CommandLog & {
|
|
41
|
-
_id?: number;
|
|
42
|
-
}): void;
|
|
43
|
-
/**
|
|
44
|
-
* Take a screenshot by calling the WebDriver HTTP endpoint directly.
|
|
45
|
-
* This completely bypasses Nightwatch's command queue so there is no risk
|
|
46
|
-
* of the request being appended after `end()` / `quit()`.
|
|
47
|
-
*/
|
|
48
|
-
takeScreenshotViaHttp(browser: NightwatchBrowser): Promise<string | null>;
|
|
49
|
-
/** Capture test source code */
|
|
50
|
-
captureSource(filePath: string): Promise<void>;
|
|
51
|
-
/** Send data upstream to backend */
|
|
52
|
-
sendUpstream(event: string, data: any): void;
|
|
53
|
-
/** Returns true when the WebSocket is open. */
|
|
54
|
-
isConnected(): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Gracefully close the WebSocket, waiting for any buffered messages to flush.
|
|
57
|
-
* Call this before process exit in reuse mode to prevent data loss.
|
|
58
|
-
*/
|
|
59
|
-
closeWebSocket(): Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Inject the WDIO devtools script into the browser page
|
|
62
|
-
*/
|
|
63
|
-
injectScript(browser: NightwatchBrowser): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Capture Chrome DevTools browser console logs via WebDriver log API.
|
|
66
|
-
* Requires loggingPrefs: { browser: 'ALL' } in Chrome capabilities.
|
|
67
|
-
*/
|
|
68
|
-
captureBrowserLogs(browser: NightwatchBrowser): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Parse Chrome performance logs to extract network request entries.
|
|
71
|
-
* Requires loggingPrefs: { performance: 'ALL' } in Chrome capabilities.
|
|
72
|
-
*/
|
|
73
|
-
captureNetworkFromPerformanceLogs(browser: NightwatchBrowser): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Capture trace data from the browser (network requests, console logs, etc.)
|
|
76
|
-
*/
|
|
77
|
-
captureTrace(browser: NightwatchBrowser): Promise<void>;
|
|
78
|
-
}
|