@qualflare/cucumberjs 0.1.0 → 0.3.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 CHANGED
@@ -4,10 +4,14 @@
4
4
  [![CI](https://github.com/Qualflare/qualflare-cucumberjs/actions/workflows/ci.yml/badge.svg)](https://github.com/Qualflare/qualflare-cucumberjs/actions/workflows/ci.yml)
5
5
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
6
6
 
7
- A native CucumberJS reporter for [Qualflare](https://qualflare.com) — uploads test results directly
8
- from your `cucumber-js` run: Feature/Scenario status, real retry counts, screenshots, Given/When/Then
9
- step traces, Scenario Outline rows, and author-facing metadata (labels, links, tags, custom
10
- attachments). No post-hoc file parsing, no intermediate report format.
7
+ A native CucumberJS reporter for [Qualflare](https://qualflare.com) — captures test results directly
8
+ from your `cucumber-js` run: Feature/Scenario status, real retry counts, screenshots, videos,
9
+ Given/When/Then step traces, Scenario Outline rows, and author-facing metadata (labels, links, tags,
10
+ custom attachments).
11
+
12
+ The formatter itself makes **no network calls**. It writes a report directory, and
13
+ [`qualflare-cli`](https://github.com/Qualflare/qualflare-cli) uploads it — which is what lets any
14
+ number of sharded CI jobs merge into a single Launch.
11
15
 
12
16
  ## Install
13
17
 
@@ -15,8 +19,15 @@ attachments). No post-hoc file parsing, no intermediate report format.
15
19
  npm install --save-dev @qualflare/cucumberjs
16
20
  ```
17
21
 
18
- Requires `@cucumber/cucumber` `>=10.8.0 <14` (installed separately as a peer dependency) and Node
19
- `>=18`.
22
+ Requires `@cucumber/cucumber` `>=10.8.0` (installed separately as a peer dependency) and Node
23
+ `>=18`. You also need [`qualflare-cli`](https://github.com/Qualflare/qualflare-cli) **v0.1.16 or
24
+ newer** to upload what this formatter writes.
25
+
26
+ The peer range is deliberately open-ended rather than capped at a known-good major, so a new
27
+ cucumber-js release never hard-blocks `npm install` for you. Every major from 10.8 through 13 is
28
+ exercised in CI against a real `cucumber-js` run; newer majors are untested but not refused —
29
+ please [open an issue](https://github.com/Qualflare/qualflare-cucumberjs/issues) if one
30
+ misbehaves.
20
31
 
21
32
  ## Quickstart
22
33
 
@@ -32,15 +43,35 @@ Requires `@cucumber/cucumber` `>=10.8.0 <14` (installed separately as a peer dep
32
43
  }
33
44
  ```
34
45
 
35
- Set your token via the `QUALFLARE_TOKEN` environment variable (or the `token` format option):
46
+ Then run your tests and upload the results two steps, no token needed for the first:
36
47
 
37
48
  ```sh
38
- QUALFLARE_TOKEN=<your-token> npx cucumber-js
49
+ # 1. Run. Writes ./qualflare-results (JSON + any videos). Zero network calls.
50
+ npx cucumber-js
51
+
52
+ # 2. Upload. `qf login <identifier> <token>` stores the credential once.
53
+ qf <your-project-identifier> collect ./qualflare-results
39
54
  ```
40
55
 
41
- That's it — Feature/Scenario results, retries, and any screenshots you already attach upload as one
42
- Launch at the end of the run. See [`examples/basic/`](./examples/basic) for a complete runnable
43
- project.
56
+ That's it — Feature/Scenario results, retries, and any screenshots you already attach arrive as one
57
+ Launch. See [`examples/basic/`](./examples/basic) for a complete runnable project.
58
+
59
+ ### Sharded CI
60
+
61
+ Point every shard at the **same** `outputDir` and collect once at the end. Each process writes its
62
+ own uniquely-named file, so shards never overwrite each other, and `qf collect` merges every file
63
+ in the directory into a single Launch:
64
+
65
+ ```sh
66
+ # in each parallel job — note they all write to the same directory
67
+ npx cucumber-js --shard "$SHARD_INDEX/$SHARD_TOTAL"
68
+
69
+ # once, after all shards finish (e.g. with the directory restored from CI artifacts)
70
+ qf <your-project-identifier> collect ./qualflare-results
71
+ ```
72
+
73
+ No `--shard` flag is needed on the CLI side: merging is driven purely by which files are in the
74
+ directory.
44
75
 
45
76
  ## Enriching your tests
46
77
 
@@ -75,11 +106,21 @@ Every option can be set either as a `formatOptions` entry or via a `QUALFLARE_*`
75
106
  variable. Full table, precedence rules, and auto-detection behavior (git branch/commit, CI
76
107
  provider/build/PR) in [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md).
77
108
 
109
+ One option is worth calling out because it fails late: `environment` is matched against the
110
+ environment's **uid (slug)**, not its display name, so **Staging** in the UI is `staging` here. A
111
+ wrong value cannot fail at run time — this package makes no network calls — so the run succeeds and
112
+ `collect` 404s afterwards. See
113
+ [the note in the configuration docs](./docs/CONFIGURATION.md#environment-is-matched-by-uid-not-display-name).
114
+
78
115
  ## Known limitations
79
116
 
80
- - **No video upload** — Qualflare has no blob/video-attachment storage yet.
81
- - **One `cucumber-js` process uploads as one Launch** sharded (`--shard`) CI setups get multiple
82
- Launches; `--parallel` does not, since it runs in-process worker threads.
117
+ - **A stale `outputDir` is refused, not merged** — each report carries a `runId`, and `qf collect`
118
+ errors rather than merging files from two different runs. Needs `@qualflare/cli` v0.1.19+; older
119
+ CLIs merge as before.
120
+ - **`shardIndex` is best-effort** — cucumber-js routes its own `--shard` flag somewhere a formatter
121
+ cannot read, so it is recovered from `QUALFLARE_SHARD_INDEX` or by scanning `process.argv`. It is
122
+ only an attribution label; merging never depends on it. See
123
+ [`docs/LIMITATIONS.md`](./docs/LIMITATIONS.md).
83
124
  - **Doc Strings and Data Tables** have no dedicated wire field — encoded as a step `Parameter`
84
125
  (workaround, not a first-class rendering).
85
126
  - **`BeforeStep`/`AfterStep` hooks are off by default** (`includeStepHooks`) — noisy for suites with