Class Reporter


  • public final class Reporter
    extends java.lang.Object
    Steps reporter.
    • Constructor Summary

      Constructors 
      Constructor Description
      Reporter​(ReportingDriver driver, AgentClient agentClient)
      Initializes a new instance using provided driver and agentClient.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disableCommandReports​(boolean disable)
      Enables or disables driver commands reporting.
      void disableRedaction​(boolean disable)
      Enables or disables redaction for driver command reports with values of secured elements.
      void disableReports​(boolean disable)
      Enables or disables all types of reports.
      void disableTestAutoReports​(boolean disable)
      Enables or disables automatic test reporting.
      void step​(java.lang.String description)
      Report step with description.
      void step​(java.lang.String description, boolean passed)
      Report step with description and pass/fail flag.
      void step​(java.lang.String description, boolean passed, boolean screenshot)
      Report step with description, message and screenshot.
      void step​(java.lang.String description, java.lang.String message)
      Report step with description and message.
      void step​(java.lang.String description, java.lang.String message, boolean screenshot)
      Report step with description, message and screenshot.
      void step​(java.lang.String description, java.lang.String message, boolean passed, boolean screenshot)
      Report step with description, message, screenshot and pass/fail indication.
      ClosableTestReport test​(java.lang.String name)
      Creates a new report using provided name.
      ClosableTestReport test​(java.lang.String name, boolean passed)
      Creates a new report with provided name and result.
      ClosableTestReport test​(java.lang.String name, boolean passed, java.lang.String message)
      Creates a new report with provided name, result and message.
      • Methods inherited from class java.lang.Object

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

      • Reporter

        public Reporter​(ReportingDriver driver,
                        AgentClient agentClient)
        Initializes a new instance using provided driver and agentClient.
        Parameters:
        driver - Driver instance to be used for taking screenshots.
        agentClient - AgentClient instance to submit reports to the Agent.
    • Method Detail

      • disableReports

        public void disableReports​(boolean disable)
        Enables or disables all types of reports.
        Parameters:
        disable - True to disable or False to enable.
      • disableCommandReports

        public void disableCommandReports​(boolean disable)
        Enables or disables driver commands reporting.
        Parameters:
        disable - True to disable or False to enable.
      • disableTestAutoReports

        public void disableTestAutoReports​(boolean disable)
        Enables or disables automatic test reporting. Test name is inferred by traversing the stack trace and searching for automation framework annotations.

        For example if JUnit @Test or @DisplayName annotation (if found). If no supported annotations are found, it uses the very first method in the call stack..

        Disabling this mechanism will require manual calls to report tests using test(String) ()} This feature must by disabled in order to use the manual reporting.

        Parameters:
        disable - True to disable or False to enable.
      • disableRedaction

        public void disableRedaction​(boolean disable)
        Enables or disables redaction for driver command reports with values of secured elements. When enabled it will redact the characters sent using driver.sendKeys() with three stars: ***

        Redaction will occur only when the characters are sent to a secured element.

        Secured elements are: Any element with type attribute set to password iOS element XCUIElementTypeSecureTextField

        Parameters:
        disable - True to disable or False to enable.
      • step

        public void step​(java.lang.String description)
        Report step with description.
        Parameters:
        description - Step description.
      • step

        public void step​(java.lang.String description,
                         boolean passed)
        Report step with description and pass/fail flag.
        Parameters:
        description - Step description.
        passed - True to mark steps as Passed, otherwise False.
      • step

        public void step​(java.lang.String description,
                         boolean passed,
                         boolean screenshot)
        Report step with description, message and screenshot.
        Parameters:
        description - Step description.
        passed - True to mark step as Passed, otherwise False.
        screenshot - True to take a screenshot, otherwise False.
      • step

        public void step​(java.lang.String description,
                         java.lang.String message)
        Report step with description and message.
        Parameters:
        description - Step description.
        message - Step message.
      • step

        public void step​(java.lang.String description,
                         java.lang.String message,
                         boolean screenshot)
        Report step with description, message and screenshot.
        Parameters:
        description - Step description.
        message - Step message.
        screenshot - True to take a screenshot, otherwise False.
      • step

        public void step​(java.lang.String description,
                         java.lang.String message,
                         boolean passed,
                         boolean screenshot)
        Report step with description, message, screenshot and pass/fail indication.
        Parameters:
        description - Step description.
        message - Step message.
        passed - True to mark step as Passed, otherwise False.
        screenshot - True to take a screenshot, otherwise False.
      • test

        public ClosableTestReport test​(java.lang.String name)
        Creates a new report using provided name. Note: Result is set to false (failed) by default! To specify result type use test(String, boolean) overloaded method.
        Parameters:
        name - Test name.
        Returns:
        ClosableTestReport instance
      • test

        public ClosableTestReport test​(java.lang.String name,
                                       boolean passed)
        Creates a new report with provided name and result.
        Parameters:
        name - Test name.
        passed - True is passed, otherwise False.
        Returns:
        ClosableTestReport instance
      • test

        public ClosableTestReport test​(java.lang.String name,
                                       boolean passed,
                                       java.lang.String message)
        Creates a new report with provided name, result and message.
        Parameters:
        name - Test name.
        passed - True is passed, otherwise False.
        message - Result message.
        Returns:
        ClosableTestReport instance