Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created June 14, 2024 14:32
Show Gist options
  • Save SarahElson/d2026b71440f3522c597ad81ec67fb84 to your computer and use it in GitHub Desktop.
Save SarahElson/d2026b71440f3522c597ad81ec67fb84 to your computer and use it in GitHub Desktop.
How To Generate Extent Reports In Selenium
package LocalGrid;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.Test;
public class TestExtentReportBasic extends BaseTest{
@Test
public void testPassed() {
extentTest = extentReports.createTest("Test Case 1", "This test case has passed");
Assert.assertTrue(true);
}
@Test
public void testFailed() {
extentTest = extentReports.createTest("Test Case 2", "This test case has failed");
Assert.assertTrue(false);
}
@Test
public void testSkipped() {
extentTest = extentReports.createTest("Test Case 3", "This test case has been skipped");
throw new SkipException("The test has been skipped");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment