extentreports-testng-adapter

TestNG adapter for Extent Framework

License

License

Categories

Categories

TestNG Unit Testing
GroupId

GroupId

com.aventstack
ArtifactId

ArtifactId

extentreports-testng-adapter
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

extentreports-testng-adapter
TestNG adapter for Extent Framework
Project URL

Project URL

http://extentreports.com
Source Code Management

Source Code Management

https://github.com/extent-framework/extentreports-testng-adapter

Download extentreports-testng-adapter

How to add to project

<!-- https://jarcasting.com/artifacts/com.aventstack/extentreports-testng-adapter/ -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-testng-adapter</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.aventstack/extentreports-testng-adapter/
implementation 'com.aventstack:extentreports-testng-adapter:1.2.2'
// https://jarcasting.com/artifacts/com.aventstack/extentreports-testng-adapter/
implementation ("com.aventstack:extentreports-testng-adapter:1.2.2")
'com.aventstack:extentreports-testng-adapter:jar:1.2.2'
<dependency org="com.aventstack" name="extentreports-testng-adapter" rev="1.2.2">
  <artifact name="extentreports-testng-adapter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.aventstack', module='extentreports-testng-adapter', version='1.2.2')
)
libraryDependencies += "com.aventstack" % "extentreports-testng-adapter" % "1.2.2"
[com.aventstack/extentreports-testng-adapter "1.2.2"]

Dependencies

compile (4)

Group / Artifact Type Version
com.aventstack : extentreports jar 5.0.1
com.aventstack : klov-reporter jar 5.0.1
org.mongodb : mongodb-driver jar 3.3.0
org.testng : testng jar 7.1.0

Project Modules

There are no modules declared in this project.

ExtentReports Plugin for TestNG Maven Central

Docs

See here for complete docs.

See the Listeners section for usage instructions.

Examples

An example project is available here to understand the usage.

Note: when using this adapter, you are not required to add any code in your project. The adapter works for you to generate the report, perform auto-configuration through the configuration file, and you can also enable/disable reporters from the properties file.

See this example of how a test is created, marked with the listener. Note: a good approach is to mark a common base class with the @Listener only once.

import com.aventstack.extentreports.testng.listener.ExtentITestListenerClassAdapter;

@Listeners({ExtentITestListenerClassAdapter.class})
public class SimpleAssertTests {

    @Test
    public void passTest() {
        Assert.assertTrue(true);
    }
    
    @Test
    public void failTest() {
        Assert.assertTrue(false);
    }
    
}

Config

Configuration can be added under src/test/resources as shown here. Note the contents of extent.properties which can be used to enable/disable reporters, set path to the configuration file, and also to output to a desired location.

# spark-reporter
extent.reporter.spark.start=true
extent.reporter.spark.config=
extent.reporter.spark.out=test-output/SparkReport/Index.html

# klov-reporter
extent.reporter.klov.start=false
extent.reporter.klov.config=src/test/resources/klov.properties

# json-reporter
extent.reporter.json.start=false
extent.reporter.json.out=test-output/JsonReport/Extent.json

Klov

If you are using Klov (version 1.0+), extra configuration would be required, which can be loaded from extent.reporter.klov.config above.

mongodb.host=127.0.0.1
mongodb.port=27017
mongodb.uri=
klov.host=http://127.0.0.1
klov.port=80
klov.project.name=ProjectName
klov.report.name=

License

TestNG plugin for ExtentReports is open-source software and licensed under Apache-2.

com.aventstack

ExtentReports

A customizable logger-style reporting API

Versions

Version
1.2.2
1.2.1
1.2.0
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0