Skip to content

Commit 8495340

Browse files
committed
Example of Allure environment writer
1 parent 86668bf commit 8495340

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ dependencies {
7575
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.3")
7676
testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
7777
testImplementation("io.qameta.allure:allure-junit5:$allureVersion")
78+
testImplementation("com.github.automatedowl:allure-environment-writer:1.0.0")
7879
testImplementation("org.assertj:assertj-core:3.26.3")
7980
testImplementation("ch.qos.logback:logback-classic:1.5.6")
8081
testImplementation("ch.qos.logback:logback-core:1.5.6")

src/test/java/com/github/eataborda/ui/features/StandardUserTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.github.eataborda.ui.resources.*;
55
import com.github.eataborda.ui.pages.*;
66
import com.github.eataborda.ui.steps.*;
7+
import com.google.common.collect.ImmutableMap;
78
import io.qameta.allure.*;
89
import org.assertj.core.api.SoftAssertions;
910
import org.junit.jupiter.api.*;
@@ -13,6 +14,9 @@
1314
import java.util.Arrays;
1415
import java.util.List;
1516

17+
import static com.github.automatedowl.tools.AllureEnvironmentWriter.allureEnvironmentWriter;
18+
19+
1620
@Tags(value = {@Tag(AnnotationValues.STANDARD_USER_TAG),
1721
@Tag(AnnotationValues.SMOKE_TAG), @Tag(AnnotationValues.REGRESSION_TAG)})
1822
@DisplayName("Standard User")
@@ -28,6 +32,17 @@ public class StandardUserTest {
2832

2933
ArrayList<String> itemList = new ArrayList<String>(Arrays.asList("Sauce Labs Backpack", "Sauce Labs Bolt T-Shirt", "Sauce Labs Fleece Jacket"));
3034

35+
@BeforeAll
36+
static void generalConfig() {
37+
allureEnvironmentWriter(
38+
ImmutableMap.<String, String>builder()
39+
.put("OS", "Linux")
40+
.put("Distribution", "Ubuntu")
41+
.put("Browser", "Chrome")
42+
.put("Browser version", "128")
43+
.build(), "/build/allure-results/"
44+
);
45+
}
3146

3247
@BeforeEach
3348
public void setupTest() {

0 commit comments

Comments
 (0)