Skip to content

Commit

Permalink
Replace cucumber-json-formatter with native components
Browse files Browse the repository at this point in the history
This relates to #795, #827, #870, #966, #967.

It also fixes #849.
  • Loading branch information
badeball committed Mar 19, 2023
1 parent cc184be commit 0f47be5
Show file tree
Hide file tree
Showing 22 changed files with 234 additions and 208 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## Unreleased

- Correctly set `willBeRetried` in messages reports, fixes [#849](https:/badeball/cypress-cucumber-preprocessor/issues/849).

- Replace [cucumber-json-formatter](https:/cucumber/json-formatter) with native components, relates to [#795](https:/badeball/cypress-cucumber-preprocessor/issues/795), [#827](https:/badeball/cypress-cucumber-preprocessor/issues/827), [#870](https:/badeball/cypress-cucumber-preprocessor/issues/870), [#966](https:/badeball/cypress-cucumber-preprocessor/issues/966) and [#967](https:/badeball/cypress-cucumber-preprocessor/issues/967).

## v15.1.5

- Correctly escape injected values to glob patterns, fixes [#946](https:/badeball/cypress-cucumber-preprocessor/issues/946).
Expand Down
14 changes: 0 additions & 14 deletions docs/json-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ JSON reports can be enabled using the `json.enabled` property. The preprocessor
}
```

This **requires** you to have downloaded and installed the [cucumber-json-formatter](https:/cucumber/json-formatter) **yourself**. Arch Linux users can install it from [AUR](https://aur.archlinux.org/packages/cucumber-json-formatter).

The location of the executable is configurable through the `json.formatter` property, but it will by default search for `cucumber-json-formatter` in your `PATH`.

The report is outputted to `cucumber-report.json` in the project directory, but can be configured through the `json.output` property.

## Screenshots
Expand Down Expand Up @@ -61,13 +57,3 @@ Given("a step", function() {
attach("Zm9vYmFy", "base64:text/plain");
});
```

## Known issues

Some issues with `cucumber-json-formatter` are known and don't need to be reported again.

- Inaccurate output of `match` on undefined step definition (https:/cucumber/json-formatter/issues/2)

- Inaccurate output of retried scenarios (https:/cucumber/json-formatter/issues/4)

- Inaccurate output of scenario outlined with parameterized name (https:/cucumber/json-formatter/issues/25)
3 changes: 3 additions & 0 deletions features/fixtures/attachments/screenshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -28,13 +29,15 @@
]
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
13 changes: 7 additions & 6 deletions features/fixtures/failing-after.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -20,26 +21,26 @@
"match": {
"location": "not available:0"
}
}
],
"after": [
},
{
"keyword": "After",
"hidden": true,
"result": {
"status": "failed",
"duration": 0,
"error_message": "some error"
},
"match": {
"location": "not available:0"
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
18 changes: 10 additions & 8 deletions features/fixtures/failing-before.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,39 @@
"keyword": "Scenario",
"line": 2,
"name": "a scenario",
"before": [
"steps": [
{
"keyword": "Before",
"hidden": true,
"result": {
"status": "failed",
"duration": 0,
"error_message": "some error"
},
"match": {
"location": "not available:0"
}
}
],
"steps": [
},
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
"result": {
"status": "skipped"
"status": "skipped",
"duration": 0
},
"match": {
"location": "not available:0"
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
8 changes: 7 additions & 1 deletion features/fixtures/failing-step.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,42 @@
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a failing step",
"result": {
"status": "failed",
"duration": 0,
"error_message": "some error"
},
"match": {
"location": "not available:0"
}
},
{
"arguments": [],
"keyword": "And ",
"line": 4,
"name": "another step",
"result": {
"status": "skipped"
"status": "skipped",
"duration": 0
},
"match": {
"location": "not available:0"
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
6 changes: 6 additions & 0 deletions features/fixtures/multiple-features.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -22,13 +23,15 @@
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
},
{
Expand All @@ -42,6 +45,7 @@
"name": "another scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -54,13 +58,15 @@
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "another-feature",
"keyword": "Feature",
"line": 1,
"name": "another feature",
"tags": [],
"uri": "cypress/e2e/b.feature"
}
]
37 changes: 37 additions & 0 deletions features/fixtures/parameterized-scenario-name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;foo",
"keyword": "Scenario Outline",
"line": 7,
"name": "foo",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "passed",
"duration": 0
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"line": 1,
"keyword": "Feature",
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
3 changes: 3 additions & 0 deletions features/fixtures/passed-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -22,13 +23,15 @@
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
9 changes: 7 additions & 2 deletions features/fixtures/passed-outline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"elements": [
{
"description": "",
"id": "a-feature;a-scenario;;2",
"id": "a-feature;a-scenario",
"keyword": "Scenario Outline",
"line": 6,
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -22,16 +23,18 @@
}
}
],
"tags": [],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;a-scenario;;3",
"id": "a-feature;a-scenario",
"keyword": "Scenario Outline",
"line": 7,
"name": "a scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
Expand All @@ -44,13 +47,15 @@
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
Loading

0 comments on commit 0f47be5

Please sign in to comment.