Java Code Examples for com.aventstack.extentreports.ExtentTest#pass()
The following examples show how to use
com.aventstack.extentreports.ExtentTest#pass() .
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: MyExtentTestNgFormatter.java From Java-API-Test-Examples with Apache License 2.0 | 6 votes |
public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { if (iInvokedMethod.isTestMethod()) { ExtentTest test = (ExtentTest) iTestResult.getAttribute("test"); List<String> logs = Reporter.getOutput(iTestResult); for (String log : logs) { test.info(log); } int status = iTestResult.getStatus(); if (ITestResult.SUCCESS == status) { test.pass("Passed"); } else if (ITestResult.FAILURE == status) { test.fail(iTestResult.getThrowable()); } else { test.skip("Skipped"); } for (String group : iInvokedMethod.getTestMethod().getGroups()) { test.assignCategory(group); } } }
Example 2
Source File: MyExtentTestNgFormatter.java From Java-API-Test-Examples with Apache License 2.0 | 6 votes |
public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { if (iInvokedMethod.isTestMethod()) { ExtentTest test = (ExtentTest) iTestResult.getAttribute("test"); List<String> logs = Reporter.getOutput(iTestResult); for (String log : logs) { test.info(log); } int status = iTestResult.getStatus(); if (ITestResult.SUCCESS == status) { test.pass("Passed"); } else if (ITestResult.FAILURE == status) { test.fail(iTestResult.getThrowable()); } else { test.skip("Skipped"); } for (String group : iInvokedMethod.getTestMethod().getGroups()) { test.assignCategory(group); } } }
Example 3
Source File: MyExtentTestNgFormatter.java From TestHub with MIT License | 6 votes |
public void afterInvocation(IInvokedMethod iInvokedMethod, ITestResult iTestResult) { if (iInvokedMethod.isTestMethod()) { ExtentTest test = (ExtentTest) iTestResult.getAttribute("test"); List<String> logs = Reporter.getOutput(iTestResult); for (String log : logs) { test.info(log); } int status = iTestResult.getStatus(); if (ITestResult.SUCCESS == status) { test.pass("Passed"); } else if (ITestResult.FAILURE == status) { test.fail(iTestResult.getThrowable()); } else { test.skip("Skipped"); } for (String group : iInvokedMethod.getTestMethod().getGroups()) { test.assignCategory(group); } } }
Example 4
Source File: MyExtentTestNgFormatter.java From Java-API-Test-Examples with Apache License 2.0 | 5 votes |
public void onFinish(ITestContext iTestContext) { ExtentTest testContext = (ExtentTest) iTestContext.getAttribute("testContext"); if (iTestContext.getFailedTests().size() > 0) { testContext.fail("Failed"); } else if (iTestContext.getSkippedTests().size() > 0) { testContext.skip("Skipped"); } else { testContext.pass("Passed"); } }
Example 5
Source File: MyExtentTestNgFormatter.java From Java-API-Test-Examples with Apache License 2.0 | 5 votes |
public void onFinish(ITestContext iTestContext) { ExtentTest testContext = (ExtentTest) iTestContext.getAttribute("testContext"); if (iTestContext.getFailedTests().size() > 0) { testContext.fail("Failed"); } else if (iTestContext.getSkippedTests().size() > 0) { testContext.skip("Skipped"); } else { testContext.pass("Passed"); } }
Example 6
Source File: MyExtentTestNgFormatter.java From TestHub with MIT License | 5 votes |
public void onFinish(ITestContext iTestContext) { ExtentTest testContext = (ExtentTest) iTestContext.getAttribute("testContext"); if (iTestContext.getFailedTests().size() > 0) { testContext.fail("Failed"); } else if (iTestContext.getSkippedTests().size() > 0) { testContext.skip("Skipped"); } else { testContext.pass("Passed"); } }
Example 7
Source File: ExtentReportsBuilder.java From courgette-jvm with MIT License | 5 votes |
private void setStepResult(ExtentTest extentTest, Step step, boolean isStrict) { if (step.skipped()) { extentTest.skip(""); } else if (step.passed(isStrict)) { extentTest.pass(""); } else { extentTest.fail(""); } }