Skip to content

Commit

Permalink
Include skipped (not omitted) tests in reports
Browse files Browse the repository at this point in the history
This fixes #1041 [1].

[1] #1041
  • Loading branch information
badeball committed Jun 23, 2024
1 parent f343cc3 commit 15b2aa5
Show file tree
Hide file tree
Showing 15 changed files with 929 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## Unreleased

- Include skipped (not omitted) tests in reports, fixes [#1041](https://github.com/badeball/cypress-cucumber-preprocessor/issues/1041).

## v20.0.7

- Updated all dependencies, fixes [#1198](https://github.com/badeball/cypress-cucumber-preprocessor/issues/1198).
Expand Down
100 changes: 100 additions & 0 deletions features/fixtures/skipped-all-scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;first-scenario",
"keyword": "Scenario",
"line": 3,
"name": "first scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 4,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "skipped",
"duration": 0
}
}
],
"tags": [
{
"name": "@skip",
"line": 2
}
],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;second-scenario",
"keyword": "Scenario",
"line": 6,
"name": "second scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 7,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "skipped",
"duration": 0
}
}
],
"tags": [
{
"name": "@skip",
"line": 5
}
],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;third-scenario",
"keyword": "Scenario",
"line": 9,
"name": "third scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 10,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "skipped",
"duration": 0
}
}
],
"tags": [
{
"name": "@skip",
"line": 8
}
],
"type": "scenario"
}
],
"id": "a-feature",
"line": 1,
"keyword": "Feature",
"name": "a feature",
"tags": [],
"uri": "cypress/e2e/a.feature"
}
]
24 changes: 24 additions & 0 deletions features/fixtures/skipped-all-scenarios.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{"meta":"meta"}
{"testRunStarted":{"timestamp":{"seconds":0,"nanos":0}}}
{"source":{"data":"Feature: a feature\n @skip\n Scenario: first scenario\n Given a step\n @skip\n Scenario: second scenario\n Given a step\n @skip\n Scenario: third scenario\n Given a step","uri":"cypress/e2e/a.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"a feature","description":"","children":[{"scenario":{"id":"id","tags":[{"location":{"line":2,"column":3},"name":"@skip","id":"id"}],"location":{"line":3,"column":3},"keyword":"Scenario","name":"first scenario","description":"","steps":[{"id":"id","location":{"line":4,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[{"location":{"line":5,"column":3},"name":"@skip","id":"id"}],"location":{"line":6,"column":3},"keyword":"Scenario","name":"second scenario","description":"","steps":[{"id":"id","location":{"line":7,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[{"location":{"line":8,"column":3},"name":"@skip","id":"id"}],"location":{"line":9,"column":3},"keyword":"Scenario","name":"third scenario","description":"","steps":[{"id":"id","location":{"line":10,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}}]},"comments":[],"uri":"cypress/e2e/a.feature"}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[{"name":"@skip","astNodeId":"id"}],"name":"first scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[{"name":"@skip","astNodeId":"id"}],"name":"second scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[{"name":"@skip","astNodeId":"id"}],"name":"third scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"stepDefinition":{"id":"id","pattern":{"type":"CUCUMBER_EXPRESSION","source":"a step"},"sourceReference":{"uri":"not available","location":{"line":0}}}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"SKIPPED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"SKIPPED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"SKIPPED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testRunFinished":{"timestamp":{"seconds":0,"nanos":0}}}
90 changes: 90 additions & 0 deletions features/fixtures/skipped-first-scenario.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;first-scenario",
"keyword": "Scenario",
"line": 3,
"name": "first scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 4,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "skipped",
"duration": 0
}
}
],
"tags": [
{
"name": "@skip",
"line": 2
}
],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;second-scenario",
"keyword": "Scenario",
"line": 5,
"name": "second scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 6,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "passed",
"duration": 0
}
}
],
"tags": [],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;third-scenario",
"keyword": "Scenario",
"line": 7,
"name": "third scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 8,
"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"
}
]
24 changes: 24 additions & 0 deletions features/fixtures/skipped-first-scenario.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{"meta":"meta"}
{"testRunStarted":{"timestamp":{"seconds":0,"nanos":0}}}
{"source":{"data":"Feature: a feature\n @skip\n Scenario: first scenario\n Given a step\n Scenario: second scenario\n Given a step\n Scenario: third scenario\n Given a step","uri":"cypress/e2e/a.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"a feature","description":"","children":[{"scenario":{"id":"id","tags":[{"location":{"line":2,"column":3},"name":"@skip","id":"id"}],"location":{"line":3,"column":3},"keyword":"Scenario","name":"first scenario","description":"","steps":[{"id":"id","location":{"line":4,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[],"location":{"line":5,"column":3},"keyword":"Scenario","name":"second scenario","description":"","steps":[{"id":"id","location":{"line":6,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[],"location":{"line":7,"column":3},"keyword":"Scenario","name":"third scenario","description":"","steps":[{"id":"id","location":{"line":8,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}}]},"comments":[],"uri":"cypress/e2e/a.feature"}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[{"name":"@skip","astNodeId":"id"}],"name":"first scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[],"name":"second scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[],"name":"third scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"stepDefinition":{"id":"id","pattern":{"type":"CUCUMBER_EXPRESSION","source":"a step"},"sourceReference":{"uri":"not available","location":{"line":0}}}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"SKIPPED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"PASSED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"PASSED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testRunFinished":{"timestamp":{"seconds":0,"nanos":0}}}
90 changes: 90 additions & 0 deletions features/fixtures/skipped-second-scenario.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;first-scenario",
"keyword": "Scenario",
"line": 2,
"name": "first scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "passed",
"duration": 0
}
}
],
"tags": [],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;second-scenario",
"keyword": "Scenario",
"line": 5,
"name": "second scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 6,
"name": "a step",
"match": {
"location": "not available:0"
},
"result": {
"status": "skipped",
"duration": 0
}
}
],
"tags": [
{
"name": "@skip",
"line": 4
}
],
"type": "scenario"
},
{
"description": "",
"id": "a-feature;third-scenario",
"keyword": "Scenario",
"line": 7,
"name": "third scenario",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 8,
"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"
}
]
24 changes: 24 additions & 0 deletions features/fixtures/skipped-second-scenario.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{"meta":"meta"}
{"testRunStarted":{"timestamp":{"seconds":0,"nanos":0}}}
{"source":{"data":"Feature: a feature\n Scenario: first scenario\n Given a step\n @skip\n Scenario: second scenario\n Given a step\n Scenario: third scenario\n Given a step","uri":"cypress/e2e/a.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"a feature","description":"","children":[{"scenario":{"id":"id","tags":[],"location":{"line":2,"column":3},"keyword":"Scenario","name":"first scenario","description":"","steps":[{"id":"id","location":{"line":3,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[{"location":{"line":4,"column":3},"name":"@skip","id":"id"}],"location":{"line":5,"column":3},"keyword":"Scenario","name":"second scenario","description":"","steps":[{"id":"id","location":{"line":6,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}},{"scenario":{"id":"id","tags":[],"location":{"line":7,"column":3},"keyword":"Scenario","name":"third scenario","description":"","steps":[{"id":"id","location":{"line":8,"column":5},"keyword":"Given ","keywordType":"Context","text":"a step"}],"examples":[]}}]},"comments":[],"uri":"cypress/e2e/a.feature"}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[],"name":"first scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[{"name":"@skip","astNodeId":"id"}],"name":"second scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"pickle":{"id":"id","uri":"cypress/e2e/a.feature","astNodeIds":["id"],"tags":[],"name":"third scenario","language":"en","steps":[{"id":"id","text":"a step","type":"Context","astNodeIds":["id"]}]}}
{"stepDefinition":{"id":"id","pattern":{"type":"CUCUMBER_EXPRESSION","source":"a step"},"sourceReference":{"uri":"not available","location":{"line":0}}}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCase":{"id":"id","pickleId":"id","testSteps":[{"id":"id","pickleStepId":"id","stepDefinitionIds":["id"]}]}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"PASSED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"SKIPPED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testCaseStarted":{"id":"id","testCaseId":"id","attempt":0,"timestamp":{"seconds":0,"nanos":0}}}
{"testStepStarted":{"testStepId":"id","testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0}}}
{"testStepFinished":{"testStepId":"id","testCaseStartedId":"id","testStepResult":{"status":"PASSED","duration":0},"timestamp":{"seconds":0,"nanos":0}}}
{"testCaseFinished":{"testCaseStartedId":"id","timestamp":{"seconds":0,"nanos":0},"willBeRetried":false}}
{"testRunFinished":{"timestamp":{"seconds":0,"nanos":0}}}
Loading

0 comments on commit 15b2aa5

Please sign in to comment.