Skip to content

Commit bf3755b

Browse files
mrtnvhrenovate-botrenovate[bot]lpelypenko
authored
chore: v2.4.0 (#138)
Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Liliia Pelypenko <[email protected]>
1 parent 84c4176 commit bf3755b

File tree

10 files changed

+611
-310
lines changed

10 files changed

+611
-310
lines changed

docs/images/tags.png

261 KB
Loading

docs/usage/metadata.md

+33
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,34 @@ test.meta({
5252
}).skip('Example planned test', async (t) => {
5353
// Test Code
5454
});
55+
56+
test.meta({
57+
severity: Severity.TRIVIAL,
58+
issue: 'TEST-ISSUE',
59+
description: 'An example discription',
60+
epic: 'Example Epic Ticket',
61+
feature: 'Example Feature Ticket',
62+
story: 'Example Story Ticket',
63+
suite: 'Main Example Group',
64+
tags: ['automated', 'smoke', 'e2e']
65+
// ... any other key: value property as custom metadata
66+
})('Example test with metadata', async (t) => {
67+
// Test Code
68+
});
69+
70+
test.meta({
71+
severity: Severity.TRIVIAL,
72+
issue: 'TEST-ISSUE',
73+
description: 'An example discription',
74+
epic: 'Example Epic Ticket',
75+
feature: 'Example Feature Ticket',
76+
story: 'Example Story Ticket',
77+
suite: 'Main Example Group',
78+
tags: 'e2e'
79+
// ... any other key: value property as custom metadata
80+
})('Example test with metadata where tag can be a string', async (t) => {
81+
// Test Code
82+
});
5583
```
5684

5785
## Pré-defined metadata
@@ -63,6 +91,7 @@ test.meta({
6391
| Epic, Feature, Story | To sort the tests based on the `epic`, `feature`, and/or `story`, these metadata options can be used to form a tree structure. The tree is structured as follows: An epic can have multiple features, a feature can have multiple stories, and a story can have multiple tests. |
6492
| Suite | Within the Allure Report, the tests are organized by `fixture` by default. For a more expansive organization of the tests and fixtures, the `suite` parameter can be set. When the `suite` parameter is set within a `test`, a subcategory is created within the `fixture` that will group all tests that have the same `suite` parameter together. When the `suite` parameter is set within a `fixture`, a parent category is created that will group multiple fixtures that have the same `suite` parameter. |
6593
| skipReason | A test meta tag to allow showing skip reason in allure categories. |
94+
| tags | A test meta tag to allow showing tags in allure report. It is recommended to pass "tags" as an array of strings |
6695

6796
## Custom metadata
6897

@@ -88,6 +117,10 @@ Skip reason will be shown as a message on test result overview:
88117

89118
Skip message can be used as a filter in allure categories view.
90119

120+
### Example of a test result view for a test with 'tags' metadata
121+
122+
![Example of the metadata for test with "tags" metadata.](../images/tags.png)
123+
91124
## Categories
92125

93126
Example of a custom `allure-categories.config.js` with `skipReason` message to be in `messageRegex` filter:

examples/base-implementation-with-custom-config/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
},
1515
"homepage": "https://github.com/isaaceindhoven/testcafe-reporter-allure#readme",
1616
"scripts": {
17-
"test:e2e:cli": "testcafe firefox tests/example.spec.ts --reporter allure --screenshots path=allure/screenshots,takeOnFails=true",
1817
"test:doc:example": "testcafe firefox tests/docMetaExample.spec.ts --reporter allure --screenshots path=allure/screenshots,takeOnFails=true",
19-
"allure": "allure generate ./allure/allure-results --clean -o ./allure/allure-report && allure open ./allure/allure-report",
18+
"allure": "allure generate ./allure-results --clean -o ./allure/allure-report && allure open ./allure/allure-report",
2019
"list:browsers": "testcafe --list-browsers"
2120
},
2221
"devDependencies": {

examples/base-implementation-with-custom-config/tests/docMetaExample.spec.ts

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ test.meta({
88
feature: 'Example Feature Ticket',
99
story: 'Example Story Ticket',
1010
suite: 'Main Example Group',
11+
tags: ['e2e', 'automated', 'smoke'],
1112
// ... any other key: value property as custom metadata
1213
})('Example test with metadata', async () => {
1314
// Test Code
@@ -38,9 +39,20 @@ test
3839
feature: 'Example Feature Ticket',
3940
story: 'Example Story Ticket',
4041
suite: 'Main Example Group',
42+
tags: ['e2e', 'not-automated'],
4143
skipReason: 'Skipped: Not automated',
4244
// ... any other key: value property as custom metadata
4345
})
4446
.skip('Example planned test', async () => {
4547
// Test Code
4648
});
49+
50+
test
51+
.meta({
52+
suite: 'Another Example Group',
53+
tags: 'not-automated', // string tags are also supported
54+
skipReason: 'Not automated',
55+
})
56+
.skip('Example not automated e2e test 3', async () => {
57+
// planned test
58+
});

examples/base-implementation-with-custom-config/tests/example.spec.ts

-131
This file was deleted.

0 commit comments

Comments
 (0)