diff --git a/.gitignore b/.gitignore index b706642..396cb22 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ **/vendor/* Gopkg.lock Gopkg.toml + +.DS_Store \ No newline at end of file diff --git a/formatter-tests/cucumber/empty b/formatter-tests/cucumber/empty new file mode 100644 index 0000000..e16aa51 --- /dev/null +++ b/formatter-tests/cucumber/empty @@ -0,0 +1,10 @@ +[ + { + "uri": "formatter-tests/features/empty.feature", + "id": "empty-feature", + "keyword": "Feature", + "name": "empty feature", + "description": "", + "line": 1 + } +] diff --git a/formatter-tests/cucumber/empty_with_description b/formatter-tests/cucumber/empty_with_description new file mode 100644 index 0000000..41e9ac2 --- /dev/null +++ b/formatter-tests/cucumber/empty_with_description @@ -0,0 +1,10 @@ +[ + { + "uri": "formatter-tests/features/empty_with_description.feature", + "id": "empty-feature", + "keyword": "Feature", + "name": "empty feature", + "description": " describes\n an empty\n feature", + "line": 1 + } +] diff --git a/formatter-tests/cucumber/empty_with_single_scenario_without_steps b/formatter-tests/cucumber/empty_with_single_scenario_without_steps new file mode 100644 index 0000000..430ab6a --- /dev/null +++ b/formatter-tests/cucumber/empty_with_single_scenario_without_steps @@ -0,0 +1,20 @@ +[ + { + "uri": "formatter-tests/features/empty_with_single_scenario_without_steps.feature", + "id": "empty-feature", + "keyword": "Feature", + "name": "empty feature", + "description": "", + "line": 1, + "elements": [ + { + "id": "empty-feature;without-steps", + "keyword": "Scenario", + "name": "without steps", + "description": "", + "line": 3, + "type": "scenario" + } + ] + } +] diff --git a/formatter-tests/cucumber/empty_with_single_scenario_without_steps_and_description b/formatter-tests/cucumber/empty_with_single_scenario_without_steps_and_description new file mode 100644 index 0000000..3a15a38 --- /dev/null +++ b/formatter-tests/cucumber/empty_with_single_scenario_without_steps_and_description @@ -0,0 +1,20 @@ +[ + { + "uri": "formatter-tests/features/empty_with_single_scenario_without_steps_and_description.feature", + "id": "empty-feature", + "keyword": "Feature", + "name": "empty feature", + "description": " describes\n an empty\n feature", + "line": 1, + "elements": [ + { + "id": "empty-feature;without-steps", + "keyword": "Scenario", + "name": "without steps", + "description": "", + "line": 6, + "type": "scenario" + } + ] + } +] diff --git a/formatter-tests/cucumber/scenario_outline b/formatter-tests/cucumber/scenario_outline new file mode 100644 index 0000000..4ed44a8 --- /dev/null +++ b/formatter-tests/cucumber/scenario_outline @@ -0,0 +1,345 @@ +[ + { + "uri": "formatter-tests/features/scenario_outline.feature", + "id": "outline", + "keyword": "Feature", + "name": "outline", + "description": "", + "line": 2, + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + } + ], + "elements": [ + { + "id": "outline;outline;tagged;2", + "keyword": "Scenario Outline", + "name": "outline", + "description": "", + "line": 13, + "type": "scenario", + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + }, + { + "name": "@scenario", + "line": 4 + }, + { + "name": "@tagged", + "line": 10 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 13, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 13, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "odd 1 and even 2 number", + "line": 13, + "match": { + "location": "formatters_print_test.go:65" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "outline;outline;tagged;3", + "keyword": "Scenario Outline", + "name": "outline", + "description": "", + "line": 14, + "type": "scenario", + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + }, + { + "name": "@scenario", + "line": 4 + }, + { + "name": "@tagged", + "line": 10 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 14, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 14, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "odd 2 and even 0 number", + "line": 14, + "match": { + "location": "formatters_print_test.go:65" + }, + "result": { + "status": "failed", + "error_message": "2 is not odd", + "duration": 0 + } + } + ] + }, + { + "id": "outline;outline;tagged;4", + "keyword": "Scenario Outline", + "name": "outline", + "description": "", + "line": 15, + "type": "scenario", + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + }, + { + "name": "@scenario", + "line": 4 + }, + { + "name": "@tagged", + "line": 10 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 15, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 15, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "odd 3 and even 11 number", + "line": 15, + "match": { + "location": "formatters_print_test.go:65" + }, + "result": { + "status": "failed", + "error_message": "11 is not even", + "duration": 0 + } + } + ] + }, + { + "id": "outline;outline;;2", + "keyword": "Scenario Outline", + "name": "outline", + "description": "", + "line": 20, + "type": "scenario", + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + }, + { + "name": "@scenario", + "line": 4 + }, + { + "name": "@tag2", + "line": 17 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 20, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 20, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "odd 1 and even 14 number", + "line": 20, + "match": { + "location": "formatters_print_test.go:65" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + }, + { + "id": "outline;outline;;3", + "keyword": "Scenario Outline", + "name": "outline", + "description": "", + "line": 21, + "type": "scenario", + "tags": [ + { + "name": "@outline", + "line": 1 + }, + { + "name": "@tag", + "line": 1 + }, + { + "name": "@scenario", + "line": 4 + }, + { + "name": "@tag2", + "line": 17 + } + ], + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 21, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 21, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "odd 3 and even 9 number", + "line": 21, + "match": { + "location": "formatters_print_test.go:65" + }, + "result": { + "status": "failed", + "error_message": "9 is not even", + "duration": 0 + } + } + ] + } + ] + } +] diff --git a/formatter-tests/cucumber/scenario_with_background b/formatter-tests/cucumber/scenario_with_background new file mode 100644 index 0000000..ca7044f --- /dev/null +++ b/formatter-tests/cucumber/scenario_with_background @@ -0,0 +1,70 @@ +[ + { + "uri": "formatter-tests/features/scenario_with_background.feature", + "id": "single-scenario-with-background", + "keyword": "Feature", + "name": "single scenario with background", + "description": "", + "line": 1, + "elements": [ + { + "id": "single-scenario-with-background;scenario", + "keyword": "Scenario", + "name": "scenario", + "description": "", + "line": 7, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 4, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "passing step", + "line": 5, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 8, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 9, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + } + ] + } +] diff --git a/formatter-tests/cucumber/scenario_without_steps_with_background b/formatter-tests/cucumber/scenario_without_steps_with_background new file mode 100644 index 0000000..3b69b07 --- /dev/null +++ b/formatter-tests/cucumber/scenario_without_steps_with_background @@ -0,0 +1,20 @@ +[ + { + "uri": "formatter-tests/features/scenario_without_steps_with_background.feature", + "id": "empty-feature", + "keyword": "Feature", + "name": "empty feature", + "description": "", + "line": 1, + "elements": [ + { + "id": "empty-feature;without-steps", + "keyword": "Scenario", + "name": "without steps", + "description": "", + "line": 6, + "type": "scenario" + } + ] + } +] diff --git a/formatter-tests/cucumber/single_scenario_with_passing_step b/formatter-tests/cucumber/single_scenario_with_passing_step new file mode 100644 index 0000000..7580080 --- /dev/null +++ b/formatter-tests/cucumber/single_scenario_with_passing_step @@ -0,0 +1,34 @@ +[ + { + "uri": "formatter-tests/features/single_scenario_with_passing_step.feature", + "id": "single-passing-scenario", + "keyword": "Feature", + "name": "single passing scenario", + "description": " describes\n a single scenario\n feature", + "line": 1, + "elements": [ + { + "id": "single-passing-scenario;one-step-passing", + "keyword": "Scenario", + "name": "one step passing", + "description": "", + "line": 6, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "a passing step", + "line": 7, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + } + ] + } + ] + } +] diff --git a/formatter-tests/cucumber/some_scenarions_including_failing b/formatter-tests/cucumber/some_scenarions_including_failing new file mode 100644 index 0000000..521d6c2 --- /dev/null +++ b/formatter-tests/cucumber/some_scenarions_including_failing @@ -0,0 +1,122 @@ +[ + { + "uri": "formatter-tests/features/some_scenarions_including_failing.feature", + "id": "some-scenarios", + "keyword": "Feature", + "name": "some scenarios", + "description": "", + "line": 1, + "elements": [ + { + "id": "some-scenarios;failing", + "keyword": "Scenario", + "name": "failing", + "description": "", + "line": 3, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 4, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "failing step", + "line": 5, + "match": { + "location": "formatters_print_test.go:79" + }, + "result": { + "status": "failed", + "error_message": "step failed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 6, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "some-scenarios;pending", + "keyword": "Scenario", + "name": "pending", + "description": "", + "line": 8, + "type": "scenario", + "steps": [ + { + "keyword": "When ", + "name": "pending step", + "line": 9, + "match": { + "location": "formatter-tests/features/some_scenarions_including_failing.feature:9" + }, + "result": { + "status": "pending" + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 10, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "some-scenarios;undefined", + "keyword": "Scenario", + "name": "undefined", + "description": "", + "line": 12, + "type": "scenario", + "steps": [ + { + "keyword": "When ", + "name": "undefined", + "line": 13, + "match": { + "location": "formatter-tests/features/some_scenarions_including_failing.feature:13" + }, + "result": { + "status": "undefined" + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 14, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + } + ] + } + ] + } +] diff --git a/formatter-tests/cucumber/two_scenarios_with_background_fail b/formatter-tests/cucumber/two_scenarios_with_background_fail new file mode 100644 index 0000000..203449c --- /dev/null +++ b/formatter-tests/cucumber/two_scenarios_with_background_fail @@ -0,0 +1,115 @@ +[ + { + "uri": "formatter-tests/features/two_scenarios_with_background_fail.feature", + "id": "two-scenarios-with-background-fail", + "keyword": "Feature", + "name": "two scenarios with background fail", + "description": "", + "line": 1, + "elements": [ + { + "id": "two-scenarios-with-background-fail;one", + "keyword": "Scenario", + "name": "one", + "description": "", + "line": 7, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 4, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "failing step", + "line": 5, + "match": { + "location": "formatters_print_test.go:79" + }, + "result": { + "status": "failed", + "error_message": "step failed", + "duration": 0 + } + }, + { + "keyword": "When ", + "name": "passing step", + "line": 8, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 9, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + } + ] + }, + { + "id": "two-scenarios-with-background-fail;two", + "keyword": "Scenario", + "name": "two", + "description": "", + "line": 11, + "type": "scenario", + "steps": [ + { + "keyword": "Given ", + "name": "passing step", + "line": 4, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "passed", + "duration": 0 + } + }, + { + "keyword": "And ", + "name": "failing step", + "line": 5, + "match": { + "location": "formatters_print_test.go:79" + }, + "result": { + "status": "failed", + "error_message": "step failed", + "duration": 0 + } + }, + { + "keyword": "Then ", + "name": "passing step", + "line": 12, + "match": { + "location": "formatters_print_test.go:63" + }, + "result": { + "status": "skipped" + } + } + ] + } + ] + } +] diff --git a/formatter-tests/cucumber/with_few_empty_scenarios b/formatter-tests/cucumber/with_few_empty_scenarios new file mode 100644 index 0000000..f5be90d --- /dev/null +++ b/formatter-tests/cucumber/with_few_empty_scenarios @@ -0,0 +1,52 @@ +[ + { + "uri": "formatter-tests/features/with_few_empty_scenarios.feature", + "id": "few-empty-scenarios", + "keyword": "Feature", + "name": "few empty scenarios", + "description": "", + "line": 1, + "elements": [ + { + "id": "few-empty-scenarios;one", + "keyword": "Scenario", + "name": "one", + "description": "", + "line": 3, + "type": "scenario" + }, + { + "id": "few-empty-scenarios;two;first-group;2", + "keyword": "Scenario Outline", + "name": "two", + "description": "", + "line": 9, + "type": "scenario" + }, + { + "id": "few-empty-scenarios;two;first-group;3", + "keyword": "Scenario Outline", + "name": "two", + "description": "", + "line": 10, + "type": "scenario" + }, + { + "id": "few-empty-scenarios;two;second-group;2", + "keyword": "Scenario Outline", + "name": "two", + "description": "", + "line": 14, + "type": "scenario" + }, + { + "id": "few-empty-scenarios;three", + "keyword": "Scenario", + "name": "three", + "description": "", + "line": 16, + "type": "scenario" + } + ] + } +] diff --git a/formatter-tests/events/empty b/formatter-tests/events/empty new file mode 100644 index 0000000..cfcf75d --- /dev/null +++ b/formatter-tests/events/empty @@ -0,0 +1,3 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/empty.feature:1","source":"Feature: empty feature\n"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/empty_with_description b/formatter-tests/events/empty_with_description new file mode 100644 index 0000000..01891d5 --- /dev/null +++ b/formatter-tests/events/empty_with_description @@ -0,0 +1,3 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/empty_with_description.feature:1","source":"Feature: empty feature\n describes\n an empty\n feature\n"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/empty_with_single_scenario_without_steps b/formatter-tests/events/empty_with_single_scenario_without_steps new file mode 100644 index 0000000..482fdeb --- /dev/null +++ b/formatter-tests/events/empty_with_single_scenario_without_steps @@ -0,0 +1,5 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/empty_with_single_scenario_without_steps.feature:1","source":"Feature: empty feature\n\n Scenario: without steps\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/empty_with_single_scenario_without_steps.feature:3","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/empty_with_single_scenario_without_steps.feature:3","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/empty_with_single_scenario_without_steps_and_description b/formatter-tests/events/empty_with_single_scenario_without_steps_and_description new file mode 100644 index 0000000..3f69149 --- /dev/null +++ b/formatter-tests/events/empty_with_single_scenario_without_steps_and_description @@ -0,0 +1,5 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/empty_with_single_scenario_without_steps_and_description.feature:1","source":"Feature: empty feature\n describes\n an empty\n feature\n\n Scenario: without steps\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/empty_with_single_scenario_without_steps_and_description.feature:6","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/empty_with_single_scenario_without_steps_and_description.feature:6","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/scenario_outline b/formatter-tests/events/scenario_outline new file mode 100644 index 0000000..3af6cad --- /dev/null +++ b/formatter-tests/events/scenario_outline @@ -0,0 +1,58 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/scenario_outline.feature:2","source":"@outline @tag\nFeature: outline\n\n @scenario\n Scenario Outline: outline\n Given passing step\n When passing step\n Then odd \u003codd\u003e and even \u003ceven\u003e number\n\n @tagged\n Examples: tagged\n | odd | even |\n | 1 | 2 |\n | 2 | 0 |\n | 3 | 11 |\n\n @tag2\n Examples:\n | odd | even |\n | 1 | 14 |\n | 3 | 9 |\n\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_outline.feature:13","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:8","definition_id":"formatters_print_test.go:65 -\u003e oddEvenStepDef","arguments":[[4,5],[5,15]]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_outline.feature:13","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_outline.feature:14","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:8","definition_id":"formatters_print_test.go:65 -\u003e oddEvenStepDef","arguments":[[4,5],[5,15]]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871,"status":"failed","summary":"2 is not odd"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_outline.feature:14","timestamp":-6795364578871,"status":"failed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_outline.feature:15","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:8","definition_id":"formatters_print_test.go:65 -\u003e oddEvenStepDef","arguments":[[4,5],[5,15]]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871,"status":"failed","summary":"11 is not even"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_outline.feature:15","timestamp":-6795364578871,"status":"failed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_outline.feature:20","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:8","definition_id":"formatters_print_test.go:65 -\u003e oddEvenStepDef","arguments":[[4,5],[5,15]]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_outline.feature:20","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_outline.feature:21","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_outline.feature:8","definition_id":"formatters_print_test.go:65 -\u003e oddEvenStepDef","arguments":[[4,5],[5,15]]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_outline.feature:8","timestamp":-6795364578871,"status":"failed","summary":"9 is not even"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_outline.feature:21","timestamp":-6795364578871,"status":"failed"} +{"event":"TestRunFinished","status":"failed","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/scenario_with_background b/formatter-tests/events/scenario_with_background new file mode 100644 index 0000000..84d8dbe --- /dev/null +++ b/formatter-tests/events/scenario_with_background @@ -0,0 +1,17 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/scenario_with_background.feature:1","source":"Feature: single scenario with background\n\n Background: named\n Given passing step\n And passing step\n\n Scenario: scenario\n When passing step\n Then passing step\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_with_background.feature:7","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_with_background.feature:4","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_with_background.feature:4","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_with_background.feature:4","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_with_background.feature:5","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_with_background.feature:5","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_with_background.feature:5","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_with_background.feature:8","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_with_background.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_with_background.feature:8","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_with_background.feature:9","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/scenario_with_background.feature:9","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/scenario_with_background.feature:9","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_with_background.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"TestRunFinished","status":"passed","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/scenario_without_steps_with_background b/formatter-tests/events/scenario_without_steps_with_background new file mode 100644 index 0000000..9a993a9 --- /dev/null +++ b/formatter-tests/events/scenario_without_steps_with_background @@ -0,0 +1,5 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/scenario_without_steps_with_background.feature:1","source":"Feature: empty feature\n\n Background:\n Given passing step\n\n Scenario: without steps\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_without_steps_with_background.feature:6","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_without_steps_with_background.feature:6","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/single_scenario_with_passing_step b/formatter-tests/events/single_scenario_with_passing_step new file mode 100644 index 0000000..210399c --- /dev/null +++ b/formatter-tests/events/single_scenario_with_passing_step @@ -0,0 +1,8 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/single_scenario_with_passing_step.feature:1","source":"Feature: single passing scenario\n describes\n a single scenario\n feature\n\n Scenario: one step passing\n Given a passing step\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/single_scenario_with_passing_step.feature:6","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/single_scenario_with_passing_step.feature:7","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/single_scenario_with_passing_step.feature:7","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/single_scenario_with_passing_step.feature:7","timestamp":-6795364578871,"status":"passed"} +{"event":"TestCaseFinished","location":"formatter-tests/features/single_scenario_with_passing_step.feature:6","timestamp":-6795364578871,"status":"passed"} +{"event":"TestRunFinished","status":"passed","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/some_scenarions_including_failing b/formatter-tests/events/some_scenarions_including_failing new file mode 100644 index 0000000..6fc70e1 --- /dev/null +++ b/formatter-tests/events/some_scenarions_including_failing @@ -0,0 +1,29 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/some_scenarions_including_failing.feature:1","source":"Feature: some scenarios\n\n Scenario: failing\n Given passing step\n When failing step\n Then passing step\n\n Scenario: pending\n When pending step\n Then passing step\n\n Scenario: undefined\n When undefined\n Then passing step\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:3","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:4","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:4","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:4","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:5","definition_id":"formatters_print_test.go:79 -\u003e failingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:5","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:5","timestamp":-6795364578871,"status":"failed","summary":"step failed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:6","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:6","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:6","timestamp":-6795364578871,"status":"skipped"} +{"event":"TestCaseFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:3","timestamp":-6795364578871,"status":"failed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:8","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:9","definition_id":"formatters_print_test.go:77 -\u003e pendingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:9","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:9","timestamp":-6795364578871,"status":"pending"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:10","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:10","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:10","timestamp":-6795364578871,"status":"skipped"} +{"event":"TestCaseFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:8","timestamp":-6795364578871,"status":"pending"} +{"event":"TestCaseStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:12","timestamp":-6795364578871} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:13","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:13","timestamp":-6795364578871,"status":"undefined"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/some_scenarions_including_failing.feature:14","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/some_scenarions_including_failing.feature:14","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:14","timestamp":-6795364578871,"status":"skipped"} +{"event":"TestCaseFinished","location":"formatter-tests/features/some_scenarions_including_failing.feature:12","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestRunFinished","status":"failed","timestamp":-6795364578871,"snippets":"You can implement step definitions for undefined steps with these snippets:\n\nfunc undefined() error {\n\treturn godog.ErrPending\n}\n\nfunc FeatureContext(s *godog.Suite) {\n\ts.Step(`^undefined$`, undefined)\n}\n","memory":""} diff --git a/formatter-tests/events/two_scenarios_with_background_fail b/formatter-tests/events/two_scenarios_with_background_fail new file mode 100644 index 0000000..e269ba8 --- /dev/null +++ b/formatter-tests/events/two_scenarios_with_background_fail @@ -0,0 +1,28 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:1","source":"Feature: two scenarios with background fail\n\n Background:\n Given passing step\n And failing step\n\n Scenario: one\n When passing step\n Then passing step\n\n Scenario: two\n Then passing step\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:7","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","definition_id":"formatters_print_test.go:79 -\u003e failingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","timestamp":-6795364578871,"status":"failed","summary":"step failed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:8","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:8","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:8","timestamp":-6795364578871,"status":"skipped"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:9","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:9","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:9","timestamp":-6795364578871,"status":"skipped"} +{"event":"TestCaseFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:7","timestamp":-6795364578871,"status":"failed"} +{"event":"TestCaseStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:11","timestamp":-6795364578871} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:4","timestamp":-6795364578871,"status":"passed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","definition_id":"formatters_print_test.go:79 -\u003e failingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:5","timestamp":-6795364578871,"status":"failed","summary":"step failed"} +{"event":"StepDefinitionFound","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:12","definition_id":"formatters_print_test.go:63 -\u003e passingStepDef","arguments":[]} +{"event":"TestStepStarted","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:12","timestamp":-6795364578871} +{"event":"TestStepFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:12","timestamp":-6795364578871,"status":"skipped"} +{"event":"TestCaseFinished","location":"formatter-tests/features/two_scenarios_with_background_fail.feature:11","timestamp":-6795364578871,"status":"failed"} +{"event":"TestRunFinished","status":"failed","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/events/with_few_empty_scenarios b/formatter-tests/events/with_few_empty_scenarios new file mode 100644 index 0000000..6becd05 --- /dev/null +++ b/formatter-tests/events/with_few_empty_scenarios @@ -0,0 +1,13 @@ +{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} +{"event":"TestSource","location":"formatter-tests/features/with_few_empty_scenarios.feature:1","source":"Feature: few empty scenarios\n\n Scenario: one\n\n Scenario Outline: two\n\n Examples: first group\n | one | two |\n | 1 | 2 |\n | 4 | 7 |\n\n Examples: second group\n | one | two |\n | 5 | 9 |\n\n Scenario: three\n"} +{"event":"TestCaseStarted","location":"formatter-tests/features/with_few_empty_scenarios.feature:3","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/with_few_empty_scenarios.feature:3","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestCaseStarted","location":"formatter-tests/features/with_few_empty_scenarios.feature:9","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/with_few_empty_scenarios.feature:9","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestCaseStarted","location":"formatter-tests/features/with_few_empty_scenarios.feature:10","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/with_few_empty_scenarios.feature:10","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestCaseStarted","location":"formatter-tests/features/with_few_empty_scenarios.feature:14","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/with_few_empty_scenarios.feature:14","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestCaseStarted","location":"formatter-tests/features/with_few_empty_scenarios.feature:16","timestamp":-6795364578871} +{"event":"TestCaseFinished","location":"formatter-tests/features/with_few_empty_scenarios.feature:16","timestamp":-6795364578871,"status":"undefined"} +{"event":"TestRunFinished","status":"pending","timestamp":-6795364578871,"snippets":"","memory":""} diff --git a/formatter-tests/junit/empty b/formatter-tests/junit/empty new file mode 100644 index 0000000..6cfcea3 --- /dev/null +++ b/formatter-tests/junit/empty @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/formatter-tests/junit/empty_with_description b/formatter-tests/junit/empty_with_description new file mode 100644 index 0000000..6cfcea3 --- /dev/null +++ b/formatter-tests/junit/empty_with_description @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/formatter-tests/junit/empty_with_single_scenario_without_steps b/formatter-tests/junit/empty_with_single_scenario_without_steps new file mode 100644 index 0000000..96974ba --- /dev/null +++ b/formatter-tests/junit/empty_with_single_scenario_without_steps @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/empty_with_single_scenario_without_steps_and_description b/formatter-tests/junit/empty_with_single_scenario_without_steps_and_description new file mode 100644 index 0000000..96974ba --- /dev/null +++ b/formatter-tests/junit/empty_with_single_scenario_without_steps_and_description @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/scenario_outline b/formatter-tests/junit/scenario_outline new file mode 100644 index 0000000..aad2f12 --- /dev/null +++ b/formatter-tests/junit/scenario_outline @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/scenario_with_background b/formatter-tests/junit/scenario_with_background new file mode 100644 index 0000000..8df0cb4 --- /dev/null +++ b/formatter-tests/junit/scenario_with_background @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/scenario_without_steps_with_background b/formatter-tests/junit/scenario_without_steps_with_background new file mode 100644 index 0000000..96974ba --- /dev/null +++ b/formatter-tests/junit/scenario_without_steps_with_background @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/single_scenario_with_passing_step b/formatter-tests/junit/single_scenario_with_passing_step new file mode 100644 index 0000000..e5e7b5b --- /dev/null +++ b/formatter-tests/junit/single_scenario_with_passing_step @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/some_scenarions_including_failing b/formatter-tests/junit/some_scenarions_including_failing new file mode 100644 index 0000000..427c7b2 --- /dev/null +++ b/formatter-tests/junit/some_scenarions_including_failing @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/two_scenarios_with_background_fail b/formatter-tests/junit/two_scenarios_with_background_fail new file mode 100644 index 0000000..ae87880 --- /dev/null +++ b/formatter-tests/junit/two_scenarios_with_background_fail @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/formatter-tests/junit/with_few_empty_scenarios b/formatter-tests/junit/with_few_empty_scenarios new file mode 100644 index 0000000..a71f292 --- /dev/null +++ b/formatter-tests/junit/with_few_empty_scenarios @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/formatter-tests/pretty/scenario_outline b/formatter-tests/pretty/scenario_outline index 4796372..e8d8a61 100644 --- a/formatter-tests/pretty/scenario_outline +++ b/formatter-tests/pretty/scenario_outline @@ -1,9 +1,9 @@ Feature: outline Scenario Outline: outline # formatter-tests/features/scenario_outline.feature:5 - Given passing step # formatters_print_test.go:65 -> passingStepDef - When passing step # formatters_print_test.go:65 -> passingStepDef - Then odd and even number # formatters_print_test.go:67 -> oddEvenStepDef + Given passing step # formatters_print_test.go:63 -> passingStepDef + When passing step # formatters_print_test.go:63 -> passingStepDef + Then odd and even number # formatters_print_test.go:65 -> oddEvenStepDef Examples: tagged | odd | even | diff --git a/formatter-tests/pretty/scenario_with_background b/formatter-tests/pretty/scenario_with_background index e0359a0..21e098e 100644 --- a/formatter-tests/pretty/scenario_with_background +++ b/formatter-tests/pretty/scenario_with_background @@ -1,12 +1,12 @@ Feature: single scenario with background Background: named - Given passing step # formatters_print_test.go:65 -> passingStepDef - And passing step # formatters_print_test.go:65 -> passingStepDef + Given passing step # formatters_print_test.go:63 -> passingStepDef + And passing step # formatters_print_test.go:63 -> passingStepDef Scenario: scenario # formatter-tests/features/scenario_with_background.feature:7 - When passing step # formatters_print_test.go:65 -> passingStepDef - Then passing step # formatters_print_test.go:65 -> passingStepDef + When passing step # formatters_print_test.go:63 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef 1 scenarios (1 passed) 4 steps (4 passed) diff --git a/formatter-tests/pretty/single_scenario_with_passing_step b/formatter-tests/pretty/single_scenario_with_passing_step index 3c4407a..bb94c08 100644 --- a/formatter-tests/pretty/single_scenario_with_passing_step +++ b/formatter-tests/pretty/single_scenario_with_passing_step @@ -4,7 +4,7 @@ feature Scenario: one step passing # formatter-tests/features/single_scenario_with_passing_step.feature:6 - Given a passing step # formatters_print_test.go:65 -> passingStepDef + Given a passing step # formatters_print_test.go:63 -> passingStepDef 1 scenarios (1 passed) 1 steps (1 passed) diff --git a/formatter-tests/pretty/some_scenarions_including_failing b/formatter-tests/pretty/some_scenarions_including_failing index 4ea88ef..dbab7e1 100644 --- a/formatter-tests/pretty/some_scenarions_including_failing +++ b/formatter-tests/pretty/some_scenarions_including_failing @@ -1,19 +1,19 @@ Feature: some scenarios Scenario: failing # formatter-tests/features/some_scenarions_including_failing.feature:3 - Given passing step # formatters_print_test.go:65 -> passingStepDef - When failing step # formatters_print_test.go:81 -> failingStepDef + Given passing step # formatters_print_test.go:63 -> passingStepDef + When failing step # formatters_print_test.go:79 -> failingStepDef step failed - Then passing step # formatters_print_test.go:65 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef Scenario: pending # formatter-tests/features/some_scenarions_including_failing.feature:8 - When pending step # formatters_print_test.go:79 -> pendingStepDef + When pending step # formatters_print_test.go:77 -> pendingStepDef TODO: write pending definition - Then passing step # formatters_print_test.go:65 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef Scenario: undefined # formatter-tests/features/some_scenarions_including_failing.feature:12 When undefined - Then passing step # formatters_print_test.go:65 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef --- Failed steps: diff --git a/formatter-tests/pretty/two_scenarios_with_background_fail b/formatter-tests/pretty/two_scenarios_with_background_fail index 46416d2..bee7005 100644 --- a/formatter-tests/pretty/two_scenarios_with_background_fail +++ b/formatter-tests/pretty/two_scenarios_with_background_fail @@ -1,17 +1,17 @@ Feature: two scenarios with background fail Background: - Given passing step # formatters_print_test.go:65 -> passingStepDef - And failing step # formatters_print_test.go:81 -> failingStepDef + Given passing step # formatters_print_test.go:63 -> passingStepDef + And failing step # formatters_print_test.go:79 -> failingStepDef step failed Scenario: one # formatter-tests/features/two_scenarios_with_background_fail.feature:7 - When passing step # formatters_print_test.go:65 -> passingStepDef - Then passing step # formatters_print_test.go:65 -> passingStepDef + When passing step # formatters_print_test.go:63 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef Scenario: two # formatter-tests/features/two_scenarios_with_background_fail.feature:11 step failed - Then passing step # formatters_print_test.go:65 -> passingStepDef + Then passing step # formatters_print_test.go:63 -> passingStepDef --- Failed steps: diff --git a/formatter-tests/progress/empty b/formatter-tests/progress/empty new file mode 100644 index 0000000..06bf7e6 --- /dev/null +++ b/formatter-tests/progress/empty @@ -0,0 +1,5 @@ + + +No scenarios +No steps +0s diff --git a/formatter-tests/progress/empty_with_description b/formatter-tests/progress/empty_with_description new file mode 100644 index 0000000..06bf7e6 --- /dev/null +++ b/formatter-tests/progress/empty_with_description @@ -0,0 +1,5 @@ + + +No scenarios +No steps +0s diff --git a/formatter-tests/progress/empty_with_single_scenario_without_steps b/formatter-tests/progress/empty_with_single_scenario_without_steps new file mode 100644 index 0000000..0634bac --- /dev/null +++ b/formatter-tests/progress/empty_with_single_scenario_without_steps @@ -0,0 +1,5 @@ + + +1 scenarios (1 undefined) +No steps +0s diff --git a/formatter-tests/progress/empty_with_single_scenario_without_steps_and_description b/formatter-tests/progress/empty_with_single_scenario_without_steps_and_description new file mode 100644 index 0000000..0634bac --- /dev/null +++ b/formatter-tests/progress/empty_with_single_scenario_without_steps_and_description @@ -0,0 +1,5 @@ + + +1 scenarios (1 undefined) +No steps +0s diff --git a/formatter-tests/progress/scenario_outline b/formatter-tests/progress/scenario_outline new file mode 100644 index 0000000..a67acef --- /dev/null +++ b/formatter-tests/progress/scenario_outline @@ -0,0 +1,21 @@ +.....F..F.....F 15 + + +--- Failed steps: + + Scenario Outline: outline # formatter-tests/features/scenario_outline.feature:5 + Then odd 2 and even 0 number # formatter-tests/features/scenario_outline.feature:8 + Error: 2 is not odd + + Scenario Outline: outline # formatter-tests/features/scenario_outline.feature:5 + Then odd 3 and even 11 number # formatter-tests/features/scenario_outline.feature:8 + Error: 11 is not even + + Scenario Outline: outline # formatter-tests/features/scenario_outline.feature:5 + Then odd 3 and even 9 number # formatter-tests/features/scenario_outline.feature:8 + Error: 9 is not even + + +5 scenarios (2 passed, 3 failed) +15 steps (12 passed, 3 failed) +0s diff --git a/formatter-tests/progress/scenario_with_background b/formatter-tests/progress/scenario_with_background new file mode 100644 index 0000000..94b924e --- /dev/null +++ b/formatter-tests/progress/scenario_with_background @@ -0,0 +1,6 @@ +.... 4 + + +1 scenarios (1 passed) +4 steps (4 passed) +0s diff --git a/formatter-tests/progress/scenario_without_steps_with_background b/formatter-tests/progress/scenario_without_steps_with_background new file mode 100644 index 0000000..0634bac --- /dev/null +++ b/formatter-tests/progress/scenario_without_steps_with_background @@ -0,0 +1,5 @@ + + +1 scenarios (1 undefined) +No steps +0s diff --git a/formatter-tests/progress/single_scenario_with_passing_step b/formatter-tests/progress/single_scenario_with_passing_step new file mode 100644 index 0000000..ab8867e --- /dev/null +++ b/formatter-tests/progress/single_scenario_with_passing_step @@ -0,0 +1,6 @@ +. 1 + + +1 scenarios (1 passed) +1 steps (1 passed) +0s diff --git a/formatter-tests/progress/some_scenarions_including_failing b/formatter-tests/progress/some_scenarions_including_failing new file mode 100644 index 0000000..67e0099 --- /dev/null +++ b/formatter-tests/progress/some_scenarions_including_failing @@ -0,0 +1,24 @@ +.F-P-U- 7 + + +--- Failed steps: + + Scenario: failing # formatter-tests/features/some_scenarions_including_failing.feature:3 + When failing step # formatter-tests/features/some_scenarions_including_failing.feature:5 + Error: step failed + + +3 scenarios (1 failed, 1 pending, 1 undefined) +7 steps (1 passed, 1 failed, 1 pending, 1 undefined, 3 skipped) +0s + +You can implement step definitions for undefined steps with these snippets: + +func undefined() error { + return godog.ErrPending +} + +func FeatureContext(s *godog.Suite) { + s.Step(`^undefined$`, undefined) +} + diff --git a/formatter-tests/progress/two_scenarios_with_background_fail b/formatter-tests/progress/two_scenarios_with_background_fail new file mode 100644 index 0000000..58ee41a --- /dev/null +++ b/formatter-tests/progress/two_scenarios_with_background_fail @@ -0,0 +1,17 @@ +.F--.F- 7 + + +--- Failed steps: + + Scenario: one # formatter-tests/features/two_scenarios_with_background_fail.feature:7 + And failing step # formatter-tests/features/two_scenarios_with_background_fail.feature:5 + Error: step failed + + Scenario: two # formatter-tests/features/two_scenarios_with_background_fail.feature:11 + And failing step # formatter-tests/features/two_scenarios_with_background_fail.feature:5 + Error: step failed + + +2 scenarios (2 failed) +7 steps (2 passed, 2 failed, 3 skipped) +0s diff --git a/formatter-tests/progress/with_few_empty_scenarios b/formatter-tests/progress/with_few_empty_scenarios new file mode 100644 index 0000000..aba7ea7 --- /dev/null +++ b/formatter-tests/progress/with_few_empty_scenarios @@ -0,0 +1,5 @@ + + +5 scenarios (5 undefined) +No steps +0s diff --git a/formatters_print_test.go b/formatters_print_test.go index baad19c..07a24ce 100644 --- a/formatters_print_test.go +++ b/formatters_print_test.go @@ -8,13 +8,14 @@ import ( "path" "strings" "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestPrintingFormatters(t *testing.T) { features, err := parseFeatures("", []string{"formatter-tests"}) - if err != nil { - t.Fatalf("failed to parse formatter features: %v", err) - } + require.NoError(t, err) var buf bytes.Buffer out := &tagColorWriter{w: &buf} @@ -44,9 +45,7 @@ func TestPrintingFormatters(t *testing.T) { suite.features = []*feature{feat} // set the feature expectedOutput, err := ioutil.ReadFile(expectOutputPath) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) suite.run() suite.fmt.Summary() @@ -54,11 +53,10 @@ func TestPrintingFormatters(t *testing.T) { expected := string(expectedOutput) actual := buf.String() - if actual != expected { - t.Fatalf("%s does not match to:\n%s", expectOutputPath, actual) - } + assert.Equalf(t, expected, actual, "path: %s", expectOutputPath) } } + os.Setenv("GODOG_TESTED_PACKAGE", pkg) }