@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
@@ -1,131 +0,0 @@
1
- import { DEFAULTS, TEST_STATE } from '../constants.js';
2
- import { generateStableUid } from './utils.js';
3
- // rootSuite = describe block (Mocha/Jest) or feature (Cucumber).
4
- // currentParent points at the in-progress scenario sub-suite for Cucumber,
5
- // or at rootSuite otherwise. Tests append to currentParent.
6
- export class SuiteManager {
7
- testReporter;
8
- rootSuite = null;
9
- currentParent = null;
10
- constructor(testReporter) {
11
- this.testReporter = testReporter;
12
- }
13
- getOrCreateRootSuite(file, title) {
14
- if (this.rootSuite) {
15
- return this.rootSuite;
16
- }
17
- const suite = {
18
- uid: generateStableUid(file, title),
19
- cid: DEFAULTS.CID,
20
- title,
21
- fullTitle: title,
22
- file,
23
- type: 'suite',
24
- start: new Date(),
25
- state: TEST_STATE.RUNNING,
26
- end: null,
27
- tests: [],
28
- suites: [],
29
- hooks: [],
30
- _duration: DEFAULTS.DURATION
31
- };
32
- this.rootSuite = suite;
33
- this.currentParent = suite;
34
- this.testReporter.onSuiteStart(suite);
35
- return suite;
36
- }
37
- getRootSuite() {
38
- return this.rootSuite;
39
- }
40
- /** Where new tests are appended — root suite, or the open scenario sub-suite. */
41
- getCurrentParent() {
42
- return this.currentParent ?? this.rootSuite;
43
- }
44
- /** Open a Cucumber scenario as a sub-suite; steps attach until endScenarioSuite. */
45
- startScenarioSuite(name, file, callSource) {
46
- if (!this.rootSuite) {
47
- return null;
48
- }
49
- const sub = {
50
- uid: generateStableUid(file, `${this.rootSuite.uid}::${name}`),
51
- cid: DEFAULTS.CID,
52
- title: name,
53
- fullTitle: name,
54
- file,
55
- type: 'suite',
56
- start: new Date(),
57
- state: TEST_STATE.RUNNING,
58
- end: null,
59
- tests: [],
60
- suites: [],
61
- hooks: [],
62
- _duration: DEFAULTS.DURATION,
63
- callSource,
64
- // Without `parent`, the dashboard's `!suite.parent` filter renders this
65
- // sub-suite at the root too, duplicating it next to the feature.
66
- parent: this.rootSuite.uid
67
- };
68
- this.rootSuite.suites = this.rootSuite.suites ?? [];
69
- this.rootSuite.suites.push(sub);
70
- this.currentParent = sub;
71
- this.testReporter.onSuiteStart(sub);
72
- return sub;
73
- }
74
- endScenarioSuite(state) {
75
- const cur = this.currentParent;
76
- if (!cur || cur === this.rootSuite || cur.end) {
77
- return;
78
- }
79
- cur.end = new Date();
80
- cur._duration =
81
- cur.end.getTime() - (cur.start?.getTime() || cur.end.getTime());
82
- cur.state = state;
83
- this.testReporter.onSuiteEnd(cur);
84
- this.currentParent = this.rootSuite;
85
- }
86
- setRootSuiteTitle(title, callSource) {
87
- if (!this.rootSuite) {
88
- return;
89
- }
90
- let changed = false;
91
- if (title && this.rootSuite.title !== title) {
92
- this.rootSuite.title = title;
93
- this.rootSuite.fullTitle = title;
94
- changed = true;
95
- }
96
- if (callSource && this.rootSuite.callSource !== callSource) {
97
- this.rootSuite.callSource = callSource;
98
- changed = true;
99
- }
100
- if (changed) {
101
- this.testReporter.updateSuites();
102
- }
103
- }
104
- addTest(test) {
105
- const parent = this.getCurrentParent();
106
- if (!parent) {
107
- return;
108
- }
109
- parent.tests.push(test);
110
- this.testReporter.updateSuites();
111
- }
112
- finalize() {
113
- if (!this.rootSuite || this.rootSuite.end) {
114
- return;
115
- }
116
- this.rootSuite.end = new Date();
117
- this.rootSuite._duration =
118
- this.rootSuite.end.getTime() -
119
- (this.rootSuite.start?.getTime() || this.rootSuite.end.getTime());
120
- const failedDirect = this.rootSuite.tests.some((t) => typeof t !== 'string' && t.state === TEST_STATE.FAILED);
121
- const failedNested = (this.rootSuite.suites ?? []).some((s) => s.state === TEST_STATE.FAILED);
122
- this.rootSuite.state =
123
- failedDirect || failedNested ? TEST_STATE.FAILED : TEST_STATE.PASSED;
124
- this.testReporter.onSuiteEnd(this.rootSuite);
125
- }
126
- reset() {
127
- this.rootSuite = null;
128
- this.currentParent = null;
129
- }
130
- }
131
- //# sourceMappingURL=suiteManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"suiteManager.js","sourceRoot":"","sources":["../../src/helpers/suiteManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,iEAAiE;AACjE,2EAA2E;AAC3E,4DAA4D;AAC5D,MAAM,OAAO,YAAY;IAIH;IAHZ,SAAS,GAAsB,IAAI,CAAA;IACnC,aAAa,GAAsB,IAAI,CAAA;IAE/C,YAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAElD,oBAAoB,CAAC,IAAY,EAAE,KAAa;QAC9C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;QAED,MAAM,KAAK,GAAe;YACxB,GAAG,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC;YACnC,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,KAAK;YACL,SAAS,EAAE,KAAK;YAChB,IAAI;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,IAAI,IAAI,EAAE;YACjB,KAAK,EAAE,UAAU,CAAC,OAAO;YACzB,GAAG,EAAE,IAAI;YACT,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EA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ClB,YAAY,IAAI,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAA;QACtE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC9C,CAAC;IAED,KAAK;QACH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA;IAC3B,CAAC;CACF"}
@@ -1,47 +0,0 @@
1
- import type { SuiteStats, TestStats } from '../types.js';
2
- import type { TestReporter } from '../reporter.js';
3
- import type { SuiteManager } from './suiteManager.js';
4
- /**
5
- * Tracks the currently-active test inside the session suite. Two modes:
6
- * - `session` (default): one synthetic test wraps the entire driver session.
7
- * - `marked`: user calls startTest(name)/endTest(state); each pair adds a test.
8
- *
9
- * The proxy reads `getCurrentTest()` to tag each captured command with a uid.
10
- */
11
- export declare class TestManager {
12
- #private;
13
- private rootSuite;
14
- private testReporter;
15
- private suiteManager;
16
- constructor(rootSuite: SuiteStats, testReporter: TestReporter, suiteManager: SuiteManager);
17
- /** Where new tests attach — current scenario sub-suite (Cucumber) or root. */
18
- private get suite();
19
- /**
20
- * Returns the test that captured commands should attach to. Order:
21
- * 1. The currently-running marked test, if any.
22
- * 2. (only if the user has NOT yet used startMarkedTest) the synthetic
23
- * session-wide test, lazily created on first command.
24
- * 3. The most-recently-ended marked test (handles commands that fire
25
- * between the user's it() blocks — chromedriver retries, hooks, etc).
26
- */
27
- getOrEnsureTest(): TestStats | null;
28
- /**
29
- * Public alias retained for callers that want to force the synthetic test
30
- * to exist. The internal code path uses `getOrEnsureTest()` instead.
31
- */
32
- ensureSessionTest(): TestStats;
33
- /**
34
- * Switch into marked mode and start a new test. The first time this is
35
- * called, any pre-existing synthetic session test is removed from the suite
36
- * (along with any commands that referenced it) — once the user takes over
37
- * the test boundaries, the synthetic just adds noise.
38
- */
39
- startMarkedTest(name: string, opts?: {
40
- file?: string;
41
- callSource?: string;
42
- }): TestStats;
43
- endCurrent(state: TestStats['state']): void;
44
- getCurrentTest(): TestStats | null;
45
- /** Called when the driver session is closing (process exit / quit). */
46
- finalizeSession(): void;
47
- }
@@ -1,158 +0,0 @@
1
- import logger from '@wdio/logger';
2
- import { DEFAULTS, TEST_STATE } from '../constants.js';
3
- import { deterministicUid, generateStableUid } from './utils.js';
4
- const log = logger('@wdio/selenium-devtools:testManager');
5
- /**
6
- * Tracks the currently-active test inside the session suite. Two modes:
7
- * - `session` (default): one synthetic test wraps the entire driver session.
8
- * - `marked`: user calls startTest(name)/endTest(state); each pair adds a test.
9
- *
10
- * The proxy reads `getCurrentTest()` to tag each captured command with a uid.
11
- */
12
- export class TestManager {
13
- rootSuite;
14
- testReporter;
15
- suiteManager;
16
- #currentTest = null;
17
- #lastMarkedTest = null;
18
- #mode = 'session';
19
- /** Set true the first time the user calls startMarkedTest. Once true we
20
- * never auto-create the synthetic session test — orphan commands attach
21
- * to the most-recently-marked test instead. */
22
- #userTookOver = false;
23
- constructor(rootSuite, testReporter, suiteManager) {
24
- this.rootSuite = rootSuite;
25
- this.testReporter = testReporter;
26
- this.suiteManager = suiteManager;
27
- }
28
- /** Where new tests attach — current scenario sub-suite (Cucumber) or root. */
29
- get suite() {
30
- return this.suiteManager.getCurrentParent() ?? this.rootSuite;
31
- }
32
- /**
33
- * Returns the test that captured commands should attach to. Order:
34
- * 1. The currently-running marked test, if any.
35
- * 2. (only if the user has NOT yet used startMarkedTest) the synthetic
36
- * session-wide test, lazily created on first command.
37
- * 3. The most-recently-ended marked test (handles commands that fire
38
- * between the user's it() blocks — chromedriver retries, hooks, etc).
39
- */
40
- getOrEnsureTest() {
41
- if (this.#currentTest) {
42
- return this.#currentTest;
43
- }
44
- if (!this.#userTookOver) {
45
- return this.#ensureSessionTest();
46
- }
47
- return this.#lastMarkedTest;
48
- }
49
- /** Lazily creates the synthetic session-wide test on first command. */
50
- #ensureSessionTest() {
51
- if (this.#currentTest && this.#mode === 'session') {
52
- return this.#currentTest;
53
- }
54
- log.info('Creating synthetic session test (no startTest called yet)');
55
- const title = DEFAULTS.SESSION_TITLE;
56
- const test = {
57
- uid: deterministicUid(this.suite.file, `session:${this.suite.uid}`),
58
- cid: DEFAULTS.CID,
59
- title,
60
- fullTitle: title,
61
- parent: this.suite.uid,
62
- state: TEST_STATE.RUNNING,
63
- start: new Date(),
64
- end: null,
65
- type: 'test',
66
- file: this.suite.file,
67
- retries: DEFAULTS.RETRIES,
68
- _duration: DEFAULTS.DURATION,
69
- hooks: []
70
- };
71
- this.suite.tests.push(test);
72
- this.#currentTest = test;
73
- this.testReporter.onTestStart(test);
74
- return test;
75
- }
76
- /**
77
- * Public alias retained for callers that want to force the synthetic test
78
- * to exist. The internal code path uses `getOrEnsureTest()` instead.
79
- */
80
- ensureSessionTest() {
81
- return this.#ensureSessionTest();
82
- }
83
- /**
84
- * Switch into marked mode and start a new test. The first time this is
85
- * called, any pre-existing synthetic session test is removed from the suite
86
- * (along with any commands that referenced it) — once the user takes over
87
- * the test boundaries, the synthetic just adds noise.
88
- */
89
- startMarkedTest(name, opts = {}) {
90
- if (!this.#userTookOver) {
91
- this.#userTookOver = true;
92
- // Drop the synthetic session test if it was lazy-created during the
93
- // gap between driver creation and the user's first startTest. Any
94
- // commands captured against it stay on disk in the worker buffer but
95
- // are no longer reachable from the suite tree — cleaner UI.
96
- if (this.#currentTest && this.#mode === 'session') {
97
- log.info('Removing synthetic session test (user has taken over)');
98
- const idx = this.suite.tests.indexOf(this.#currentTest);
99
- if (idx !== -1) {
100
- this.suite.tests.splice(idx, 1);
101
- }
102
- this.#currentTest = null;
103
- }
104
- }
105
- if (this.#mode === 'marked' && this.#currentTest) {
106
- this.endCurrent('passed');
107
- }
108
- this.#mode = 'marked';
109
- const file = opts.file || this.suite.file;
110
- const test = {
111
- // Scope by parent so two suites with the same test/step name don't
112
- // collide on signatureCounter disambiguation across rerun processes.
113
- uid: generateStableUid(file, `${this.suite.uid}::${name}`),
114
- cid: DEFAULTS.CID,
115
- title: name,
116
- fullTitle: name,
117
- parent: this.suite.uid,
118
- state: TEST_STATE.RUNNING,
119
- start: new Date(),
120
- end: null,
121
- type: 'test',
122
- file,
123
- retries: DEFAULTS.RETRIES,
124
- _duration: DEFAULTS.DURATION,
125
- hooks: [],
126
- callSource: opts.callSource
127
- };
128
- log.info(`Started marked test "${name}" (callSource: ${opts.callSource || 'n/a'})`);
129
- this.suite.tests.push(test);
130
- this.#currentTest = test;
131
- this.#lastMarkedTest = test;
132
- this.testReporter.onTestStart(test);
133
- return test;
134
- }
135
- endCurrent(state) {
136
- const test = this.#currentTest;
137
- if (!test) {
138
- return;
139
- }
140
- test.state = state;
141
- test.end = new Date();
142
- test._duration = test.end.getTime() - (test.start?.getTime() ?? Date.now());
143
- this.testReporter.onTestEnd(test);
144
- this.#currentTest = null;
145
- }
146
- getCurrentTest() {
147
- return this.#currentTest;
148
- }
149
- /** Called when the driver session is closing (process exit / quit). */
150
- finalizeSession() {
151
- if (this.#currentTest) {
152
- this.endCurrent(this.#currentTest.state === TEST_STATE.RUNNING
153
- ? 'passed'
154
- : this.#currentTest.state);
155
- }
156
- }
157
- }
158
- //# sourceMappingURL=testManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testManager.js","sourceRoot":"","sources":["../../src/helpers/testManager.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAItD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEhE,MAAM,GAAG,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IAUZ;IACA;IACA;IAXV,YAAY,GAAqB,IAAI,CAAA;IACrC,eAAe,GAAqB,IAAI,CAAA;IACxC,KAAK,GAAyB,SAAS,CAAA;IACvC;;mDAE+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AI,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QAC3E,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;IAC1B,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;IAED,uEAAuE;IACvE,eAAe;QACb,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,UAAU,CACb,IAAI,CAAC,YAAY,CAAC,KAAK,KAAK,UAAU,CAAC,OAAO;gBAC5C,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAC5B,CAAA;QACH,CAAC;IACH,CAAC;CACF"}
@@ -1,26 +0,0 @@
1
- import type { ConsoleLog, LogLevel } from '../types.js';
2
- export declare const stripAnsiCodes: (text: string) => string;
3
- export declare function detectLogLevel(text: string): LogLevel;
4
- export declare function createConsoleLogEntry(type: LogLevel, args: any[], source?: string): ConsoleLog;
5
- export declare function chromeLogLevelToLogLevel(level: string | {
6
- value?: number;
7
- name?: string;
8
- }): LogLevel;
9
- export declare function generateStableUid(file: string, name: string): string;
10
- export declare function deterministicUid(...parts: string[]): string;
11
- export declare function resetSignatureCounters(): void;
12
- export declare function getCallSourceFromStack(): {
13
- filePath: string | undefined;
14
- callSource: string;
15
- };
16
- export declare function findTestLineInFile(filePath: string, title: string, kind?: 'test' | 'suite'): number | null;
17
- export declare function isPortInUse(port: number, hostname: string): Promise<boolean>;
18
- export declare function findFreePort(startPort: number, hostname: string): Promise<number>;
19
- /**
20
- * Capture the command line that launched the current process so the UI's
21
- * "rerun" button can re-execute the same script. Falls back to the raw
22
- * argv when npm script context is unavailable.
23
- */
24
- /** Derive a human-readable request type from URL and MIME type. */
25
- export declare function getRequestType(url: string, mimeType?: string): string;
26
- export declare function captureLaunchCommand(): string;
@@ -1,187 +0,0 @@
1
- import * as net from 'node:net';
2
- import { parse as parseStackTrace } from 'stacktrace-parser';
3
- import logger from '@wdio/logger';
4
- import { ANSI_REGEX, LOG_LEVEL_PATTERNS, LOG_SOURCES } from '../constants.js';
5
- const log = logger('@wdio/selenium-devtools:utils');
6
- export const stripAnsiCodes = (text) => text.replace(ANSI_REGEX, '');
7
- export function detectLogLevel(text) {
8
- const normalised = stripAnsiCodes(text).toLowerCase();
9
- for (const { level, pattern } of LOG_LEVEL_PATTERNS) {
10
- if (pattern.test(normalised)) {
11
- return level;
12
- }
13
- }
14
- return 'log';
15
- }
16
- export function createConsoleLogEntry(type, args, source = LOG_SOURCES.TEST) {
17
- return { timestamp: Date.now(), type, args, source };
18
- }
19
- export function chromeLogLevelToLogLevel(level) {
20
- const levelName = (typeof level === 'object' ? (level?.name ?? '') : (level ?? '')).toUpperCase();
21
- switch (levelName) {
22
- case 'SEVERE':
23
- return 'error';
24
- case 'WARNING':
25
- return 'warn';
26
- case 'INFO':
27
- return 'info';
28
- case 'DEBUG':
29
- return 'debug';
30
- default:
31
- return 'log';
32
- }
33
- }
34
- const signatureCounters = new Map();
35
- export function generateStableUid(file, name) {
36
- const signature = `${file}::${name}`;
37
- const count = signatureCounters.get(signature) || 0;
38
- signatureCounters.set(signature, count + 1);
39
- const hashInput = count > 0 ? `${signature}::${count}` : signature;
40
- const hash = hashInput
41
- .split('')
42
- .reduce((acc, char) => ((acc << 5) - acc + char.charCodeAt(0)) | 0, 0);
43
- return `stable-${Math.abs(hash).toString(36)}`;
44
- }
45
- export function deterministicUid(...parts) {
46
- const hash = parts
47
- .join('::')
48
- .split('')
49
- .reduce((acc, char) => ((acc << 5) - acc + char.charCodeAt(0)) | 0, 0);
50
- return `stable-${Math.abs(hash).toString(36)}`;
51
- }
52
- export function resetSignatureCounters() {
53
- signatureCounters.clear();
54
- }
55
- function isUserCodeFrame(frame) {
56
- const { file } = frame;
57
- return !!(file &&
58
- !file.includes('/node_modules/') &&
59
- !file.includes('<anonymous>') &&
60
- !file.includes('node:internal') &&
61
- !file.includes('/dist/') &&
62
- !file.endsWith('/index.js'));
63
- }
64
- function normalizeFilePath(filePath) {
65
- // Node's stack traces in ESM use file:// URLs, which URL-encode spaces and
66
- // other characters. Strip the prefix, drop the line:col suffix, and decode
67
- // — otherwise `fs.readFile` hits ENOENT on any path containing a space.
68
- const stripped = filePath.replace(/^file:\/\//, '').split(':')[0];
69
- try {
70
- return decodeURIComponent(stripped);
71
- }
72
- catch {
73
- // Malformed percent-encoding — keep the literal path rather than throw.
74
- return stripped;
75
- }
76
- }
77
- export function getCallSourceFromStack() {
78
- const stack = new Error().stack;
79
- if (!stack) {
80
- return { filePath: undefined, callSource: 'unknown:0' };
81
- }
82
- const frame = parseStackTrace(stack).find(isUserCodeFrame);
83
- if (!frame?.file) {
84
- return { filePath: undefined, callSource: 'unknown:0' };
85
- }
86
- const filePath = normalizeFilePath(frame.file);
87
- return { filePath, callSource: `${filePath}:${frame.lineNumber ?? 0}` };
88
- }
89
- // Source-scan for `it/test/specify('title', ...)` (or `describe/context/suite`
90
- // when kind='suite'). Stack-walking from inside the runner's beforeEach
91
- // hooks doesn't reach the user's test body.
92
- import * as fs from 'node:fs';
93
- export function findTestLineInFile(filePath, title, kind = 'test') {
94
- try {
95
- if (!fs.existsSync(filePath)) {
96
- return null;
97
- }
98
- const lines = fs.readFileSync(filePath, 'utf-8').split('\n');
99
- const escaped = title.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
100
- const keywords = kind === 'suite' ? 'describe|context|suite' : 'it|test|specify';
101
- const re = new RegExp(`\\b(?:${keywords})\\s*\\(\\s*['"\`]${escaped}['"\`]`);
102
- for (let i = 0; i < lines.length; i++) {
103
- if (re.test(lines[i])) {
104
- return i + 1;
105
- }
106
- }
107
- }
108
- catch {
109
- /* ignore — fall back to file:0 */
110
- }
111
- return null;
112
- }
113
- export function isPortInUse(port, hostname) {
114
- return new Promise((resolve) => {
115
- const server = net.createServer();
116
- server.once('error', () => resolve(true));
117
- server.once('listening', () => server.close(() => resolve(false)));
118
- server.listen(port, hostname);
119
- });
120
- }
121
- export async function findFreePort(startPort, hostname) {
122
- let port = startPort;
123
- while (await isPortInUse(port, hostname)) {
124
- log.warn(`Port ${port} is in use, trying ${port + 1}...`);
125
- port++;
126
- }
127
- return port;
128
- }
129
- /**
130
- * Capture the command line that launched the current process so the UI's
131
- * "rerun" button can re-execute the same script. Falls back to the raw
132
- * argv when npm script context is unavailable.
133
- */
134
- /** Derive a human-readable request type from URL and MIME type. */
135
- export function getRequestType(url, mimeType) {
136
- const contentType = mimeType?.toLowerCase() ?? '';
137
- const urlLower = url.toLowerCase();
138
- if (contentType.includes('text/html')) {
139
- return 'document';
140
- }
141
- if (contentType.includes('text/css')) {
142
- return 'stylesheet';
143
- }
144
- if (contentType.includes('javascript') ||
145
- contentType.includes('ecmascript')) {
146
- return 'script';
147
- }
148
- if (contentType.includes('image/')) {
149
- return 'image';
150
- }
151
- if (contentType.includes('font/') || contentType.includes('woff')) {
152
- return 'font';
153
- }
154
- if (contentType.includes('application/json')) {
155
- return 'fetch';
156
- }
157
- if (urlLower.endsWith('.html') || urlLower.endsWith('.htm')) {
158
- return 'document';
159
- }
160
- if (urlLower.endsWith('.css')) {
161
- return 'stylesheet';
162
- }
163
- if (urlLower.endsWith('.js') || urlLower.endsWith('.mjs')) {
164
- return 'script';
165
- }
166
- if (/\.(png|jpg|jpeg|gif|svg|webp|ico)$/.test(urlLower)) {
167
- return 'image';
168
- }
169
- if (/\.(woff|woff2|ttf|eot|otf)$/.test(urlLower)) {
170
- return 'font';
171
- }
172
- return 'xhr';
173
- }
174
- export function captureLaunchCommand() {
175
- const npmScript = process.env.npm_lifecycle_event;
176
- const npmConfigUserAgent = process.env.npm_config_user_agent ?? '';
177
- if (npmScript) {
178
- const tool = npmConfigUserAgent.startsWith('pnpm')
179
- ? 'pnpm'
180
- : npmConfigUserAgent.startsWith('yarn')
181
- ? 'yarn'
182
- : 'npm';
183
- return tool === 'npm' ? `npm run ${npmScript}` : `${tool} ${npmScript}`;
184
- }
185
- return [process.argv0, ...process.argv.slice(1)].join(' ');
186
- }
187
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7E,MAAM,GAAG,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAA;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CACrD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AAE9B,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA;IACrD,KAAK,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,kBAAkB,EAAE,CAAC;QACpD,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,IAAc,EACd,IAAW,EACX,SAAiB,WAAW,CAAC,IAAI;IAEjC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,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C,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,IAAI,oCAAoC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxD,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,IAAI,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAA;IACjD,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAA;IAClE,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC;YAChD,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC;gBACrC,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,KAAK,CAAA;QACX,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,SAAS,EAAE,CAAA;IACzE,CAAC;IACD,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC5D,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ScreencastFrame, ScreencastOptions } from '../types.js';
2
- export declare function encodeToVideo(frames: ScreencastFrame[], outputPath: string, options?: Pick<ScreencastOptions, 'captureFormat'>): Promise<void>;