-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interestedwdio-allure-reporter
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
v16.13.2
Mode
WDIO Testrunner
Which capabilities are you using?
No response
What happened?
When using allureReporter.addEnvironment() the new value overwrites the last value.
The problem comes from
| this._allure.writeEnvironmentInfo({ |
I guess the reason is that in allure reporter you should now set all environment variables at once as it is a Record<string,string>, which makes IMHO also sense.
What is your expected behavior?
I have two approaches to solve the problem, and I'm happy to implement whichever one the community prefers.
- Setting all variables in wdio.conf in the reporter configuration is the first approach. Normally, you would not/should not change environment variables during the tests. So IMHO something like this makes sense:
reporters: [['allure', {
outputDir: 'allure-results',
environment: [
a:'a',
b:'b'
]
}]],
- Changing
addEnvironment(name: string, value: string)tosetEnvironment(Record<string,string>)is the second approach.
The second one is more flexible, but in my opinion, the first one is the right approach because the second one opens the door to mistakes and makes it possible to overwrite the environment variable information.
How to reproduce the bug.
Just write this anywhere in your test:
allureReporter.addEnvironment('d', 'c');
allureReporter.addEnvironment('a', 'b');
Relevant log output
a bCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interestedwdio-allure-reporter