Class AllureTestNg

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 containers, fixtures, and test results. It also applies Allure test plan filtering when a plan is configured.

  • Constructor Details

    • AllureTestNg

      public AllureTestNg(io.qameta.allure.AllureLifecycle lifecycle, AllureTestNgTestFilter testFilter)
    • 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:
      intercept in interface org.testng.IMethodInterceptor
    • onStart

      public void onStart(org.testng.ISuite suite)
      Specified by:
      onStart in interface org.testng.ISuiteListener
    • onStart

      public void onStart(org.testng.ITestContext context)
      Specified by:
      onStart in interface org.testng.ITestListener
    • createFakeResult

      protected void createFakeResult(org.testng.ITestContext context, org.testng.ITestNGMethod method)
    • onFinish

      public void onFinish(org.testng.ISuite suite)
      Specified by:
      onFinish in interface org.testng.ISuiteListener
    • onFinish

      public void onFinish(org.testng.ITestContext context)
      Specified by:
      onFinish in interface org.testng.ITestListener
    • onBeforeClass

      public void onBeforeClass(org.testng.ITestClass testClass)
    • onAfterClass

      public void onAfterClass(org.testng.ITestClass testClass)
    • onTestStart

      public void onTestStart(org.testng.ITestResult testResult)
      Specified by:
      onTestStart in interface org.testng.ITestListener
    • shouldSkipReportingFor

      protected boolean shouldSkipReportingFor(org.testng.ITestResult testResult)
    • startTestCase

      protected void startTestCase(org.testng.ITestResult testResult, String parentUuid, String uuid)
    • startTestCase

      protected void startTestCase(org.testng.ITestContext context, org.testng.ITestNGMethod method, org.testng.IClass iClass, Object[] params, String parentUuid, String uuid)
    • onTestSuccess

      public void onTestSuccess(org.testng.ITestResult testResult)
      Specified by:
      onTestSuccess in interface org.testng.ITestListener
    • onTestFailure

      public void onTestFailure(org.testng.ITestResult result)
      Specified by:
      onTestFailure in interface org.testng.ITestListener
    • stopTestCase

      protected void stopTestCase(String uuid, Throwable throwable, io.qameta.allure.model.Status status)
    • onTestSkipped

      public void onTestSkipped(org.testng.ITestResult result)
      Specified by:
      onTestSkipped in interface org.testng.ITestListener
    • onTestFailedButWithinSuccessPercentage

      public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result)
      Specified by:
      onTestFailedButWithinSuccessPercentage in interface org.testng.ITestListener
    • beforeInvocation

      public void beforeInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult)
      Specified by:
      beforeInvocation in interface org.testng.IInvokedMethodListener
    • afterInvocation

      public void afterInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult)
      Specified by:
      afterInvocation in interface org.testng.IInvokedMethodListener
    • onConfigurationSuccess

      public void onConfigurationSuccess(org.testng.ITestResult itr)
      Specified by:
      onConfigurationSuccess in interface org.testng.IConfigurationListener
    • onConfigurationFailure

      public void onConfigurationFailure(org.testng.ITestResult itr)
      Specified by:
      onConfigurationFailure in interface org.testng.IConfigurationListener
    • onConfigurationSkip

      public void onConfigurationSkip(org.testng.ITestResult itr)
      Specified by:
      onConfigurationSkip in interface org.testng.IConfigurationListener
    • beforeDataProviderExecution

      public void beforeDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext)
      Specified by:
      beforeDataProviderExecution in interface org.testng.IDataProviderListener
    • afterDataProviderExecution

      public void afterDataProviderExecution(org.testng.IDataProviderMethod dataProviderMethod, org.testng.ITestNGMethod method, org.testng.ITestContext iTestContext)
      Specified by:
      afterDataProviderExecution in interface org.testng.IDataProviderListener
    • onDataProviderFailure

      public void onDataProviderFailure(org.testng.ITestNGMethod method, org.testng.ITestContext ctx, RuntimeException t)
      Specified by:
      onDataProviderFailure in interface org.testng.IDataProviderListener
    • getHistoryId

      protected String getHistoryId(org.testng.ITestNGMethod method, List<io.qameta.allure.model.Parameter> parameters)
    • getStatus

      protected io.qameta.allure.model.Status getStatus(Throwable throwable)