diff --git a/CHANGELOG.md b/CHANGELOG.md index bac6a48..2a1ad02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [3.1.0] - 01/07/2022 +- Fix #40 scenarios can now contain descriptions +- Json reporter: ensure exceptions, statuses and scenario descriptions are reported correctly - Changed reporter `maybeCall` to `invoke` -- Json reporter: ensure exceptions and statuses are reported correctly ## [3.0.0+1] - 16/05/2022 - Update configuration object constructor to take in additional configuration parameters diff --git a/example/features/calculator_background_example.feature b/example/features/calculator_background_example.feature index 8c09ee9..56490db 100644 --- a/example/features/calculator_background_example.feature +++ b/example/features/calculator_background_example.feature @@ -7,5 +7,7 @@ Feature: Calculator with Background Given the numbers 100 and 50 And they are added + @debug Scenario: Add two numbers with background + A scenario description! Then the expected result is 150 diff --git a/example/features/calculator_count_strings.feature b/example/features/calculator_count_strings.feature index 2337fd8..ae2c6f9 100644 --- a/example/features/calculator_count_strings.feature +++ b/example/features/calculator_count_strings.feature @@ -2,7 +2,6 @@ Feature: Calculator can work with strings Tests that the calculator can count the total value of the character code units in a string - @debug Scenario Outline: Counts string's code units Given the characters "" When they are counted diff --git a/example/report.json b/example/report.json deleted file mode 100644 index f9d36c1..0000000 --- a/example/report.json +++ /dev/null @@ -1 +0,0 @@ -[{"description":"","id":"calculator with background","keyword":"Feature","line":3,"name":"Calculator with Background","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_background_example.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"calculator with background;add two numbers with background","name":"Add two numbers with background","description":"","line":10,"steps":[{"keyword":"Given ","name":"the numbers 100 and 50","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_background_example.feature:7"},"result":{"status":"passed","duration":4000000},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"And ","name":"they are added","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_background_example.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 150","line":11,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_background_example.feature:11"},"result":{"status":"passed","duration":1000000},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]},{"description":"","id":"calculator","keyword":"Feature","line":1,"name":"Calculator","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add_powers_of_two.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"calculator;add two number which are powers of two","name":"Add two number which are powers of two","description":"","line":4,"steps":[{"keyword":"Given ","name":"the powers 2^10 and 5^9","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add_powers_of_two.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add_powers_of_two.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 1954149","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add_powers_of_two.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]},{"description":"","id":"calculator","keyword":"Feature","line":1,"name":"Calculator","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"calculator;add two numbers","name":"Add two numbers","description":"","line":4,"steps":[{"keyword":"Given ","name":"the numbers 1.5 and 2.1","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 3.6","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_can_add.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]},{"description":"","id":"calculator","keyword":"Feature","line":2,"name":"Calculator","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature","elements":[{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (1)","name":"Add two numbers Examples: (1)","description":"","line":5,"steps":[{"keyword":"Gegeben ","name":"sei the numbers 12 and 5","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Wenn ","name":"they are added","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Dann ","name":"the expected result is 17","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (2)","name":"Add two numbers Examples: (2)","description":"","line":5,"steps":[{"keyword":"Gegeben ","name":"sei the numbers 20 and 5","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Wenn ","name":"they are added","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Dann ","name":"the expected result is 25","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (3)","name":"Add two numbers Examples: (3)","description":"","line":5,"steps":[{"keyword":"Gegeben ","name":"sei the numbers 20937 and 1","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Wenn ","name":"they are added","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Dann ","name":"the expected result is 20938","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (4)","name":"Add two numbers Examples: (4)","description":"","line":5,"steps":[{"keyword":"Gegeben ","name":"sei the numbers 20.937 and -1.937","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Wenn ","name":"they are added","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Dann ","name":"the expected result is 19","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_german_example.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]},{"description":"","id":"calculator can work with strings","keyword":"Feature","line":2,"name":"Calculator can work with strings","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature","tags":[{"line":1,"name":"@a"}],"elements":[{"keyword":"Scenario Outline","type":"scenario","id":"calculator can work with strings;counts string's code units examples: (1)","name":"Counts string's code units Examples: (1)","description":"","line":6,"tags":[{"line":5,"name":"@debug"}],"steps":[{"keyword":"Given ","name":"the characters \"abc\"","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are counted","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 294","line":9,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:9"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator can work with strings;counts string's code units examples: (2)","name":"Counts string's code units Examples: (2)","description":"","line":6,"tags":[{"line":5,"name":"@debug"}],"steps":[{"keyword":"Given ","name":"the characters \"a b c\"","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are counted","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 358","line":9,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:9"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator can work with strings;counts string's code units examples: (3)","name":"Counts string's code units Examples: (3)","description":"","line":6,"tags":[{"line":5,"name":"@debug"}],"steps":[{"keyword":"Given ","name":"the characters \"a \\n b \\c\"","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are counted","line":8,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:8"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 684","line":9,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_count_strings.feature:9"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]},{"description":"","id":"calculator","keyword":"Feature","line":1,"name":"Calculator","uri":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature","elements":[{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (1)","name":"Add two numbers Examples: (1)","description":"","line":4,"steps":[{"keyword":"Given ","name":"the numbers 12 and 5","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 17","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (2)","name":"Add two numbers Examples: (2)","description":"","line":4,"steps":[{"keyword":"Given ","name":"the numbers 20 and 5","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 25","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (3)","name":"Add two numbers Examples: (3)","description":"","line":4,"steps":[{"keyword":"Given ","name":"the numbers 20937 and 1","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 20938","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]},{"keyword":"Scenario Outline","type":"scenario","id":"calculator;add two numbers examples: (4)","name":"Add two numbers Examples: (4)","description":"","line":4,"steps":[{"keyword":"Given ","name":"the numbers 20.937 and -1.937","line":5,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:5"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"When ","name":"they are added","line":6,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:6"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]},{"keyword":"Then ","name":"the expected result is 19","line":7,"match":{"location":"C:\\Users\\ltrop\\Documents\\workingprojects\\gherkin\\example\\features\\calculator_scenario_outline_example.feature:7"},"result":{"status":"passed","duration":0},"embeddings":[{"mime_type":"text/plain","data":"attachment data"}]}]}]}] \ No newline at end of file diff --git a/example/test.dart b/example/test.dart index 60edfb7..38c34d5 100644 --- a/example/test.dart +++ b/example/test.dart @@ -26,6 +26,7 @@ Future main() { StdoutReporter(MessageLevel.error), ProgressReporter(), TestRunSummaryReporter(), + JsonReporter(), ], hooks: [HookExample()], customStepParameterDefinitions: [PowerOfTwoParameter()], diff --git a/lib/src/feature_file_runner.dart b/lib/src/feature_file_runner.dart index f8e8b85..98fc644 100644 --- a/lib/src/feature_file_runner.dart +++ b/lib/src/feature_file_runner.dart @@ -58,6 +58,7 @@ class FeatureFileRunner { await _reporter.feature.onStarted.invoke( FeatureMessage( name: feature.name, + description: feature.description, context: feature.debug, tags: feature.tags.isEmpty ? [] @@ -119,6 +120,7 @@ class FeatureFileRunner { await _reporter.feature.onFinished.invoke( FeatureMessage( name: feature.name, + description: feature.description, context: feature.debug, ), ); @@ -236,6 +238,7 @@ class FeatureFileRunner { ? Target.scenarioOutline : Target.scenario, name: scenario.name, + description: scenario.description, context: scenario.debug, tags: scenario.tags.isEmpty ? [] @@ -252,7 +255,7 @@ class FeatureFileRunner { .toList(), ) .reduce((a, b) => a..addAll(b)) - .toList(), + .toList(growable: false), ), ); @@ -305,6 +308,7 @@ class FeatureFileRunner { await _reporter.scenario.onFinished.invoke( ScenarioMessage( name: scenario.name, + description: scenario.description, context: scenario.debug, hasPassed: scenarioPassed, ), diff --git a/lib/src/gherkin/ast/feature_file_visitor.dart b/lib/src/gherkin/ast/feature_file_visitor.dart index 4f0ca92..46c9fb4 100644 --- a/lib/src/gherkin/ast/feature_file_visitor.dart +++ b/lib/src/gherkin/ast/feature_file_visitor.dart @@ -37,8 +37,10 @@ class FeatureFileVisitor { for (final childScenario in allScenarios) { await visitScenario( feature.name, + feature.description, _tagsToList(feature.tags), childScenario.name, + childScenario.description, _tagsToList(childScenario.tags), path, isFirst: !acknowledgedScenarioPosition && isFirst, @@ -82,8 +84,10 @@ class FeatureFileVisitor { Future visitScenario( String featureName, + String? featureDescription, Iterable featureTags, String name, + String? description, Iterable tags, String path, { required bool isFirst, diff --git a/lib/src/gherkin/runnables/background.dart b/lib/src/gherkin/runnables/background.dart index 2916525..ba855db 100644 --- a/lib/src/gherkin/runnables/background.dart +++ b/lib/src/gherkin/runnables/background.dart @@ -3,5 +3,5 @@ import 'scenario.dart'; class BackgroundRunnable extends ScenarioRunnable { BackgroundRunnable(String name, RunnableDebugInformation debug) - : super(name, debug); + : super(name, null, debug); } diff --git a/lib/src/gherkin/runnables/scenario.dart b/lib/src/gherkin/runnables/scenario.dart index 56cf227..79eedba 100644 --- a/lib/src/gherkin/runnables/scenario.dart +++ b/lib/src/gherkin/runnables/scenario.dart @@ -5,15 +5,18 @@ import 'runnable.dart'; import 'scenario_type_enum.dart'; import 'step.dart'; import 'taggable_runnable_block.dart'; +import 'text_line.dart'; class ScenarioRunnable extends TaggableRunnableBlock { final String _name; + String? description; List steps = []; ScenarioType get scenarioType => ScenarioType.scenario; ScenarioRunnable( this._name, + this.description, RunnableDebugInformation debug, ) : super(debug); @@ -26,6 +29,9 @@ class ScenarioRunnable extends TaggableRunnableBlock { case StepRunnable: steps.add(child as StepRunnable); break; + case TextLineRunnable: + description = (child as TextLineRunnable).text; + break; case CommentLineRunnable: case EmptyLineRunnable: break; diff --git a/lib/src/gherkin/runnables/scenario_expanded_from_outline_example.dart b/lib/src/gherkin/runnables/scenario_expanded_from_outline_example.dart index 8c2f846..15907ce 100644 --- a/lib/src/gherkin/runnables/scenario_expanded_from_outline_example.dart +++ b/lib/src/gherkin/runnables/scenario_expanded_from_outline_example.dart @@ -13,9 +13,14 @@ class ScenarioExpandedFromOutlineExampleRunnable extends ScenarioRunnable { ScenarioExpandedFromOutlineExampleRunnable( String name, + String? description, RunnableDebugInformation debug, ) : _name = name, - super(name, debug); + super( + name, + description, + debug, + ); void setStepParameter(String parameterName, String value) { _name = _name.replaceAll('<$parameterName>', value); diff --git a/lib/src/gherkin/runnables/scenario_outline.dart b/lib/src/gherkin/runnables/scenario_outline.dart index 047da63..c9a42b7 100644 --- a/lib/src/gherkin/runnables/scenario_outline.dart +++ b/lib/src/gherkin/runnables/scenario_outline.dart @@ -13,8 +13,13 @@ class ScenarioOutlineRunnable extends ScenarioRunnable { ScenarioOutlineRunnable( String name, + String? description, RunnableDebugInformation debug, - ) : super(name, debug); + ) : super( + name, + description, + debug, + ); @override void addChild(Runnable child) { @@ -65,8 +70,11 @@ class ScenarioOutlineRunnable extends ScenarioRunnable { final clonedSteps = steps.map((step) => step.clone()).toList(); - final scenarioRunnable = - ScenarioExpandedFromOutlineExampleRunnable(exampleName, debug); + final scenarioRunnable = ScenarioExpandedFromOutlineExampleRunnable( + exampleName, + description, + debug, + ); exampleRow.forEach( (parameterName, value) { diff --git a/lib/src/gherkin/syntax/scenario_outline_syntax.dart b/lib/src/gherkin/syntax/scenario_outline_syntax.dart index 55c4553..855bd66 100644 --- a/lib/src/gherkin/syntax/scenario_outline_syntax.dart +++ b/lib/src/gherkin/syntax/scenario_outline_syntax.dart @@ -37,6 +37,10 @@ class ScenarioOutlineSyntax GherkinDialect dialect, ) { final name = pattern(dialect).firstMatch(line)!.group(1)!; - return ScenarioOutlineRunnable(name.trim(), debug); + return ScenarioOutlineRunnable( + name.trim(), + null, + debug, + ); } } diff --git a/lib/src/gherkin/syntax/scenario_syntax.dart b/lib/src/gherkin/syntax/scenario_syntax.dart index 715cdb0..ca07432 100644 --- a/lib/src/gherkin/syntax/scenario_syntax.dart +++ b/lib/src/gherkin/syntax/scenario_syntax.dart @@ -35,7 +35,11 @@ class ScenarioSyntax extends RegExMatchedGherkinSyntax { GherkinDialect dialect, ) { final name = pattern(dialect).firstMatch(line)!.group(1)!; - final runnable = ScenarioRunnable(name, debug); + final runnable = ScenarioRunnable( + name, + null, + debug, + ); return runnable; } diff --git a/lib/src/reporters/json/json_feature.dart b/lib/src/reporters/json/json_feature.dart index cd7ada2..3662876 100644 --- a/lib/src/reporters/json/json_feature.dart +++ b/lib/src/reporters/json/json_feature.dart @@ -5,7 +5,7 @@ import 'json_tag.dart'; class JsonFeature { final String uri; final String name; - final String description; + final String? description; final int line; final String? id; final Iterable tags; @@ -16,7 +16,7 @@ class JsonFeature { required this.uri, required this.name, required this.line, - this.description = '', + this.description, this.id, List? scenarios, Iterable? tags, @@ -29,6 +29,7 @@ class JsonFeature { uri: message.context.filePath, id: message.name.toLowerCase(), name: message.name, + description: message.description, line: message.context.nonZeroAdjustedLineNumber, tags: message.tags.map((t) => JsonTag.fromMessageTag(t)), ); @@ -66,7 +67,6 @@ class JsonFeature { Map toJson() { final result = { - 'description': description, 'id': id, 'keyword': 'Feature', 'line': line, @@ -74,6 +74,10 @@ class JsonFeature { 'uri': uri, }; + if (description?.isNotEmpty ?? false) { + result['description'] = description; + } + if (tags.isNotEmpty) { result['tags'] = tags.toList(); } diff --git a/lib/src/reporters/json/json_scenario.dart b/lib/src/reporters/json/json_scenario.dart index c302462..675f08e 100644 --- a/lib/src/reporters/json/json_scenario.dart +++ b/lib/src/reporters/json/json_scenario.dart @@ -14,8 +14,7 @@ class JsonScenario { /// Scenario name final String name; - /// Optional description. Default: '' - final String description; + final String? description; final int line; @@ -45,12 +44,11 @@ class JsonScenario { /// Scenario steps List steps; - //TODO(Shigomany): Make immutable class (final feature) JsonScenario({ required this.target, required this.name, required this.line, - this.description = '', + this.description, this.feature, this.passed, List? steps, @@ -67,6 +65,7 @@ class JsonScenario { static JsonScenario from(ScenarioMessage message) => JsonScenario( target: message.target, name: message.name, + description: message.description, line: message.context.nonZeroAdjustedLineNumber, passed: message.hasPassed, tags: message.tags @@ -104,11 +103,14 @@ class JsonScenario { 'type': 'scenario', 'id': '${feature?.id};${name.toLowerCase()}', 'name': name, - 'description': description, 'line': line, 'status': _calculateStatus() }; + if (description?.isNotEmpty ?? false) { + result['description'] = description!; + } + if (tags.isNotEmpty) { result['tags'] = tags.toList(); } diff --git a/lib/src/reporters/messages/feature/feature_message.dart b/lib/src/reporters/messages/feature/feature_message.dart index 1611dc6..653c8a0 100644 --- a/lib/src/reporters/messages/feature/feature_message.dart +++ b/lib/src/reporters/messages/feature/feature_message.dart @@ -6,12 +6,14 @@ part of '../messages.dart'; class FeatureMessage extends ActionMessage { /// Gherkin format tags final List tags; + final String? description; /// {@macro messages.featuremessage} FeatureMessage({ required String name, required RunnableDebugInformation context, this.tags = const [], + this.description, }) : super( target: Target.feature, name: name, @@ -22,11 +24,13 @@ class FeatureMessage extends ActionMessage { String? name, RunnableDebugInformation? context, List? tags, + String? description, }) { return FeatureMessage( name: name ?? this.name, context: context ?? this.context, tags: tags ?? this.tags, + description: description ?? this.description, ); } } diff --git a/lib/src/reporters/messages/scenario/scenario_message.dart b/lib/src/reporters/messages/scenario/scenario_message.dart index 1e089c7..72bd05b 100644 --- a/lib/src/reporters/messages/scenario/scenario_message.dart +++ b/lib/src/reporters/messages/scenario/scenario_message.dart @@ -10,13 +10,16 @@ class ScenarioMessage extends ActionMessage { /// Gherkin format tags final List tags; + final String? description; + /// {@macro messages.scenariomessage} ScenarioMessage({ required String name, required RunnableDebugInformation context, - Target target = Target.scenario, + this.description, this.hasPassed = false, this.tags = const [], + Target target = Target.scenario, }) : super( target: target, name: name, @@ -25,6 +28,7 @@ class ScenarioMessage extends ActionMessage { ScenarioMessage copyWith({ String? name, + String? description, RunnableDebugInformation? context, bool? hasPassed, List? tags, @@ -33,6 +37,7 @@ class ScenarioMessage extends ActionMessage { return ScenarioMessage( target: target ?? this.target, name: name ?? this.name, + description: description ?? this.description, context: context ?? this.context, hasPassed: hasPassed ?? this.hasPassed, tags: tags ?? this.tags, diff --git a/test/feature_file_runner_test.dart b/test/feature_file_runner_test.dart index 8ab9b38..c0bb34d 100644 --- a/test/feature_file_runner_test.dart +++ b/test/feature_file_runner_test.dart @@ -36,7 +36,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario); @@ -69,7 +69,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario); @@ -104,7 +104,7 @@ void main() { StepRunnable('Step 1', RunnableDebugInformation('', 0, stepTextOne)); final stepTwo = StepRunnable('Step 2', RunnableDebugInformation('', 0, stepTextTwo)); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step) ..steps.add(stepTwo); final feature = FeatureRunnable('1', emptyDebuggable) @@ -140,9 +140,9 @@ void main() { StepRunnable('Step 1', RunnableDebugInformation('', 0, stepTextOne)); final stepTwo = StepRunnable('Step 2', RunnableDebugInformation('', 0, stepTextTwo)); - final scenarioOne = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenarioOne = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(stepOne); - final scenarioTwo = ScenarioRunnable('Scenario: 2', emptyDebuggable) + final scenarioTwo = ScenarioRunnable('Scenario: 2', null, emptyDebuggable) ..steps.add(stepTwo); final featureOne = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenarioOne); @@ -180,9 +180,9 @@ void main() { StepRunnable('Step 1', RunnableDebugInformation('', 0, stepTextOne)); final stepTwo = StepRunnable('Step 2', RunnableDebugInformation('', 0, stepTextTwo)); - final scenarioOne = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenarioOne = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(stepOne); - final scenarioTwo = ScenarioRunnable('Scenario: 2', emptyDebuggable) + final scenarioTwo = ScenarioRunnable('Scenario: 2', null, emptyDebuggable) ..steps.add(stepTwo); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.addAll([scenarioOne, scenarioTwo]); @@ -218,7 +218,7 @@ void main() { StepRunnable('Step 1', RunnableDebugInformation('', 0, stepTextOne)); final stepTwo = StepRunnable('Step 2', RunnableDebugInformation('', 0, stepTextTwo)); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step) ..steps.add(stepTwo); final feature = FeatureRunnable('1', emptyDebuggable) @@ -262,7 +262,7 @@ void main() { StepRunnable('Step 1', RunnableDebugInformation('', 0, stepTextOne)); final stepTwo = StepRunnable('Step 2', RunnableDebugInformation('', 0, stepTextTwo)); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step) ..steps.add(stepTwo); final feature = FeatureRunnable('1', emptyDebuggable) @@ -292,7 +292,7 @@ void main() { 'Step 1', RunnableDebugInformation('File Path', 2, "Given I do 'a'"), ); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario); @@ -364,7 +364,7 @@ void main() { RunnableDebugInformation('', 0, 'Given I do a'), ); step.table = GherkinTable(const Iterable.empty(), null); - final scenario = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario); @@ -394,9 +394,9 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); - final scenario2 = ScenarioRunnable('Scenario: 2', emptyDebuggable) + final scenario2 = ScenarioRunnable('Scenario: 2', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario1) @@ -426,7 +426,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step) ..addTag(tagTwo); final feature = FeatureRunnable('1', emptyDebuggable) @@ -478,9 +478,9 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); - final scenario2 = ScenarioRunnable('Scenario: 2', emptyDebuggable) + final scenario2 = ScenarioRunnable('Scenario: 2', null, emptyDebuggable) ..steps.add(step) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) @@ -517,7 +517,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario1); @@ -552,7 +552,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario1); @@ -591,7 +591,7 @@ void main() { 'Step 1', RunnableDebugInformation('', 0, 'Given I do a'), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step); final feature = FeatureRunnable('1', emptyDebuggable) ..scenarios.add(scenario1); @@ -651,7 +651,7 @@ void main() { 'Step 3', RunnableDebugInformation('', 0, stepTextThree), ); - final scenario1 = ScenarioRunnable('Scenario: 1', emptyDebuggable) + final scenario1 = ScenarioRunnable('Scenario: 1', null, emptyDebuggable) ..steps.add(step) ..steps.add(stepTwo) ..steps.add(stepThree); diff --git a/test/gherkin/runnables/feature_test.dart b/test/gherkin/runnables/feature_test.dart index 368d4bd..f774054 100644 --- a/test/gherkin/runnables/feature_test.dart +++ b/test/gherkin/runnables/feature_test.dart @@ -28,7 +28,7 @@ void main() { final runnable = FeatureRunnable('', debugInfo); runnable.addChild(TagsRunnable(debugInfo)..tags = ['one', 'two']); runnable.addChild(TagsRunnable(debugInfo)..tags = ['three']); - final scenario = ScenarioRunnable('', debugInfo); + final scenario = ScenarioRunnable('', null, debugInfo); runnable.addChild(scenario); expect(tagsToList(scenario.tags), ['one', 'two', 'three']); }); @@ -42,9 +42,9 @@ void main() { }); test('can add ScenarioRunnable', () { final runnable = FeatureRunnable('', debugInfo); - runnable.addChild(ScenarioRunnable('1', debugInfo)); - runnable.addChild(ScenarioRunnable('2', debugInfo)); - runnable.addChild(ScenarioRunnable('3', debugInfo)); + runnable.addChild(ScenarioRunnable('1', null, debugInfo)); + runnable.addChild(ScenarioRunnable('2', null, debugInfo)); + runnable.addChild(ScenarioRunnable('3', null, debugInfo)); expect(runnable.scenarios.length, 3); expect(runnable.scenarios.elementAt(0).name, '1'); expect(runnable.scenarios.elementAt(1).name, '2'); diff --git a/test/gherkin/runnables/scenario_outline_test.dart b/test/gherkin/runnables/scenario_outline_test.dart index 5520791..49ff17b 100644 --- a/test/gherkin/runnables/scenario_outline_test.dart +++ b/test/gherkin/runnables/scenario_outline_test.dart @@ -11,12 +11,12 @@ void main() { final debugInfo = RunnableDebugInformation.empty(); group('addChild', () { test('can add EmptyLineRunnable', () { - final runnable = ScenarioOutlineRunnable('', debugInfo); + final runnable = ScenarioOutlineRunnable('', null, debugInfo); runnable.addChild(EmptyLineRunnable(debugInfo)); }); test('can add StepRunnable', () { - final runnable = ScenarioOutlineRunnable('', debugInfo); + final runnable = ScenarioOutlineRunnable('', null, debugInfo); runnable.addChild(StepRunnable('1', debugInfo)); runnable.addChild(StepRunnable('2', debugInfo)); runnable.addChild(StepRunnable('3', debugInfo)); @@ -27,7 +27,7 @@ void main() { }); test('can add TagsRunnable which are give to the example', () { - final runnable = ScenarioOutlineRunnable('', debugInfo); + final runnable = ScenarioOutlineRunnable('', null, debugInfo); final example = ExampleRunnable('', debugInfo); runnable.addChild(example); runnable.addTag(TagsRunnable(debugInfo)..tags = ['one']); @@ -36,13 +36,13 @@ void main() { }); test('can add ExamplesRunnable', () { - final runnable = ScenarioOutlineRunnable('', debugInfo); + final runnable = ScenarioOutlineRunnable('', null, debugInfo); runnable.addChild(ExampleRunnable('', debugInfo)); expect(runnable.examples, isNotNull); }); test('can add multiple ExamplesRunnable', () { - final runnable = ScenarioOutlineRunnable('outline one', debugInfo); + final runnable = ScenarioOutlineRunnable('outline one', null, debugInfo); runnable.addChild(ExampleRunnable('1', debugInfo)); runnable.addChild(ExampleRunnable('1', debugInfo)); expect(runnable.examples, isNotNull); @@ -52,6 +52,7 @@ void main() { test('can interpolate variables in the scenario name', () { final runnable = ScenarioOutlineRunnable( 'Scenario outline with parameters: , ', + null, debugInfo, ); final example = ExampleRunnable('', debugInfo); diff --git a/test/gherkin/runnables/scenario_test.dart b/test/gherkin/runnables/scenario_test.dart index 0cc20f4..d3b23c7 100644 --- a/test/gherkin/runnables/scenario_test.dart +++ b/test/gherkin/runnables/scenario_test.dart @@ -8,11 +8,11 @@ void main() { final debugInfo = RunnableDebugInformation.empty(); group('addChild', () { test('can add EmptyLineRunnable', () { - final runnable = ScenarioRunnable('', debugInfo); + final runnable = ScenarioRunnable('', null, debugInfo); runnable.addChild(EmptyLineRunnable(debugInfo)); }); test('can add StepRunnable', () { - final runnable = ScenarioRunnable('', debugInfo); + final runnable = ScenarioRunnable('', null, debugInfo); runnable.addChild(StepRunnable('1', debugInfo)); runnable.addChild(StepRunnable('2', debugInfo)); runnable.addChild(StepRunnable('3', debugInfo)); diff --git a/test/reporters/json_reporter_test.dart b/test/reporters/json_reporter_test.dart index 47ab583..78cef99 100644 --- a/test/reporters/json_reporter_test.dart +++ b/test/reporters/json_reporter_test.dart @@ -26,6 +26,7 @@ void main() { await reporter.feature.onStarted.invoke( FeatureMessage( name: 'Feature 1', + description: "Feature 1 description", context: RunnableDebugInformation('filepath', 2, 'linetext2'), tags: [Tag('tag1', 1)], ), @@ -34,6 +35,7 @@ void main() { await reporter.scenario.onStarted.invoke( ScenarioMessage( name: 'Scenario 1', + description: "Scenario 1 description", context: RunnableDebugInformation('filepath', 4, 'linetext4'), hasPassed: true, tags: [Tag('tag1', 1, isInherited: true), Tag('tag2', 3)], @@ -58,6 +60,7 @@ void main() { await reporter.scenario.onFinished.invoke( ScenarioMessage( name: 'Scenario 1', + description: "Scenario 1 description", context: RunnableDebugInformation('filepath', 4, 'linetext4'), hasPassed: true, ), @@ -66,6 +69,7 @@ void main() { await reporter.feature.onFinished.invoke( FeatureMessage( name: 'Feature 1', + description: "Feature 1 description", context: RunnableDebugInformation('filepath', 2, 'linetext2'), ), ); diff --git a/test/reporters/json_reports/report_1.json b/test/reporters/json_reports/report_1.json index 002adc5..e89c34a 100644 --- a/test/reporters/json_reports/report_1.json +++ b/test/reporters/json_reports/report_1.json @@ -1,11 +1,11 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, "name": "Feature 1", "uri": "filepath", + "description": "Feature 1 description", "tags": [ { "line": 2, @@ -18,9 +18,9 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "passed", + "description": "Scenario 1 description", "tags": [ { "line": 4, diff --git a/test/reporters/json_reports/report_2.json b/test/reporters/json_reports/report_2.json index c099952..7b18243 100644 --- a/test/reporters/json_reports/report_2.json +++ b/test/reporters/json_reports/report_2.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "failed", "tags": [ diff --git a/test/reporters/json_reports/report_3.json b/test/reporters/json_reports/report_3.json index a9c44ca..bafcaf1 100644 --- a/test/reporters/json_reports/report_3.json +++ b/test/reporters/json_reports/report_3.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "failed", "tags": [ diff --git a/test/reporters/json_reports/report_4.json b/test/reporters/json_reports/report_4.json index 7033421..931f600 100644 --- a/test/reporters/json_reports/report_4.json +++ b/test/reporters/json_reports/report_4.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "failed", "tags": [ diff --git a/test/reporters/json_reports/report_5.json b/test/reporters/json_reports/report_5.json index 75266aa..63947d5 100644 --- a/test/reporters/json_reports/report_5.json +++ b/test/reporters/json_reports/report_5.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "passed", "tags": [ diff --git a/test/reporters/json_reports/report_6.json b/test/reporters/json_reports/report_6.json index b423a0d..333978f 100644 --- a/test/reporters/json_reports/report_6.json +++ b/test/reporters/json_reports/report_6.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario outline 1", "name": "Scenario Outline 1", - "description": "", "line": 5, "status": "passed", "tags": [ diff --git a/test/reporters/json_reports/report_7.json b/test/reporters/json_reports/report_7.json index ba5fdeb..30c0988 100644 --- a/test/reporters/json_reports/report_7.json +++ b/test/reporters/json_reports/report_7.json @@ -1,20 +1,20 @@ [ { - "description": "An unnamed feature is possible if something is logged before any feature has started to execute", "id": null, "keyword": "Feature", "line": 0, "name": "Unnamed feature", "uri": "unknown", + "description": "An unnamed feature is possible if something is logged before any feature has started to execute", "elements": [ { "keyword": "Scenario", "type": "scenario", "id": "null;unnamed", "name": "Unnamed", - "description": "An unnamed scenario is possible if something is logged before any feature has started to execute", "line": 0, - "status":"failed", + "status": "failed", + "description": "An unnamed scenario is possible if something is logged before any feature has started to execute", "steps": [ { "keyword": null, diff --git a/test/reporters/json_reports/report_8.json b/test/reporters/json_reports/report_8.json index e968ad6..28f1512 100644 --- a/test/reporters/json_reports/report_8.json +++ b/test/reporters/json_reports/report_8.json @@ -1,6 +1,5 @@ [ { - "description": "", "id": "feature 1", "keyword": "Feature", "line": 3, @@ -18,7 +17,6 @@ "type": "scenario", "id": "feature 1;scenario 1", "name": "Scenario 1", - "description": "", "line": 5, "status": "failed", "tags": [ @@ -58,7 +56,6 @@ ] }, { - "description": "", "id": "feature 2", "keyword": "Feature", "line": 3, @@ -76,7 +73,6 @@ "type": "scenario", "id": "feature 2;scenario 2", "name": "Scenario 2", - "description": "", "line": 5, "status": "passed", "tags": [