@digital-commons-official/codeceptjs-storyboard 0.4.7 → 0.4.9
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 +21 -1
- package/package.json +2 -2
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -1
package/README.md
CHANGED
|
@@ -64,6 +64,25 @@ When the run ends, open `_output/index.html` to browse its storyboards. The page
|
|
|
64
64
|
|
|
65
65
|
A filtered run lists only the scenarios it ran. In baseline-update mode, `storyboards/index.html` lists the passing scenarios from that update; failed scenarios never replace reviewed storyboards. Run the full suite in update mode to rebuild the complete reviewed gallery.
|
|
66
66
|
|
|
67
|
+
### Replay commands
|
|
68
|
+
|
|
69
|
+
The gallery and SVG default to `npx codeceptjs run --steps --grep "{tag}"`.
|
|
70
|
+
`{tag}` becomes the scenario's last tag. This command works in a standalone
|
|
71
|
+
CodeceptJS project with a local installation and its default configuration file.
|
|
72
|
+
|
|
73
|
+
Toolbox projects can set their Task command on the plugin:
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
storyboard: {
|
|
77
|
+
require: '@digital-commons-official/codeceptjs-storyboard',
|
|
78
|
+
enabled: true,
|
|
79
|
+
replayCommand: 'task test -- --grep "{tag}"'
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For another configuration file, include its `--config` argument in the template.
|
|
84
|
+
Use a unique scenario tag so the command selects the intended journey.
|
|
85
|
+
|
|
67
86
|
### Colours and fonts
|
|
68
87
|
|
|
69
88
|
Set `theme` on the storyboard plugin to an object, a CSS file path, or an HTTP(S) URL:
|
|
@@ -202,7 +221,8 @@ It opens the generated `index.html` and SVG, repeats the run with strict baselin
|
|
|
202
221
|
|
|
203
222
|
The [consumer manifest](tests/e2e/consumer/package.json) pins those tools and overrides vulnerable transitive dependencies. Its lockfile makes the test repeatable. This verifies that combination; the wider peer dependency ranges are not a tested version matrix. The complete installation and run logs are kept in `tests/e2e/_output/consumer-install.log`.
|
|
204
223
|
|
|
205
|
-
|
|
224
|
+
The clean-consumer test also copies the replay command from the generated gallery
|
|
225
|
+
and executes it unchanged, then checks that every strict baseline hash is intact.
|
|
206
226
|
|
|
207
227
|
## Licence 📜
|
|
208
228
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-commons-official/codeceptjs-storyboard",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Storyboard plugin for CodeceptJS: one Gherkin sentence = one card = one pixel baseline, and every scenario renders itself as a single SVG storyboard",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"url": "git+https://gitlab.com/digital-commons/software/libraries/npm/codeceptjs-storyboard.git"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cucumber/gherkin": "^
|
|
26
|
+
"@cucumber/gherkin": "^42.0.0",
|
|
27
27
|
"pngjs": "^7.0.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
package/src/index.d.ts
CHANGED
|
@@ -91,6 +91,8 @@ export interface Theme {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export interface StoryboardConfig {
|
|
94
|
+
/** Replay command template; {tag} is the scenario's last tag. Defaults to npx codeceptjs run --steps --grep "{tag}". */
|
|
95
|
+
replayCommand?: string
|
|
94
96
|
/** Theme object, CSS file relative to codecept.conf.js, or HTTP(S) CSS URL. */
|
|
95
97
|
theme?: Theme | string
|
|
96
98
|
[option: string]: unknown
|
package/src/index.js
CHANGED
|
@@ -781,6 +781,7 @@ function logVisualRegression (frame, outputSvg) {
|
|
|
781
781
|
// ---------------------------------------------------------------------------
|
|
782
782
|
module.exports = function storyboardPlugin (config = {}) {
|
|
783
783
|
const { event, recorder } = require('codeceptjs')
|
|
784
|
+
const replayCommand = config.replayCommand ?? 'npx codeceptjs run --steps --grep "{tag}"'
|
|
784
785
|
const writeGallery = require('./gallery')
|
|
785
786
|
const entries = new Map()
|
|
786
787
|
let themePromise
|
|
@@ -816,7 +817,7 @@ module.exports = function storyboardPlugin (config = {}) {
|
|
|
816
817
|
featureFile: test.file,
|
|
817
818
|
occurrence: Math.max(0, (test.parent.tests || []).filter(other => other.title === test.title).indexOf(test)),
|
|
818
819
|
baseDir: base,
|
|
819
|
-
rerun: tag ?
|
|
820
|
+
rerun: tag ? replayCommand.replaceAll('{tag}', tag) : ''
|
|
820
821
|
})
|
|
821
822
|
if (board.exampleLine) board.baseDir += `-example-${board.exampleLine}`
|
|
822
823
|
if (config.theme) {
|