allure-js icon indicating copy to clipboard operation
allure-js copied to clipboard

[allure-jest] Add API to write environment info

Open maks-rafalko opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Currently, it's impossible to add environment information, displayed on the main page of Allure report: https://allurereport.org/docs/jest/#environment-information

Describe the solution you'd like

I would like to make it working out of the box in allure-jest reporter, for example adding this information in Jest configuration (https://allurereport.org/docs/jest-configuration/#allure-jest-configuration) or just by calling some public method on global.allure

Describe alternatives you've considered

N/A

Additional context

Currently, there is a method writeEnvironmentInfo() on AllureRuntime interface, but this is an internal thing which is not available for public usage in allure-jest.

Related to more common request: https://github.com/allure-framework/allure-js/issues/181

maks-rafalko avatar May 27 '24 16:05 maks-rafalko

fixed in #1021

baev avatar Jun 27 '24 11:06 baev

Though it would be nice to have .writeEnvironmentInfo({...}) public API for Jest, as currently we write there dynamic data, not only data from jest config. In referenced PR I see in allure-jest test only the case with config.

maks-rafalko avatar Jun 27 '24 12:06 maks-rafalko

up

We are upgrading to v3 and we still can't dynamically write environment info. Please consider to somehow allow providing dynamic values.

Our use case - we test N microservices and get their versions by calling external URls, so our retrieval logic is async. We can't write these values inside jest.config.ts as static values.

maks-rafalko avatar Mar 31 '25 11:03 maks-rafalko