-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
historyId does not take dynamic allure parameters into account #1230
Comments
You need to mark the parameter as excluded. See https://allurereport.org/docs/how-it-works-test-result-file/#parameters-array for details: Then("do something", async () => {
await allure.parameter('randomNumber', Math.random(), { excluded: true });
}); |
I tried your proposal, but it seems you got me wrong. My expectation is, that when running the same test several times and just a parameter changing, allure creates different entries. But currently I only see one of the entries, even with your suggestion. When adding e.g. the version hash to the historyId, I get the above result, as expected. |
I tried to reproduce the problem. However, I had no luck: As you suggested, I added the dynamic parameter: import { Given } from "@cucumber/cucumber";
import { parameter } from "allure-js-commons";
Given("sample step", async function () {
await parameter('randomNumber',String(Math.random()));
}); when I run tests two times: $ npm test
$ npm test then, the report shows two different results as expected ![]() if I exclude the dynamic parameter import { Given } from "@cucumber/cucumber";
import { parameter } from "allure-js-commons";
Given("sample step", async function () {
await parameter('randomNumber',String(Math.random()), { excluded: true });
}); then only the last result is shown: ![]() It looks to me like everything works as expected. The example I used: https://github.com/allure-examples/cucumberjs-npm-cjs-ts. |
When taking a look at your response, I had an idea: Sorry for the wrong example above - I thought this is a general problem. Can you reproduce it, when adding the parameter in the hook? |
Describe the bug
When executing the same test several times and adding a dynamic parameter, the allure report just shows one test result. The same issue was already reported for allure-python.
To Reproduce
Steps to reproduce the behavior:
Run a cucumberjs test multiple time and add a dynamic parameter to create multiple result files:
Expected behavior
There should be one test case per run.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: