@tracelane/wdio 0.1.0-alpha.4 → 0.1.0-alpha.6

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 (2) hide show
  1. package/README.md +58 -28
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,49 @@
1
1
  # @tracelane/wdio
2
2
 
3
- A [WebdriverIO](https://webdriver.io) **Service** that records an [rrweb](https://www.rrweb.io)-grade session of your test run and, on a failed test, writes a **single self-contained `.html` report** to `./tracelane-reports/` — replay, console panel, and failed-network panel, all offline in one file.
3
+ > The reporter for your WebdriverIO, Playwright, and Cypress tests. Self-contained HTML for every run — replay failures, audit successes, attach to any bug tracker. No SaaS, no dashboard, no signup.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@tracelane/wdio.svg)](https://www.npmjs.com/package/@tracelane/wdio)
6
+ [![downloads](https://img.shields.io/npm/dw/@tracelane/wdio.svg)](https://www.npmjs.com/package/@tracelane/wdio)
7
+ [![license](https://img.shields.io/npm/l/@tracelane/wdio.svg)](https://github.com/Cubenest/rrweb-stack/blob/main/LICENSE)
8
+ [![CI](https://github.com/Cubenest/rrweb-stack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Cubenest/rrweb-stack/actions/workflows/ci.yml)
9
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Cubenest/rrweb-stack/badge)](https://scorecard.dev/viewer/?uri=github.com/Cubenest/rrweb-stack)
10
+
11
+ <!-- Hero GIF: run `vhs assets/tracelane-hero.tape` from repo root after the alpha.4 npm install fully resolves locally. See assets/README.md. -->
12
+
13
+ ```sh
14
+ cd your-wdio-project
15
+ npx tracelane init
16
+ ```
17
+
18
+ That's it. [`npx tracelane init`](https://www.npmjs.com/package/@tracelane/cli) detects your runner, installs `@tracelane/wdio`, edits `wdio.conf.ts` in place, and gitignores the reports directory. Idempotent (re-run is a no-op) and dry-runnable (`--dry-run`).
19
+
20
+ Run your suite. On a failing test you get a single `.html` file at `./tracelane-reports/<spec>--<title>--<cid>-<ts>.html` — open it in any browser, fully offline. Replay the run with [rrweb-player](https://www.rrweb.io), inspect the console + failed-network panels, attach to your bug tracker, archive it forever. No upload, no signup, no cloud.
21
+
22
+ ### Or wire it manually
23
+
24
+ ```sh
25
+ npm install --save-dev @tracelane/wdio
26
+ ```
27
+
28
+ ```ts
29
+ // wdio.conf.ts
30
+ import TraceLaneService from '@tracelane/wdio';
31
+
32
+ export const config = {
33
+ // ...your existing config
34
+ services: [[TraceLaneService, { mode: 'failed' }]],
35
+ };
36
+ ```
37
+
38
+ Same result — `npx tracelane init` is just the orchestration that does the lines above for you.
39
+
40
+ ## What this is NOT
41
+
42
+ - Not Cypress Cloud, Replay.io, or Sentry Session Replay. There is no SaaS to host. There is no signup. There is no dashboard. There is no telemetry. The artifact is a single HTML file on your filesystem.
43
+ - Not a reporter (in the `@wdio/reporter` sense). `tracelane` is a WDIO **Service** because only a Service can attach to the live browser, inject the rrweb recorder, drain the in-page buffer, and use CDP for network capture ([ADR-0004](https://github.com/Cubenest/rrweb-stack/blob/main/prds/adrs/0004-p1-wdio-service-not-reporter.md)). A paired Allure **Reporter** shim is planned for v1.1.
44
+ - Not just for failures. `mode: 'all'` writes a report for every test — useful as a CI artifact, evidence in a PR, or a "what changed between green and red" diff.
45
+
46
+ ## Full example
4
47
 
5
48
  ```ts
6
49
  // wdio.conf.ts
@@ -32,14 +75,6 @@ export const config: Options.Testrunner = {
32
75
  };
33
76
  ```
34
77
 
35
- Run your suite. On a failing Chrome+Mocha test you get `./tracelane-reports/<spec>--<title>--<cid>-<ts>.html` — open it in any browser, fully offline.
36
-
37
- ## Install
38
-
39
- ```sh
40
- pnpm add -D @tracelane/wdio webdriverio @wdio/cli @wdio/local-runner @wdio/mocha-framework
41
- ```
42
-
43
78
  `webdriverio` and `@wdio/types` are **peer dependencies** (`^9.0.0`); you already have them in a WDIO project.
44
79
 
45
80
  ## How it works
@@ -66,7 +101,7 @@ The options type is published — `import type { TraceLaneOptions } from '@trace
66
101
 
67
102
  ## Hook-factory alternative (no Service)
68
103
 
69
- For setups that can't register a Service, the **same logic** is available as plain `wdio.conf.ts` hook functions ([ADR-0004](https://github.com/Cubenest/rrweb-stack/blob/main/prds/adrs/0004-p1-wdio-service-not-reporter.md)):
104
+ For setups that can't register a Service, the **same logic** is available as plain `wdio.conf.ts` hook functions:
70
105
 
71
106
  ```ts
72
107
  import { traceLaneHooks } from '@tracelane/wdio/hooks';
@@ -87,21 +122,9 @@ export const config: Options.Testrunner = {
87
122
  };
88
123
  ```
89
124
 
90
- ## FAQ — Why is this a Service and not a Reporter?
91
-
92
- Because only a **Service** can do what `tracelane` needs ([ADR-0004](https://github.com/Cubenest/rrweb-stack/blob/main/prds/adrs/0004-p1-wdio-service-not-reporter.md)):
93
-
94
- | | Service (`Services.ServiceInstance`) | Reporter (`@wdio/reporter`) |
95
- |---|---|---|
96
- | Access to live `browser` in worker hooks | **Yes** | No — reporters run in the launcher process |
97
- | `browser.execute(...)` to inject rrweb / drain the buffer | **Yes** | No |
98
- | `browser.cdp(...)` for network capture | **Yes** | No |
99
-
100
- A Reporter receives only serialized lifecycle events (`testFail`, `testEnd`, …) in the launcher process — it has no page handle, so it can't inject rrweb, drain the in-page buffer, or attach CDP. (`wdio-allure-reporter` hit exactly this wall and had to add a runtime-side `addAttachment` helper to bridge browser access.) A paired Allure **Reporter** shim is planned for v1.1 to push `tracelane` artifacts into Allure's `addAttachment` API — that's a Reporter-shaped problem; capture is not.
101
-
102
125
  ## Network capture
103
126
 
104
- Failed responses (`status >= 400`) are routed into the report's console timeline (prefixed `[tracelane.net]`, [P1 PRD §E.2](https://github.com/Cubenest/rrweb-stack/blob/main/prds/compass_artifact_wf-d53d32da-17e9-41b5-bb70-21dd1bf648c6_text_markdown.md)). This needs `browser.cdp(...)`, which a separate WDIO service provides:
127
+ Failed responses (`status >= 400`) are routed into the report's console timeline (prefixed `[tracelane.net]`). This needs `browser.cdp(...)`, which a separate WDIO service provides:
105
128
 
106
129
  - **WDIO 8:** add `['devtools', {}]` via `@wdio/devtools-service@8`.
107
130
  - **WDIO 9:** `@wdio/devtools-service` has no stable v9 line (it stabilized at v10); use the v10 service or a CDP-capable session. **If `browser.cdp` is unavailable, `tracelane` degrades gracefully to rrweb + console capture** — the report is still produced, just without the network panel.
@@ -123,16 +146,23 @@ Cloud Selenium vendors typically don't expose CDP; rrweb + console capture still
123
146
  | Firefox | Yes | No (CDP is Chromium-only) |
124
147
  | Safari | Yes | No |
125
148
 
126
- ## Versioning
149
+ ## Playwright + Cypress
150
+
151
+ The tagline says Playwright and Cypress because the design is portable across runners — same `@tracelane/core` engine, different glue. Tracking issues:
152
+
153
+ - **`@tracelane/playwright`** — Playwright Reporter implementing `onTestEnd` + `onAttachment` for shareable HTML. Targeted for week 2-3 of the public launch.
154
+ - **`@tracelane/cypress`** — JSON-output adapter only (no Cypress Test Replay overlap). Targeted for week 11.
155
+
156
+ Watch the [release notes](https://github.com/Cubenest/rrweb-stack/releases) on `Cubenest/rrweb-stack` or follow `@cubenest_in` on X (when announced).
127
157
 
128
- Semantic Versioning. Currently `0.1.0-alpha.0` (pre-release; the API may shift before `1.0.0`).
158
+ ## Versioning & telemetry
129
159
 
130
- ## Telemetry
160
+ Semantic Versioning. Currently `0.1.0-alpha.x` (pre-release; the API may shift before `1.0.0`). See [SUPPORTED.md](https://github.com/Cubenest/rrweb-stack/blob/main/SUPPORTED.md) for the compatibility matrix.
131
161
 
132
- None. `tracelane` collects and sends nothing; reports are written to your local `outDir` only.
162
+ **No telemetry.** `tracelane` collects and sends nothing; reports are written to your local `outDir` only. The generated HTML report includes a footer crediting the tool; you can suppress it with `report: { footer: false }` (v1.1+).
133
163
 
134
164
  ## License
135
165
 
136
166
  Apache 2.0. The bundled rrweb engine + console plugin remain MIT-licensed; see `NOTICE`.
137
167
 
138
- Contributions are accepted under the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) — sign your commits with `git commit -s`.
168
+ Contributions are accepted under the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) — sign your commits with `git commit -s`. See [CONTRIBUTING.md](https://github.com/Cubenest/rrweb-stack/blob/main/CONTRIBUTING.md) + [SECURITY.md](https://github.com/Cubenest/rrweb-stack/blob/main/SECURITY.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracelane/wdio",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "WebdriverIO Service that records rrweb sessions and writes a self-contained HTML report on failed tests. The user-facing tracelane integration for WDIO.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@tracelane/core": "0.1.0-alpha.3",
26
- "@tracelane/report": "0.1.0-alpha.4"
25
+ "@tracelane/core": "0.1.0-alpha.4",
26
+ "@tracelane/report": "0.1.0-alpha.5"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@wdio/types": "^9.0.0",