https://github.com/automatedowl/allure-environment-writer
Java library which allows to write environment.xml file into allure-results directory.
https://github.com/automatedowl/allure-environment-writer
allure-report java reporting-tool testing-tools testng
Last synced: 5 months ago
JSON representation
Java library which allows to write environment.xml file into allure-results directory.
- Host: GitHub
- URL: https://github.com/automatedowl/allure-environment-writer
- Owner: AutomatedOwl
- License: apache-2.0
- Created: 2018-12-03T12:04:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T09:22:38.000Z (almost 2 years ago)
- Last Synced: 2024-12-22T13:24:00.088Z (10 months ago)
- Topics: allure-report, java, reporting-tool, testing-tools, testng
- Language: Java
- Size: 42 KB
- Stars: 24
- Watchers: 3
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# allure-environment-writer
Java library which allows to write environment.xml file into allure-results directory.
Currently, the library supports Allure report with either JUnit or TestNG. It would allow you:* Easily write the environment.xml file to allure-results directory in any stage of your test.
* Flexible path of 'allure-results' directory.
* Use ImmutableMap to create immutable set of values for the environment to contain.### Example of common usage (default path is target/allure-results):
```
import static com.github.automatedowl.tools.AllureEnvironmentWriter.allureEnvironmentWriter;public class SomeTests {
@BeforeSuite
void setAllureEnvironment() {
allureEnvironmentWriter(
ImmutableMap.builder()
.put("Browser", "Chrome")
.put("Browser.Version", "70.0.3538.77")
.put("URL", "http://testjs.site88.net")
.build());
}@Test
void sanityOneTest() {
Assert.assertTrue(true);
}@Test
void sanityTwoTest() {
Assert.assertTrue(true);
}
}
```### Example of usage with customized allure-results path:
```
import static com.github.automatedowl.tools.AllureEnvironmentWriter.allureEnvironmentWriter;public class SomeTests {
@BeforeSuite
void setAllureEnvironment() {
allureEnvironmentWriter(
ImmutableMap.builder()
.put("Browser", "Chrome")
.put("Browser.Version", "70.0.3538.77")
.put("URL", "http://testjs.site88.net")
.build(), System.getProperty("user.dir")
+ "/allure-results/");
}@Test
void someTest() {
Assert.assertTrue(true);
}
}
```### Sanpshot of received environment data in Allure report:

### Maven dependencies
```
com.github.automatedowl
allure-environment-writer
1.0.0
```