java.lang.Object
io.qameta.allure.testng.AllureTestNg
- All Implemented Interfaces:
org.testng.IConfigurationListener,org.testng.IDataProviderListener,org.testng.IInvokedMethodListener,org.testng.IMethodInterceptor,org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
public class AllureTestNg
extends Object
implements org.testng.ISuiteListener, org.testng.ITestListener, org.testng.IInvokedMethodListener, org.testng.IConfigurationListener, org.testng.IMethodInterceptor, org.testng.IDataProviderListener
Reports TestNG execution to Allure.
Register this listener with TestNG to translate suites, test contexts, classes, configuration methods, data providers, and test methods into Allure scopes, fixtures, and test results. It also applies Allure test plan filtering when a plan is configured.
-
Constructor Summary
ConstructorsConstructorDescriptionAllureTestNg(io.qameta.allure.AllureLifecycle lifecycle) AllureTestNg(io.qameta.allure.AllureLifecycle lifecycle, AllureTestNgTestFilter testFilter) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext) voidafterInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) voidbeforeDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext) voidbeforeInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) protected voidcreateFakeResult(org.testng.ITestContext context, org.testng.ITestNGMethod method) io.qameta.allure.AllureLifecycleprotected io.qameta.allure.model.StatusList<org.testng.IMethodInstance> voidonConfigurationFailure(org.testng.ITestResult itr) Reports a failed configuration method as a run-level error rather than as a test result.voidonConfigurationSkip(org.testng.ITestResult itr) voidonConfigurationSuccess(org.testng.ITestResult itr) voidonDataProviderFailure(org.testng.ITestNGMethod method, org.testng.ITestContext ctx, RuntimeException t) voidonFinish(org.testng.ISuite suite) voidonFinish(org.testng.ITestContext context) voidonStart(org.testng.ISuite suite) voidonStart(org.testng.ITestContext context) voidonTestFailedButWithinSuccessPercentage(org.testng.ITestResult result) voidonTestFailure(org.testng.ITestResult result) voidonTestSkipped(org.testng.ITestResult result) voidonTestStart(org.testng.ITestResult testResult) voidonTestSuccess(org.testng.ITestResult testResult) protected booleanshouldSkipReportingFor(org.testng.ITestResult testResult) protected voidstartTest(org.testng.ITestContext context, org.testng.ITestNGMethod method, org.testng.IClass iClass, Object[] params, String parentUuid, String uuid) protected voidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.IConfigurationListener
beforeConfiguration, beforeConfiguration, onConfigurationFailure, onConfigurationSkip, onConfigurationSuccessMethods inherited from interface org.testng.IInvokedMethodListener
afterInvocation, beforeInvocationMethods inherited from interface org.testng.ITestListener
onTestFailedWithTimeoutMethods inherited from interface org.testng.ITestNGListener
isEnabled
-
Constructor Details
-
AllureTestNg
-
AllureTestNg
public AllureTestNg(io.qameta.allure.AllureLifecycle lifecycle) -
AllureTestNg
public AllureTestNg()
-
-
Method Details
-
getLifecycle
public io.qameta.allure.AllureLifecycle getLifecycle() -
intercept
public List<org.testng.IMethodInstance> intercept(List<org.testng.IMethodInstance> methods, org.testng.ITestContext context) - Specified by:
interceptin interfaceorg.testng.IMethodInterceptor
-
onStart
public void onStart(org.testng.ISuite suite) - Specified by:
onStartin interfaceorg.testng.ISuiteListener
-
onStart
public void onStart(org.testng.ITestContext context) - Specified by:
onStartin interfaceorg.testng.ITestListener
-
createFakeResult
protected void createFakeResult(org.testng.ITestContext context, org.testng.ITestNGMethod method) -
onFinish
public void onFinish(org.testng.ISuite suite) - Specified by:
onFinishin interfaceorg.testng.ISuiteListener
-
onFinish
public void onFinish(org.testng.ITestContext context) - Specified by:
onFinishin interfaceorg.testng.ITestListener
-
onTestStart
public void onTestStart(org.testng.ITestResult testResult) - Specified by:
onTestStartin interfaceorg.testng.ITestListener
-
shouldSkipReportingFor
protected boolean shouldSkipReportingFor(org.testng.ITestResult testResult) -
startTest
-
startTest
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult testResult) - Specified by:
onTestSuccessin interfaceorg.testng.ITestListener
-
onTestFailure
public void onTestFailure(org.testng.ITestResult result) - Specified by:
onTestFailurein interfaceorg.testng.ITestListener
-
stopTest
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult result) - Specified by:
onTestSkippedin interfaceorg.testng.ITestListener
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result) - Specified by:
onTestFailedButWithinSuccessPercentagein interfaceorg.testng.ITestListener
-
beforeInvocation
public void beforeInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) - Specified by:
beforeInvocationin interfaceorg.testng.IInvokedMethodListener
-
afterInvocation
public void afterInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) - Specified by:
afterInvocationin interfaceorg.testng.IInvokedMethodListener
-
onConfigurationSuccess
public void onConfigurationSuccess(org.testng.ITestResult itr) - Specified by:
onConfigurationSuccessin interfaceorg.testng.IConfigurationListener
-
onConfigurationFailure
public void onConfigurationFailure(org.testng.ITestResult itr) Reports a failed configuration method as a run-level error rather than as a test result.The configuration method is not a test case: a test result standing in for it is counted in the run statistics and, having a history id no execution ever produces, survives every retry. The tests the failure prevented are reported by TestNG itself through
onTestSkipped(ITestResult), with their real parameters, so they keep their own identity and a later green run replaces them.- Specified by:
onConfigurationFailurein interfaceorg.testng.IConfigurationListener
-
onConfigurationSkip
public void onConfigurationSkip(org.testng.ITestResult itr) - Specified by:
onConfigurationSkipin interfaceorg.testng.IConfigurationListener
-
beforeDataProviderExecution
public void beforeDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext) - Specified by:
beforeDataProviderExecutionin interfaceorg.testng.IDataProviderListener
-
afterDataProviderExecution
public void afterDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext) - Specified by:
afterDataProviderExecutionin interfaceorg.testng.IDataProviderListener
-
onDataProviderFailure
public void onDataProviderFailure(org.testng.ITestNGMethod method, org.testng.ITestContext ctx, RuntimeException t) - Specified by:
onDataProviderFailurein interfaceorg.testng.IDataProviderListener
-
getStatus
-