Class AbstractReportParser

java.lang.Object
org.opentestfactory.report.interpreter.base.application.report.AbstractReportParser

public abstract class AbstractReportParser extends Object
Author:
akatz

Collection of methods allowing the parsing and retrieval of informations contained in a test report (currently an xml file).

  • Field Details

  • Constructor Details

    • AbstractReportParser

      public AbstractReportParser(String reportName, String passStatus, String failStatus)
    • AbstractReportParser

      public AbstractReportParser(String reportName, String passStatus, String failStatus, String skippedStatus)
    • AbstractReportParser

      public AbstractReportParser(String reportName, String passStatus, String failStatus, String skippedStatus, String notRunStatus)
  • Method Details

    • retrieveXmlStepStatuses

      public Map<Integer, org.opentestfactory.dto.v1.OTFTestStatus> retrieveXmlStepStatuses(String testDefinition, List<String> attachments)
      Retrieves the step statuses from the test report XML.
      Parameters:
      testDefinition - String representing the full name of the test
      attachments - The list of paths to the test generated reports.
      Returns:
      A map of step statuses.
    • supportStepStatusParsing

      protected abstract boolean supportStepStatusParsing()
    • retrieveExtendedStatus

      public ExtendedOTFTestStatus retrieveExtendedStatus(String testDefinition, List<String> attachments)
      Retrieves the status of a test xml report
      Parameters:
      testDefinition - String representing the full name of the test
      attachments - List of paths to the test generated reports
      Returns:
      A status as OTFTestStatus
    • extractExtendedStatus

      protected abstract ExtendedOTFTestStatus extractExtendedStatus(Document document, String testDefinition)
    • updateDuration

      protected Integer updateDuration(Integer currentDuration, Integer additionalDuration)
    • calculateDurationFromNodes

      protected Integer calculateDurationFromNodes(Document document, String targetedDurationQuery)
    • extractNodeDuration

      protected Integer extractNodeDuration(Node testCase)
    • extractFailureDetails

      protected List<String> extractFailureDetails(Document document, String targetQuery)
    • extractAttribute

      protected String extractAttribute(Node node, String name)
    • getTestStepStatusesByStepNumber

      protected abstract Map<Integer, org.opentestfactory.dto.v1.OTFTestStatus> getTestStepStatusesByStepNumber(Document document, String testDefinition)
    • extractValidatingReference

      protected abstract String extractValidatingReference(String testDefinition)
    • convertToInternalStatus

      public org.opentestfactory.dto.v1.OTFTestStatus convertToInternalStatus(String status)
    • convertToInternalStatusForTestStep

      public org.opentestfactory.dto.v1.OTFTestStatus convertToInternalStatusForTestStep(String status)
    • computeSafeXpathValueExpression

      protected String computeSafeXpathValueExpression(String value)
    • getReportName

      protected String getReportName()