Skip to content

Commit c950064

Browse files
Fix screenshots saving to report and publish 1.0.14
1 parent 2885cd8 commit c950064

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
### 1.0.13
1+
### 1.0.14
2+
3+
- Accidently broke I.saveScreenshot calls saving to report, with the metaStep addition in 1.0.13. This fix allows both metaStep screenshot calls and the native codecept I.saveScreenshot to work with the report.
4+
5+
---
6+
7+
8+
### 1.0.13 (deprecated)
29

310
- Update after step hook to check metaStep for saveScreenshot call. [PR #11](https://github.com/ktryniszewski-mdsol/codeceptjs-cucumber-json-reporter/pull/11)
411

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ module.exports = function (config) {
7575
});
7676

7777
event.dispatcher.on(event.step.finished, (step) => {
78-
if (getRootMetaStep(step).helperMethod === 'saveScreenshot') {
78+
if (step.helperMethod === 'saveScreenshot') {
79+
const filePath = path.join(global.output_dir, step.args[0]);
80+
addScreenshotToReport(filePath);
81+
} else if (getRootMetaStep(step).helperMethod === 'saveScreenshot') {
7982
const filePath = path.join(global.output_dir, getRootMetaStep(step).args[0]);
8083
addScreenshotToReport(filePath);
8184
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeceptjs-cucumber-json-reporter",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"description": "CodeceptJS plugin to generate a cucumberjs json output",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)