Java Code Examples for com.aventstack.extentreports.ExtentTest#assignAuthor()
The following examples show how to use
com.aventstack.extentreports.ExtentTest#assignAuthor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtentTestCommons.java From extentreports-testng-adapter with Apache License 2.0 | 6 votes |
public static void assignGroups(ExtentTest test, String[] groups) { if (groups.length > 0) { for (String g : groups) { if (g.startsWith("d:") || g.startsWith("device:")) { String d = g.replace("d:", "").replace("device:", ""); test.assignDevice(d); } else if (g.startsWith("a:") || g.startsWith("author:")) { String a = g.replace("a:", "").replace("author:", ""); test.assignAuthor(a); } else if (g.startsWith("t:") || g.startsWith("tag:")) { String t = g.replace("t:", "").replace("tag:", ""); test.assignCategory(t); } else { test.assignCategory(g); } } } }
Example 2
Source File: ReportEntityTest.java From extentreports-java with Apache License 2.0 | 5 votes |
@org.testng.annotations.Test public void authorCtx() { ExtentReports extent = extent(); ExtentTest test = extent.createTest("Test"); NamedAttributeContextManager<Author> context = extent.getReport().getAuthorCtx(); Assert.assertFalse(context.hasItems()); test.assignAuthor("x"); Assert.assertTrue(context.hasItems()); Assert.assertTrue(context.getSet().stream().anyMatch(x -> x.getAttr().getName().equals("x"))); Assert.assertTrue(context.getSet().stream().anyMatch(x -> x.getTestList().size() == 1)); Assert.assertTrue(context.getSet().stream() .flatMap(x -> x.getTestList().stream()) .anyMatch(x -> x.getName().equals("Test"))); }