Skip to content

Commit

Permalink
Example of Allure environment writer
Browse files Browse the repository at this point in the history
  • Loading branch information
eataborda committed Sep 2, 2024
1 parent 86668bf commit 8495340
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.3")
testImplementation(platform("io.qameta.allure:allure-bom:$allureVersion"))
testImplementation("io.qameta.allure:allure-junit5:$allureVersion")
testImplementation("com.github.automatedowl:allure-environment-writer:1.0.0")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("ch.qos.logback:logback-classic:1.5.6")
testImplementation("ch.qos.logback:logback-core:1.5.6")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.github.eataborda.ui.resources.*;
import com.github.eataborda.ui.pages.*;
import com.github.eataborda.ui.steps.*;
import com.google.common.collect.ImmutableMap;
import io.qameta.allure.*;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.*;
Expand All @@ -13,6 +14,9 @@
import java.util.Arrays;
import java.util.List;

import static com.github.automatedowl.tools.AllureEnvironmentWriter.allureEnvironmentWriter;


@Tags(value = {@Tag(AnnotationValues.STANDARD_USER_TAG),
@Tag(AnnotationValues.SMOKE_TAG), @Tag(AnnotationValues.REGRESSION_TAG)})
@DisplayName("Standard User")
Expand All @@ -28,6 +32,17 @@ public class StandardUserTest {

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

@BeforeAll
static void generalConfig() {
allureEnvironmentWriter(
ImmutableMap.<String, String>builder()
.put("OS", "Linux")
.put("Distribution", "Ubuntu")
.put("Browser", "Chrome")
.put("Browser version", "128")
.build(), "/build/allure-results/"
);
}

@BeforeEach
public void setupTest() {
Expand Down

0 comments on commit 8495340

Please sign in to comment.