Skip to content

updated logs displaying #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.4.0
- updated logs displaying

## 0.3.0
- added support of named hooks

Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @qavajs/console-formatter

This is console formatter for cucumber framework
Console formatter for cucumber framework

### Installation
To install formatter run
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qavajs/console-formatter",
"version": "0.3.0",
"version": "0.4.0",
"description": "console formatter for cucumber framework",
"scripts": {
"test:e2e": "qavajs run --config test-e2e/config.js"
Expand Down Expand Up @@ -31,6 +31,6 @@
"devDependencies": {
"@cucumber/cucumber": "^9.2.0",
"@qavajs/cli": "^0.26.0",
"@qavajs/memory": "^1.5.1"
"@qavajs/memory": "^1.6.0"
}
}
10 changes: 5 additions & 5 deletions src/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ class PrettyFormatter extends Formatter {
drawStep(step) {
let line = this.indent + chalk.bold(this.statusIcons[step.testStepResult.status]) + ' ' + step.stepText;
line += ` ${chalk.gray(step.location)}`;
if (this.showLogs) {
for (const log of step.logs) {
line += `\n${this.indent}${log.body}`;
}
}
if (step.argument && step.argument.dataTable) {
line += `\n${this.drawDataTable(step.argument.dataTable)}`
}
Expand All @@ -171,6 +166,11 @@ class PrettyFormatter extends Formatter {
if ([Status.FAILED, Status.AMBIGUOUS].includes(step.testStepResult.status)) {
line += `\n${this.indent + step.testStepResult.message}`;
}
if (this.showLogs) {
for (const log of step.logs) {
line += chalk.reset(`\n${this.indent}LOG: ${log.body}`);
}
}
return chalk[this.statusColors[step.testStepResult.status]](line)
}

Expand Down