@tracelane/wdio 0.1.0-alpha.3 → 0.1.0-alpha.5
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 +47 -28
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
# @tracelane/wdio
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/@tracelane/wdio)
|
|
6
|
+
[](https://www.npmjs.com/package/@tracelane/wdio)
|
|
7
|
+
[](https://github.com/Cubenest/rrweb-stack/blob/main/LICENSE)
|
|
8
|
+
[](https://github.com/Cubenest/rrweb-stack/actions/workflows/ci.yml)
|
|
9
|
+
[](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
|
+
npm install --save-dev @tracelane/wdio
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// wdio.conf.ts
|
|
19
|
+
import TraceLaneService from '@tracelane/wdio';
|
|
20
|
+
|
|
21
|
+
export const config = {
|
|
22
|
+
// ...your existing config
|
|
23
|
+
services: [[TraceLaneService, { mode: 'failed' }]],
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
## What this is NOT
|
|
30
|
+
|
|
31
|
+
- 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.
|
|
32
|
+
- 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.
|
|
33
|
+
- 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.
|
|
34
|
+
|
|
35
|
+
## Full example
|
|
4
36
|
|
|
5
37
|
```ts
|
|
6
38
|
// wdio.conf.ts
|
|
@@ -32,14 +64,6 @@ export const config: Options.Testrunner = {
|
|
|
32
64
|
};
|
|
33
65
|
```
|
|
34
66
|
|
|
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
67
|
`webdriverio` and `@wdio/types` are **peer dependencies** (`^9.0.0`); you already have them in a WDIO project.
|
|
44
68
|
|
|
45
69
|
## How it works
|
|
@@ -66,7 +90,7 @@ The options type is published — `import type { TraceLaneOptions } from '@trace
|
|
|
66
90
|
|
|
67
91
|
## Hook-factory alternative (no Service)
|
|
68
92
|
|
|
69
|
-
For setups that can't register a Service, the **same logic** is available as plain `wdio.conf.ts` hook functions
|
|
93
|
+
For setups that can't register a Service, the **same logic** is available as plain `wdio.conf.ts` hook functions:
|
|
70
94
|
|
|
71
95
|
```ts
|
|
72
96
|
import { traceLaneHooks } from '@tracelane/wdio/hooks';
|
|
@@ -87,21 +111,9 @@ export const config: Options.Testrunner = {
|
|
|
87
111
|
};
|
|
88
112
|
```
|
|
89
113
|
|
|
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
114
|
## Network capture
|
|
103
115
|
|
|
104
|
-
Failed responses (`status >= 400`) are routed into the report's console timeline (prefixed `[tracelane.net]
|
|
116
|
+
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
117
|
|
|
106
118
|
- **WDIO 8:** add `['devtools', {}]` via `@wdio/devtools-service@8`.
|
|
107
119
|
- **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 +135,23 @@ Cloud Selenium vendors typically don't expose CDP; rrweb + console capture still
|
|
|
123
135
|
| Firefox | Yes | No (CDP is Chromium-only) |
|
|
124
136
|
| Safari | Yes | No |
|
|
125
137
|
|
|
126
|
-
##
|
|
138
|
+
## Playwright + Cypress
|
|
139
|
+
|
|
140
|
+
The tagline says Playwright and Cypress because the design is portable across runners — same `@tracelane/core` engine, different glue. Tracking issues:
|
|
141
|
+
|
|
142
|
+
- **`@tracelane/playwright`** — Playwright Reporter implementing `onTestEnd` + `onAttachment` for shareable HTML. Targeted for week 2-3 of the public launch.
|
|
143
|
+
- **`@tracelane/cypress`** — JSON-output adapter only (no Cypress Test Replay overlap). Targeted for week 11.
|
|
144
|
+
|
|
145
|
+
Watch the [release notes](https://github.com/Cubenest/rrweb-stack/releases) on `Cubenest/rrweb-stack` or follow `@cubenest_in` on X (when announced).
|
|
127
146
|
|
|
128
|
-
|
|
147
|
+
## Versioning & telemetry
|
|
129
148
|
|
|
130
|
-
|
|
149
|
+
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
150
|
|
|
132
|
-
|
|
151
|
+
**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
152
|
|
|
134
153
|
## License
|
|
135
154
|
|
|
136
155
|
Apache 2.0. The bundled rrweb engine + console plugin remain MIT-licensed; see `NOTICE`.
|
|
137
156
|
|
|
138
|
-
Contributions are accepted under the [Developer Certificate of Origin (DCO)](https://developercertificate.org/) — sign your commits with `git commit -s`.
|
|
157
|
+
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.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
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.
|
|
26
|
-
"@tracelane/report": "0.1.0-alpha.
|
|
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",
|