Interface TestCaseState


@API(status=STABLE) public interface TestCaseState
  • Method Details

    • getSourceTagNames

      Collection<String> getSourceTagNames()
      Return tags of this scenario.
      Returns:
      tags of this scenario.
    • getStatus

      Status getStatus()
      Returns the current status of this test case.

      The test case status is calculated as the most severe status of the executed steps in the testcase so far.

      Returns:
      the current status of this test case
    • isFailed

      boolean isFailed()
      Returns true when the scenario has failed.

      This is implemented as this.getStatus() == Status.FAILED.

      Returns:
      true if the scenario has failed.
    • attach

      void attach(byte[] data, String mediaType, @Nullable String name)
      Attach data to the report(s).
       
       // Attach a screenshot. See your UI automation tool's docs for
       // details about how to take a screenshot.
       scenario.attach(pngBytes, "image/png", "Bartholomew and the Bytes of the Oobleck");
       
       

      To ensure reporting tools can understand what the data is a mediaType must be provided. For example: text/plain, image/png, text/html;charset=utf-8.

      Media types are defined in RFC 7231 Section 3.1.1.1.

      Parameters:
      data - what to attach, for example an image.
      mediaType - what is the data?
      name - attachment name
    • attach

      void attach(String data, String mediaType, @Nullable String name)
      Attach data to the report(s).
      Parameters:
      data - what to attach, for example html.
      mediaType - what is the data?
      name - attachment name
      See Also:
    • log

      void log(String text)
      Outputs some text into the report.
      Parameters:
      text - what to put in the report.
      See Also:
    • getName

      String getName()
      Returns the name of the Scenario
      Returns:
      the name of the Scenario
    • getId

      String getId()
      Returns the id of the Scenario.
      Returns:
      the id of the Scenario.
    • getUri

      URI getUri()
      Returns the uri of the Scenario.
      Returns:
      the uri of the Scenario.
    • getLanguage

      String getLanguage()
      Returns the language of the Scenario.
      Returns:
      the language of the Scenario.
    • getLine

      Integer getLine()
      Returns the line in the feature file of the Scenario.

      If this is a Scenario from Scenario Outlines this will return the line of the example row in the Scenario Outline.

      Returns:
      the line in the feature file of the Scenario.
    • geCurrentPickleStep

      default Optional<Step> geCurrentPickleStep()