Support AND(intersection) when filtering by multiple tags in the Awesome report (Allure 3) #3504
Replies: 1 comment
|
The Tags control currently does OR within its selected tags; the AND between different filter groups doesn't change that. The array-filter builder explicitly ORs the selected values. For an exact intersection without changing the frontend, you can generate a separate Awesome report using its import { defineConfig } from 'allure';
const requiredTags = ['comp-x', 'v2'];
export default defineConfig({
output: './allure-report-intersection',
plugins: {
awesome: {
options: {
filter: (testResult) => {
const tags = new Set(
testResult.labels
.filter((label) => label.name === 'tag')
.map((label) => label.value),
);
return requiredTags.every((tag) => tags.has(tag));
},
},
},
},
});Regenerate the report from your results with this configuration. Test A passes the predicate; B and C don't. Other extra tags don't disqualify a test. This is generation-time filtering, not a way to switch the existing report's Tags checkboxes to AND. If you need interactive selection of arbitrary tag combinations in the already-generated report, that still needs a frontend change. Full-text search isn't an exact substitute because it can also match names and other fields. The callback is present in Awesome's 3.19.1 options and is passed to the result selection and statistics. Use a JS/TS configuration, not JSON/YAML: the configuration docs note that declarative formats don't support test-filter functions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In the Awesome report(allure 3), selecting multiple tags in the Tags filter combines them with OR(union) as a result test matches if it has any of the selected tags. There is no way to combine tags with AND(intersection) to show only tests that have all the selected tags. This makes it hard to narrow a large test population along two or more independent tag dimensions at once.
Example:
Given tests tagged with two dimensions
Test A has tag comp-x and v2
Test B has tag comp-x and v1
Test C has tag comp-y and v2
Selecting comp-x and v2 currently return Test A, B and C (union). The desired result is only Test A, which is the test that carries both tags.
Please provide a recommendation/solution to combine selected tags with AND instead of OR in the Awesome report.
All reactions