com.aventstack.extentreports.TestListener Maven / Gradle / Ivy
package com.aventstack.extentreports;
import java.io.IOException;
import com.aventstack.extentreports.model.Author;
import com.aventstack.extentreports.model.Category;
import com.aventstack.extentreports.model.Device;
import com.aventstack.extentreports.model.Log;
import com.aventstack.extentreports.model.ScreenCapture;
import com.aventstack.extentreports.model.Test;
/**
* Listener methods invoked when an event occurs in the report:
*
*
* - A test or node is started
* - A category or author is added
* - A media object is added etc.
*
*/
public interface TestListener {
/**
* Invoked when a test is started using createTest()
*
* @param test {@link com.aventstack.extentreports.model.Test} object
*/
void onTestStarted(Test test);
/**
* Invoked when a test is removed using removeTest()
*
* @param test {@link com.aventstack.extentreports.model.Test} object
*/
void onTestRemoved(Test test);
/**
* Invoked when a node is started using createNode()
*
* @param node {@link com.aventstack.extentreports.model.Test} object
*/
void onNodeStarted(Test node);
/**
* Invoked each time a log is added to any test/node
*
* @param test {@link com.aventstack.extentreports.model.Test} object
* @param log {@link com.aventstack.extentreports.model.Log} object
*/
void onLogAdded(Test test, Log log);
/**
* Invoked each time a category is assigned to any test/node
*
* @param test {@link com.aventstack.extentreports.model.Test} object
* @param category {@link com.aventstack.extentreports.model.Category} object
*/
void onCategoryAssigned(Test test, Category category);
/**
* Invoked each time an author is assigned to any test/node
*
* @param test {@link com.aventstack.extentreports.model.Test} object
* @param author {@link com.aventstack.extentreports.model.Author} object
*/
void onAuthorAssigned(Test test, Author author);
/**
* Invoked each time a device is assigned to any test/node
*
* @param test {@link com.aventstack.extentreports.model.Test} object
* @param device {@link com.aventstack.extentreports.model.Device} object
*/
void onDeviceAssigned(Test test, Device device);
/**
* Invoked each time a screencapture is added to test
*
* @param test {@link com.aventstack.extentreports.model.Test} object
* @param screenCapture {@link com.aventstack.extentreports.model.ScreenCapture}
* object
* @throws IOException Exception thrown if the media object is not found
*/
void onScreenCaptureAdded(Test test, ScreenCapture screenCapture) throws IOException;
/**
* Invoked each time a screencapture is added to log
*
* @param log {@link com.aventstack.extentreports.model.Log} object
* @param screenCapture {@link com.aventstack.extentreports.model.ScreenCapture}
* object
* @throws IOException Exception thrown if the media object is not found
*/
void onScreenCaptureAdded(Log log, ScreenCapture screenCapture) throws IOException;
}