@tracelane/wdio 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +87 -40
- package/dist/hooks.d.ts +8 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +9 -4
- package/dist/hooks.js.map +1 -1
- package/dist/options.d.ts +52 -2
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js.map +1 -1
- package/dist/rrweb-bundle.js +49 -49
- package/dist/security-suppress.d.ts +10 -0
- package/dist/security-suppress.d.ts.map +1 -0
- package/dist/security-suppress.js +58 -0
- package/dist/security-suppress.js.map +1 -0
- package/dist/service.d.ts +33 -8
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +36 -7
- package/dist/service.js.map +1 -1
- package/dist/tracelane-session.d.ts +11 -1
- package/dist/tracelane-session.d.ts.map +1 -1
- package/dist/tracelane-session.js +44 -8
- package/dist/tracelane-session.js.map +1 -1
- package/package.json +27 -5
- package/dist/inpage-bundle.d.ts +0 -9
- package/dist/inpage-bundle.d.ts.map +0 -1
- package/dist/inpage-bundle.js +0 -47
- package/dist/inpage-bundle.js.map +0 -1
- package/dist/network-capture.d.ts +0 -25
- package/dist/network-capture.d.ts.map +0 -1
- package/dist/network-capture.js +0 -56
- package/dist/network-capture.js.map +0 -1
- package/dist/report-writer.d.ts +0 -36
- package/dist/report-writer.d.ts.map +0 -1
- package/dist/report-writer.js +0 -56
- package/dist/report-writer.js.map +0 -1
package/dist/report-writer.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { eventWithTime } from '@cubenest/rrweb-core';
|
|
2
|
-
import { type ReportMeta } from '@tracelane/report';
|
|
3
|
-
/** Inputs for {@link writeReport}. */
|
|
4
|
-
export interface WriteReportInput {
|
|
5
|
-
/** Output directory (created if missing). */
|
|
6
|
-
outDir: string;
|
|
7
|
-
/** Worker capability id (e.g. `0-0`); namespaces the filename for parallel safety. */
|
|
8
|
-
cid?: string | undefined;
|
|
9
|
-
/** Captured rrweb event stream. */
|
|
10
|
-
events: eventWithTime[];
|
|
11
|
-
/** Report metadata (spec, title, status, error, browser, ...). */
|
|
12
|
-
meta: ReportMeta;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Turn an arbitrary spec path / test title into a filesystem-safe slug:
|
|
16
|
-
* lowercase, non-alphanumerics collapsed to single dashes, trimmed, capped.
|
|
17
|
-
*/
|
|
18
|
-
export declare function slugify(input: string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Build a unique-ish report filename: `<spec>--<title>--<cid>-<ts>.html`. The
|
|
21
|
-
* timestamp + cid keep retries and parallel workers from overwriting each other.
|
|
22
|
-
*/
|
|
23
|
-
export declare function reportFileName(meta: ReportMeta, cid?: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Slug for the spec segment: take the file's basename (so an absolute path like
|
|
26
|
-
* `/repo/test/login.spec.ts` doesn't bloat the filename), then strip the common
|
|
27
|
-
* test-file suffixes (`.spec.ts`, `.test.mts`, `.e2e.js`, …) so it slugifies to
|
|
28
|
-
* a clean `login`, not `login-spec`.
|
|
29
|
-
*/
|
|
30
|
-
export declare function specSlug(spec: string): string;
|
|
31
|
-
/**
|
|
32
|
-
* Build the report HTML and write it under `outDir`, namespaced by `cid`.
|
|
33
|
-
* Returns the absolute-or-relative path written (as `join` produced it).
|
|
34
|
-
*/
|
|
35
|
-
export declare function writeReport(input: WriteReportInput): string;
|
|
36
|
-
//# sourceMappingURL=report-writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"report-writer.d.ts","sourceRoot":"","sources":["../src/report-writer.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,mBAAmB,CAAC;AAEjE,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,mCAAmC;IACnC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,kEAAkE;IAClE,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO7C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAS3D"}
|
package/dist/report-writer.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Write a self-contained HTML report to disk (ADR-0005 / ADR-0006).
|
|
2
|
-
//
|
|
3
|
-
// Given the captured event stream + metadata, call @tracelane/report's
|
|
4
|
-
// buildReport to produce the offline HTML string, then write it under `outDir`.
|
|
5
|
-
// Files are namespaced by `cid` (the WDIO worker capability id) so parallel
|
|
6
|
-
// workers (`maxInstances > 1`) never collide (ADR-0006 action item #6).
|
|
7
|
-
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
import { buildReport } from '@tracelane/report';
|
|
10
|
-
/**
|
|
11
|
-
* Turn an arbitrary spec path / test title into a filesystem-safe slug:
|
|
12
|
-
* lowercase, non-alphanumerics collapsed to single dashes, trimmed, capped.
|
|
13
|
-
*/
|
|
14
|
-
export function slugify(input) {
|
|
15
|
-
const slug = input
|
|
16
|
-
.toLowerCase()
|
|
17
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
18
|
-
.replace(/^-+|-+$/g, '');
|
|
19
|
-
// Cap length so deeply-nested titles don't blow past filesystem name limits.
|
|
20
|
-
return (slug || 'report').slice(0, 120);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Build a unique-ish report filename: `<spec>--<title>--<cid>-<ts>.html`. The
|
|
24
|
-
* timestamp + cid keep retries and parallel workers from overwriting each other.
|
|
25
|
-
*/
|
|
26
|
-
export function reportFileName(meta, cid) {
|
|
27
|
-
const specPart = meta.spec ? specSlug(meta.spec) : 'spec';
|
|
28
|
-
const titlePart = slugify(meta.title);
|
|
29
|
-
const cidPart = cid ? `${slugify(cid)}-` : '';
|
|
30
|
-
return `${specPart}--${titlePart}--${cidPart}${Date.now()}.html`;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Slug for the spec segment: take the file's basename (so an absolute path like
|
|
34
|
-
* `/repo/test/login.spec.ts` doesn't bloat the filename), then strip the common
|
|
35
|
-
* test-file suffixes (`.spec.ts`, `.test.mts`, `.e2e.js`, …) so it slugifies to
|
|
36
|
-
* a clean `login`, not `login-spec`.
|
|
37
|
-
*/
|
|
38
|
-
export function specSlug(spec) {
|
|
39
|
-
const base = spec.replace(/^.*[/\\]/, '');
|
|
40
|
-
return slugify(base.replace(/(\.(spec|test|e2e|cy))?\.[cm]?[jt]sx?$/, ''));
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Build the report HTML and write it under `outDir`, namespaced by `cid`.
|
|
44
|
-
* Returns the absolute-or-relative path written (as `join` produced it).
|
|
45
|
-
*/
|
|
46
|
-
export function writeReport(input) {
|
|
47
|
-
const { outDir, cid, events, meta } = input;
|
|
48
|
-
const html = buildReport(events, meta);
|
|
49
|
-
if (!existsSync(outDir)) {
|
|
50
|
-
mkdirSync(outDir, { recursive: true });
|
|
51
|
-
}
|
|
52
|
-
const filePath = join(outDir, reportFileName(meta, cid));
|
|
53
|
-
writeFileSync(filePath, html);
|
|
54
|
-
return filePath;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=report-writer.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