Skip to content

Commit

Permalink
fix: status of step when error is thrown for children without steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Shevtsov committed Jul 14, 2020
1 parent 9c57c40 commit 08b94ae
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions reporter/mocha-allure/AllureReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,20 +526,23 @@ module.exports = class AllureReporter {
}

cyCommandEndStep(step, log, commandStatus) {
const passed =
let passed =
commandStatus !== undefined
? commandStatus
: log.state !== 'failed';

step.info.stage = Stage.FINISHED;
step.info.status = passed ? Status.PASSED : Status.FAILED;

log &&
log.err &&
(step.info.statusDetails = {
if (log && log.err) {
step.info.statusDetails = {
message: log.err.message,
trace: log.err.sourceMappedStack || log.err.stack
});
};
passed = false;
}

step.info.status = passed ? Status.PASSED : Status.FAILED;

log.name !== 'step' && step.endStep();
return passed;
}
Expand Down

0 comments on commit 08b94ae

Please sign in to comment.