You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several test frameworks support representing additional meta-data in the test result output. They go by different names (traits, groups, properties, etc) but would make sense to represent as a map of unique values as part of the TestCase:
My experience is mostly centered in xUnit, NUnit, MSTest and SpecFlow (Cucumber), so I would value input for the others listed here. I've done some research to illustrate how this could be included across the various platforms:
Not all jUnit runners allow you to specify properties. Playwright and PyTest seem to do this out-of-the-box. The surefire maven plugin appears to set properties based on parsing test output.
It would seem that properties can be set in either the testsuite or testcase level. Values at the testcase level can override the suite level. The testcase would inherit the meta-data of the parent suite.
Given that groups are not represented as a key-value-pair, they might have to be represented as a comma-delimited value, keys with empty values or both:
The Cucumber JSON format includes a Tag element -- example here -- at the Feature and Scenario level. Tags are often used as runtime hooks or as categorization. The tag value in the gherkin output indicates the line number. Based on the un-informed sample I found, it would appear that the tags from the Feature are automatically propagated to the Scenario.
I don't know if the "line" value would have meaning to those reading the results, but it may be valuable to include both the line number and a comma-delimited value for tags:
Tags will be processed as follows:
Tags that contain an equals operator, such as @testCase=1234, will be parsed into key-value pairs.
Tags without an equals operator will be added to the meta with an empty value.
All processed tags will be added as a comma-delimited string, which allows users to iterate over the tags.
It does not appear that mocha has a native tagging mechanism capability, but their documentation recommends using @tag or #tag declarations and using grep to perform the filtering.
// app.specs.jsdescribe('app',function(){describe('GET /download/:file',function(){it('should respond with the file @slow',function(){})})})
Following mocha's wiki guidance, perhaps it would make sense to parse the # and @ attributes as meta-data, and repeat the above comma-delimited approach suggested above:
Several test frameworks support representing additional meta-data in the test result output. They go by different names (traits, groups, properties, etc) but would make sense to represent as a map of unique values as part of the TestCase:
My experience is mostly centered in xUnit, NUnit, MSTest and SpecFlow (Cucumber), so I would value input for the others listed here. I've done some research to illustrate how this could be included across the various platforms:
xUnit: Traits
Traits are set at the test level.
Represented as meta_data:
jUnit: Properties
Not all jUnit runners allow you to specify properties. Playwright and PyTest seem to do this out-of-the-box. The surefire maven plugin appears to set properties based on parsing test output.
It would seem that properties can be set in either the
testsuite
ortestcase
level. Values at thetestcase
level can override the suite level. The testcase would inherit the meta-data of the parent suite.Represented as meta_data:
TestNG: Groups
TestNG supports the concept of "groups" which allow you to categorize tests and limit execution at runtime. Groups appear in the test xml output.
Given that groups are not represented as a key-value-pair, they might have to be represented as a comma-delimited value, keys with empty values or both:
Cucumber: Tags
The Cucumber JSON format includes a
Tag
element -- example here -- at the Feature and Scenario level. Tags are often used as runtime hooks or as categorization. The tag value in the gherkin output indicates the line number. Based on the un-informed sample I found, it would appear that the tags from the Feature are automatically propagated to the Scenario.I don't know if the "line" value would have meaning to those reading the results, but it may be valuable to include both the line number and a comma-delimited value for tags:Tags will be processed as follows:
@testCase=1234
, will be parsed into key-value pairs.tagsRaw
.Mocha: Tag naming conventions
It does not appear that mocha has a native tagging mechanism capability, but their documentation recommends using
@tag
or#tag
declarations and using grep to perform the filtering.Following mocha's wiki guidance, perhaps it would make sense to parse the
#
and@
attributes as meta-data, and repeat the above comma-delimited approach suggested above:Tags that contain an equals operator (
=
) will be parsed into unique key-value pairs:I'm happy to open or contribute to a PR for this.
The text was updated successfully, but these errors were encountered: