public class ExtentTest extends Object
Defines a node in the report file.
By default, each started node is top-level. If appendChild method
is used on any test, it automatically becomes a child-node. When this happens:
hasChildNodes = trueisChildNode = true| Constructor and Description |
|---|
ExtentTest(String testName,
String description)
Creates a test node as a top-most level test
|
| Modifier and Type | Method and Description |
|---|---|
String |
addScreenCapture(String imgPath)
Adds a snapshot to the log event details
|
String |
addScreencast(String screencastPath)
Adds a screen cast to the log event details
|
ExtentTest |
appendChild(ExtentTest node)
Appends a child test (another
ExtentTest) to the current test |
ExtentTest |
assignAuthor(String... authors)
Assigns author(s) to test
|
ExtentTest |
assignCategory(String... categories)
Assigns category to test
|
LogStatus |
getRunStatus()
Provides the current run status of the test
|
Test |
getTest()
Returns the underlying test which controls the internal model
|
void |
log(LogStatus logStatus,
String details)
Logs events for the test
|
void |
log(LogStatus logStatus,
String stepName,
String details)
Logs events for the test
|
void |
log(LogStatus logStatus,
String stepName,
Throwable t)
Logs events for the test
|
void |
log(LogStatus logStatus,
Throwable t)
Logs events for the test
|
public void log(LogStatus logStatus, String stepName, String details)
Logs events for the test
Log event is shown in the report with 4 columns:
logStatus - Status (see LogStatus)stepName - Name of the stepdetails - Details of the steppublic void log(LogStatus logStatus, String stepName, Throwable t)
Logs events for the test
Log event is shown in the report with 4 columns:
logStatus - Status (see LogStatus)stepName - Name of the stept - Exceptionpublic void log(LogStatus logStatus, Throwable t)
Logs events for the test
Log event is shown in the report with 3 columns:
logStatus - Status (see LogStatus)t - Exceptionpublic void log(LogStatus logStatus, String details)
Logs events for the test
Log event is shown in the report with 3 columns:
logStatus - Status (see LogStatus)details - Details of the steppublic String addScreenCapture(String imgPath)
Adds a snapshot to the log event details
Note: this method does not attach the screen-cast to the report, it only links to the path
imgPath - Path of the imagepublic String addScreencast(String screencastPath)
Adds a screen cast to the log event details
Note: this method does not attach the screen-cast to the report, it only links to the path
screencastPath - Path of the screencastpublic ExtentTest assignCategory(String... categories)
Assigns category to test
Usage: test.assignCategory("ExtentAPI");
Usage: test.assignCategory("ExtentAPI", "Regression", ...);
categories - Category nameExtentTest objectpublic ExtentTest assignAuthor(String... authors)
Assigns author(s) to test
Usage: test.assignAuthor("AuthorName");
Usage: test.assignAuthor("Author1", "Author2", ...);
authors - Author nameExtentTestpublic ExtentTest appendChild(ExtentTest node)
Appends a child test (another ExtentTest) to the current test
node - An ExtentTest object. Test that is added as the node.ExtentTest object. Parent test which adds the node as its child.public LogStatus getRunStatus()
Provides the current run status of the test
LogStatusCopyright © 2015. All rights reserved.