@qualflare/cypress 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 +50 -11
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.cjs +142 -284
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +32 -29
- package/dist/plugin/index.d.ts +32 -29
- package/dist/plugin/index.js +142 -283
- package/dist/plugin/index.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @qualflare/cypress
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@qualflare/cypress)
|
|
4
|
+
[](https://github.com/Qualflare/qualflare-cypress/actions/workflows/ci.yml)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
A native Cypress reporter for [Qualflare](https://qualflare.com) — captures test results directly
|
|
4
8
|
from your Cypress run: suite/test status, real retry counts, screenshots, step-by-step command
|
|
5
|
-
traces, and author-facing metadata (labels, links, tags, custom attachments)
|
|
6
|
-
|
|
9
|
+
traces, and author-facing metadata (labels, links, tags, custom attachments) — and writes them into
|
|
10
|
+
a report directory that [`qualflare-cli`](https://github.com/Qualflare/qualflare-cli) uploads. No
|
|
11
|
+
post-hoc file parsing, no intermediate report format to hand-roll, no network access needed from
|
|
12
|
+
inside your Cypress run.
|
|
7
13
|
|
|
8
14
|
## Install
|
|
9
15
|
|
|
@@ -11,7 +17,17 @@ parsing, no intermediate report format.
|
|
|
11
17
|
npm install --save-dev @qualflare/cypress
|
|
12
18
|
```
|
|
13
19
|
|
|
14
|
-
Requires Cypress `>=12.0.0
|
|
20
|
+
Requires Cypress `>=12.0.0` (installed separately as a peer dependency). Node `>=18` for
|
|
21
|
+
Cypress 12–14; Cypress 15 itself requires Node `>=20`.
|
|
22
|
+
|
|
23
|
+
The peer range is deliberately open-ended rather than capped at a known-good major, so a new
|
|
24
|
+
Cypress release never hard-blocks `npm install` for you. Every major from 12 through 15 is
|
|
25
|
+
exercised in CI against a real `cypress run`; majors newer than that are untested but not
|
|
26
|
+
refused — please [open an issue](https://github.com/Qualflare/qualflare-cypress/issues) if
|
|
27
|
+
one misbehaves.
|
|
28
|
+
|
|
29
|
+
(Contributors: the repo itself now develops against Cypress 15, which requires Node `>=20.1`.
|
|
30
|
+
The `>=18` floor above is the *consumer* requirement and still holds for Cypress 12–14.)
|
|
15
31
|
|
|
16
32
|
## Quickstart
|
|
17
33
|
|
|
@@ -36,14 +52,26 @@ export default defineConfig({
|
|
|
36
52
|
import '@qualflare/cypress';
|
|
37
53
|
```
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
Run your tests as usual — every `cypress run` writes a Collect report (JSON, plus any video
|
|
56
|
+
attachments) into `./qualflare-results` by default. No token or network access is needed for this
|
|
57
|
+
step; the reporter itself never makes a network call:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npx cypress run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then, in the same CI job, hand that directory to `qualflare-cli` — the step that actually uploads
|
|
64
|
+
results, required after every run, sharded or not:
|
|
40
65
|
|
|
41
66
|
```sh
|
|
42
|
-
|
|
67
|
+
npm install -g @qualflare/cli
|
|
68
|
+
qf login my-project "$QUALFLARE_TOKEN" --force
|
|
69
|
+
qf my-project collect ./qualflare-results
|
|
43
70
|
```
|
|
44
71
|
|
|
45
|
-
That's it — suite/test results, retries, and automatic-on-failure screenshots
|
|
46
|
-
|
|
72
|
+
That's it — suite/test results, retries, and automatic-on-failure screenshots show up as one Launch
|
|
73
|
+
once `qualflare-cli collect` runs. [`examples/basic/`](./examples/basic) has a runnable project
|
|
74
|
+
demonstrating the same flow end to end, including the `qualflare.*` metadata API.
|
|
47
75
|
|
|
48
76
|
## Enriching your tests
|
|
49
77
|
|
|
@@ -75,10 +103,21 @@ Every option can be set either as a plugin option (`qualflareCypress(on, config,
|
|
|
75
103
|
`QUALFLARE_*` environment variable. Full table, precedence rules, and auto-detection behavior (git
|
|
76
104
|
branch/commit, CI provider/build/PR, browser/OS) in [`docs/CONFIGURATION.md`](./docs/CONFIGURATION.md).
|
|
77
105
|
|
|
106
|
+
One option is worth calling out because it fails late: `environment` is matched against the
|
|
107
|
+
environment's **uid (slug)**, not its display name, so **Staging** in the UI is `staging` here. A
|
|
108
|
+
wrong value cannot fail at run time — this package makes no network calls — so the run succeeds and
|
|
109
|
+
`collect` 404s afterwards. See
|
|
110
|
+
[the note in the configuration docs](./docs/CONFIGURATION.md#environment-is-matched-by-uid-not-display-name).
|
|
111
|
+
|
|
78
112
|
## Known limitations
|
|
79
113
|
|
|
80
|
-
- **
|
|
81
|
-
|
|
114
|
+
- **Sharded CI runs merge automatically, but only at collect time** — point every shard's
|
|
115
|
+
`cypress run` at the same shared `outputDir`; `qualflare-cli collect` merges every report file it
|
|
116
|
+
finds there into one Launch, no extra flag needed (see
|
|
117
|
+
[`docs/LIMITATIONS.md`](./docs/LIMITATIONS.md)).
|
|
118
|
+
- **A stale `outputDir` is refused, not merged** — each report carries a `runId`, and `qf collect`
|
|
119
|
+
errors rather than merging files from two different runs. Needs `@qualflare/cli` v0.1.19+; older
|
|
120
|
+
CLIs merge as before.
|
|
82
121
|
- **Command-log step nesting is two levels only** (Cypress's own API limit) — `qualflare.step()`
|
|
83
122
|
supports arbitrary nesting depth.
|
|
84
123
|
|
|
@@ -91,7 +130,7 @@ npm run typecheck # tsc --noEmit
|
|
|
91
130
|
npm run lint # eslint .
|
|
92
131
|
npm run build # tsup — dual ESM+CJS, .d.ts
|
|
93
132
|
npm test # unit tests (vitest)
|
|
94
|
-
npm run test:integration # spawns real cypress run against a fixture project
|
|
133
|
+
npm run test:integration # spawns a real cypress run against a fixture project, asserts on its outputDir report
|
|
95
134
|
```
|
|
96
135
|
|
|
97
136
|
Release process: see [`RELEASING.md`](./RELEASING.md).
|
package/dist/index.cjs
CHANGED