@digital-commons-official/codeceptjs-storyboard 0.4.9 → 0.4.11
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 +3 -1
- package/package.json +1 -1
- package/src/index.js +4 -4
package/README.md
CHANGED
|
@@ -183,7 +183,9 @@ The [multilingual storyboard](tests/e2e/storyboards/05-languages/storyboard-lang
|
|
|
183
183
|
TASK_E2E_UPDATE_BASELINES=1 npx codeceptjs run
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
Only the exact value `1` enables recording. An empty value, `0` or `false` keeps
|
|
187
|
+
strict comparison. Every baseline written in recording mode must be inspected
|
|
188
|
+
by a human, which is why that mode throws when `CI` is set.
|
|
187
189
|
|
|
188
190
|
## API 📚
|
|
189
191
|
|
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.11",
|
|
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",
|
package/src/index.js
CHANGED
|
@@ -214,10 +214,10 @@ function assertFrameNotEmpty (png) {
|
|
|
214
214
|
* visual regression.
|
|
215
215
|
*/
|
|
216
216
|
async function assertOrUpdateBaseline (I, baselineName) {
|
|
217
|
-
if (process.env.TASK_E2E_UPDATE_BASELINES && process.env.CI) {
|
|
217
|
+
if (process.env.TASK_E2E_UPDATE_BASELINES === '1' && process.env.CI) {
|
|
218
218
|
throw new Error('TASK_E2E_UPDATE_BASELINES is forbidden in CI — baselines must be regenerated and inspected locally')
|
|
219
219
|
}
|
|
220
|
-
if (process.env.TASK_E2E_UPDATE_BASELINES) {
|
|
220
|
+
if (process.env.TASK_E2E_UPDATE_BASELINES === '1') {
|
|
221
221
|
// tryTo: the recorder marks the test failed on a plain try/catch around
|
|
222
222
|
// an actor call; tryTo is the supported way to probe an assert. Since
|
|
223
223
|
// CodeceptJS 4 it is no longer a plugin exposing a global — it is an
|
|
@@ -857,7 +857,7 @@ module.exports = function storyboardPlugin (config = {}) {
|
|
|
857
857
|
sentence: failure && failure.frame ? failure.frame.sentence : ''
|
|
858
858
|
})
|
|
859
859
|
if (failure && failure.frame) logVisualRegression(failure.frame, outputSvg)
|
|
860
|
-
if (passed && process.env.TASK_E2E_UPDATE_BASELINES) {
|
|
860
|
+
if (passed && process.env.TASK_E2E_UPDATE_BASELINES === '1') {
|
|
861
861
|
render(path.join(global.codecept_dir, 'storyboards', `${board.baseDir}.svg`), {
|
|
862
862
|
imageDir: path.join(global.codecept_dir, 'screenshots', 'base', board.baseDir)
|
|
863
863
|
})
|
|
@@ -874,7 +874,7 @@ module.exports = function storyboardPlugin (config = {}) {
|
|
|
874
874
|
try {
|
|
875
875
|
const stories = [...entries.values()]
|
|
876
876
|
writeGallery(path.join(global.codecept_dir, '_output'), stories)
|
|
877
|
-
if (process.env.TASK_E2E_UPDATE_BASELINES && !process.env.CI) {
|
|
877
|
+
if (process.env.TASK_E2E_UPDATE_BASELINES === '1' && !process.env.CI) {
|
|
878
878
|
writeGallery(path.join(global.codecept_dir, 'storyboards'), stories.filter(entry => entry.passed))
|
|
879
879
|
}
|
|
880
880
|
} catch (err) {
|