Giter Site home page Giter Site logo

vinipx / allure-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from allure-framework/allure-java

0.0 0.0 0.0 2.11 MB

Allure integrations for Java test frameworks

License: Apache License 2.0

Java 90.15% Scala 0.79% Groovy 0.67% Kotlin 3.02% FreeMarker 3.59% Gherkin 1.78%

allure-java's Introduction

Allure Java Integrations

Build Allure Java

The repository contains new versions of adaptors for JVM-based test frameworks.

All the artifacts are deployed to https://dl.bintray.com/qameta/maven.

TestNG

The new TestNG adaptors is pretty much ready. To use the adaptor you should add the following dependency:

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-testng</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

also you need to configure AspectJ weaver to support steps.

JUnit 4

The first draft of a new JUnit 4 adaptor is ready. To use the adaptor you should add the following dependency:

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-junit4</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

JUnit 5

To use JUnit 5 simply add the following dependency to your project:

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-junit5</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Selenide

Listener for Selenide, that logging steps for Allure:

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-selenide</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

SelenideLogger.addListener("AllureSelenide", new AllureSelenide().screenshots(true).savePageSource(false));

Capture selenium logs:
SelenideLogger.addListener("AllureSelenide", new AllureSelenide().enableLogs(LogType.BROWSER, Level.ALL));
https://github.com/SeleniumHQ/selenium/wiki/Logging

Rest Assured

Filter for rest-assured http client, that generates attachment for allure.

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-rest-assured</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

.filter(new AllureRestAssured())

You can specify custom templates, which should be placed in src/main/resources/tpl folder:

.filter(new AllureRestAssured()
        .withRequestTemplate("custom-http-request.ftl")
        .withResponseTemplate("custom-http-response.ftl"))

OkHttp

Interceptor for OkHttp client, that generates attachment for allure.

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-okhttp3</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

.addInterceptor(new AllureOkHttp3())

You can specify custom templates, which should be placed in src/main/resources/tpl folder:

.addInterceptor(new AllureOkHttp3()
                .withRequestTemplate("custom-http-request.ftl")
                .withResponseTemplate("custom-http-response.ftl"))

gRPC

Interceptor for gRPC stubs, that generates attachment for allure.

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-grpc</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

.newBlockingStub(channel).withInterceptors(new AllureGrpc());

You can enable interception of response metadata (disabled by default)

.withInterceptors(new AllureGrpc()
                .interceptResponseMetadata(true))

By default, a step will be marked as failed in case that response contains any statuses except 0(OK). You can change this behavior, for example, for negative scenarios

.withInterceptors(new AllureGrpc()
                .markStepFailedOnNonZeroCode(false))

You can specify custom templates, which should be placed in src/main/resources/tpl folder:

.withInterceptors(new AllureGrpc()
                .setRequestTemplate("custom-http-request.ftl")
                .setResponseTemplate("custom-http-response.ftl"))

Http client

Interceptors for Apache HTTP client, that generates attachment for allure.

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-httpclient</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

.addInterceptorFirst(new AllureHttpClientRequest())
.addInterceptorLast(new AllureHttpClientResponse());

JAX-RS Filter

Filter that can be used with JAX-RS compliant clients such as RESTeasy and Jersey

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-jax-rs</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

.register(AllureJaxRs.class)

JsonUnit

JsonPatchMatcher is extension of JsonUnit matcher, that generates pretty html attachment for differences based on json diff patch.

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-jsonunit</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Awaitility

Extended logging for poling and ignored exceptions for awaitility. For more usage example look into module allure-awaitility

<dependency>
   <groupId>io.qameta.allure</groupId>
   <artifactId>allure-awaitility</artifactId>
   <version>$LATEST_VERSION</version>
</dependency>

Usage example:

Awaitility.setDefaultConditionEvaluationListener(new AllureAwaitilityListener());

allure-java's People

Contributors

baev avatar dependabot[bot] avatar qameta-ci avatar eroshenkoam avatar viclovsky avatar ehborisov avatar letsrokk avatar clicman avatar jsa34 avatar valfirst avatar sspotanin avatar simple-elf avatar gladnik avatar jkttt avatar sskorol avatar vbragin avatar a-simeshin avatar yuri-kudryavtsev avatar metallfox avatar ervuks avatar dalapenko avatar borisosipov avatar baflqa avatar legionivo avatar asolntsev avatar ogulcanarbc avatar pavlonikolenko avatar proton72 avatar rusg77 avatar ahtutejlo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.