-
Notifications
You must be signed in to change notification settings - Fork 31
TestNG Binder
Difido can use with the TestNG framework to create flexible reports that can be viewed at run-time.
An example for existing TestNG project that make use of the Difido reports can be found here
IMPORTANT: Difido doesn't support TestNG version 7.x.x. Please use TestNG 6.x.x
The Difido project
<dependency>
<groupId>il.co.top-q.difido</groupId>
<artifactId>difido-testng</artifactId>
<version>3.1.01</version>
</dependency>
You can register the Difido in any standard TestNG registration method. The recommended way is to use @Listeners annotation
@Listeners(il.co.topq.difido.ReportManagerHook.class)
public abstract class AbstractTestCase {
protected ReportDispatcher report = ReportManager.getInstance();
}
After registration, the report dispatcher object is available for your use.
All of the report functionality is exposed via the ReportDispatcher
that was instantiated in the above code snippet.
Here are some usage examples:
report.log("Simple log message");
report.log("Message with toggle", "The toggle body");
report.log("Message that fails the test", Status.failure);
report.logHtml("Html message", "<b>Will appear in bold</b>", Status.success);
report.addTestProperty("User", "Itai");
report.addRunProperty("Build", "1.0.12");
report.addImage(new File("screenshot.png"), "My screenshot");
report.addFile(new File("system.log"), "System log file");
report.startLevel("Messages will be hidden in this level");
report.log("Message 1 in toggle");
report.log("Message 2 in toggle");
report.log("Message 3 in toggle");
report.endLevel();
For more examples, please refer to the TestNG example project
When running from an IDE the reports are generated in /test-output/difido/current. When running directly from Maven the reports a generated in the target/difido/current folder
The HTML results can be send to the Difido server. This will allow you to view and manage the results from all the executions in your lab. To download and install instructions follow the server getting started page.
When the server is up and running, continue by configuring your project with the server host, port and other properties. The configuration file in the TestNG binder in located at the root of your project and it is called remoteDifido.properties. Open the file, locate the port and host properties and configure them according to the server address. If you can't find the remoteDifido.properties file, run one of your tests and the file will be created automatically.
For more information on the different properties in the file pleases refer to the client configuration section.
The Difido project is maintained by Top-Q and friends
- Overview
- Binders
- The Difido Server
- Developers
- Building the Server
- High Level Architecture
- Server API
- H2 Server
- Developing Plugins
- Elastic Mapping Definitions
- Contributing Code