Class ThucydidesAgent

java.lang.Object
net.thucydides.core.bootstrap.ThucydidesAgent

public final class ThucydidesAgent
extends java.lang.Object
A utility class that provides services to initialize web testing and reporting-related fields in arbitrary objects. Designed to replace the unfinished Thucydides class.
  • Constructor Summary

    Constructors 
    Constructor Description
    ThucydidesAgent​(java.util.Optional<java.lang.String> driver, StepListener... additionalListeners)
    Create a new Thucydides agent instance.
  • Method Summary

    Modifier and Type Method Description
    void enrich​(java.lang.Object testCase)
    Initialize a class for use with Thucydides.
    void testFinished()
    Tell Thucydides that a test is finished, and to generate the test reports for that test.
    void testStarted​(java.lang.String name)
    Tell Thucydides to start recording test outcomes and step events for a new test.
    void testSuiteFinished()  
    void testSuiteStarted​(java.lang.String name)
    Tells Thucydides that a new test suite (test case, specification,...) has started.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ThucydidesAgent

      public ThucydidesAgent​(java.util.Optional<java.lang.String> driver, StepListener... additionalListeners)
      Create a new Thucydides agent instance. There is always a BaseStepListener configured in the context, but you can also specify other listeners, such as for logging (Listeners.getLoggingListener()) and to enable statistics (Listeners.getStatisticsListener())
      Parameters:
      driver -
      additionalListeners -
  • Method Details

    • enrich

      public void enrich​(java.lang.Object testCase)
      Initialize a class for use with Thucydides. This involves instrumenting any @Step-annotated classes and setting up the Thucydides listeners.
      Parameters:
      testCase - a Java object containing test methods.
    • testSuiteStarted

      public void testSuiteStarted​(java.lang.String name)
      Tells Thucydides that a new test suite (test case, specification,...) has started.
      Parameters:
      name -
    • testStarted

      public void testStarted​(java.lang.String name)
      Tell Thucydides to start recording test outcomes and step events for a new test.
      Parameters:
      name - A human-readable name that will identify this test in the test reports.
    • testFinished

      public void testFinished()
      Tell Thucydides that a test is finished, and to generate the test reports for that test.
    • testSuiteFinished

      public void testSuiteFinished()