Implement titlePath
to improve the default hierarchy of test results
#1260
Labels
titlePath
to improve the default hierarchy of test results
#1260
Is your feature request related to a problem? Please describe.
Allure 2 comes with three built-in hierarchies:
suites
,bdd
, andpackages
. Each comes with some drawbacks.package
is a well-known label that is usually automatically filled by Allure integrations. When opening the report, Allure splits thepackage
values by.
and groups them into a tree. Eachpackage
value therefore is a path to the node containing the test result in that tree.The drawbacks:
.
. If a path fragment (e.g., a filename) contains.
, it might lead to unexpected results.suite
andbdd
are based on two sets of labels:parentSuite
,suite
, andsubSuite
andepic
,feature
, andstory
. Each label corresponds to one level of the corresponding hierarchy. Many integrations fill one of the hierarchies, leaving the other to a user.The drawbacks:
suite
labels). It's not clear how to deal with this. Currently, Allure will show it multiple times in the tree, which may be confusing.Describe the solution you'd like
A solution is to introduce the default hierarchy directly to Allure model. The
TestResult
type should include a new property, say,titlePath
, which, should be an array of strings (most probably).Rules for integrations:
titlePath
values of the corresponding test results.titlePath
if and only if theya) correspond to the same test (e.g., are two retries of the test), or
b) correspond to sibling tests (i.e., tests that share all their parents: suites/files/packages/etc).
Note
A combination of a test's
titlePath
and name can also be used to calculate thefullName
value.Allure 3 will use
titlePath
values to display the test results in a tree view similar to how it usespackage
labels. The main difference is that no splitting is involved (values are already arrays), which means no ambiguous split characters and no need for encoding/decoding.Example
Suppose we have the following tests:
In
foo.test.js
:In
dir/bar.test.js
:In
dir/baz.test.js
:When run, the test results with the following
titlePath
values are created:Allure Report will display the results in the form of the following tree (it may compress nodes with a sinlge child):
The text was updated successfully, but these errors were encountered: