com.unitedinternet.portal.selenium.utils.logging
Interface LoggingResultsFormatter

All Known Implementing Classes:
HtmlResultFormatter, XmlResultFormatter

public interface LoggingResultsFormatter

The LoggingResultFormatter can be used to log in any format you want to. The formatter is responsible for writing results. Also the formatter is resposible for handling encodings right for whatever output storage is used. Currently there is an HtmlResultFormatter implemented. There could also be an CSVFormatter, DatabaseFormatter or whatever you want the log to look like.

Author:
Robert Zimmermann $Id: LoggingResultsFormatter.java 116 2008-05-02 13:43:44Z Steffen_K $

Method Summary
 void booleanCommandLogEvent(LoggingBean loggingBean)
          Formats an selenium command which has an boolean result.
 void commandLogEvent(LoggingBean loggingBean)
          Formats an selenium command.
 void commentLogEvent(LoggingBean loggingBean)
          Format a comment.
 void footerLogEvent()
          Like formatHeader() but here after all commands have been formatted.
 java.lang.String generateFilenameForAutomaticScreenshot(java.lang.String baseName)
          Generate an absolute filename for taking screenshots in case of an error (eg. timed out wait).
 java.lang.String getAutomaticScreenshotPath()
          Path to the (filesystem-)location where screenshot should be saved.
 java.lang.String getScreenShotBaseUri()
          Base URI to be linked to in the result.
 void headerLogEvent(TestMetricsBean metricsBean)
          Whatever the formatter wants to do before any command will be formatted.
 void methodLogEvent(LoggingBean loggingBean)
          Formats a Log Event for a complete Test Method.
 void setAutomaticScreenshotPath(java.lang.String automaticScreenshotPath)
          Path to the (filesystem-)location where screenshot should be saved.
 void setScreenShotBaseUri(java.lang.String screenShotBaseUri)
          Set a special uri for screenshots.
 

Method Detail

commentLogEvent

void commentLogEvent(LoggingBean loggingBean)
Format a comment. Comments may be issued between commands by the loggingCommandProcessor, like a new method has been entered by the test.

Parameters:
loggingBean - loggingBean containing the comment to be logged.

commandLogEvent

void commandLogEvent(LoggingBean loggingBean)
Formats an selenium command.

Parameters:
loggingBean - containing all informations for logging a selenium command

booleanCommandLogEvent

void booleanCommandLogEvent(LoggingBean loggingBean)
Formats an selenium command which has an boolean result. Important: At this state no information whether an false or true result was or is expected by the test using this formatter. So an false result may be "green" for the test. Therefore all log-events here are logged as green. e.g. selenium commands like isElementPresent

Parameters:
loggingBean - containing all informations for logging a selenium command

methodLogEvent

void methodLogEvent(LoggingBean loggingBean)
Formats a Log Event for a complete Test Method. The Logging Bean may contain several child beans holding the information of the single selenium commands.

Parameters:
loggingBean - containing all informations for logging a test method and its commands

headerLogEvent

void headerLogEvent(TestMetricsBean metricsBean)
Whatever the formatter wants to do before any command will be formatted.

Parameters:
metricsBean - metrics gathered during test-run

footerLogEvent

void footerLogEvent()
Like formatHeader() but here after all commands have been formatted.


getScreenShotBaseUri

java.lang.String getScreenShotBaseUri()
Base URI to be linked to in the result. Screenshots may be linked with an http or similar prefix to be easier accessible in whatever reporting frontend is used later

Returns:
the current base-uri for screenshots

setScreenShotBaseUri

void setScreenShotBaseUri(java.lang.String screenShotBaseUri)
Set a special uri for screenshots.

Parameters:
screenShotBaseUri - the new uri for screenshots

generateFilenameForAutomaticScreenshot

java.lang.String generateFilenameForAutomaticScreenshot(java.lang.String baseName)
Generate an absolute filename for taking screenshots in case of an error (eg. timed out wait).

Parameters:
baseName - middle part of the name to be enhanced by whatever the implementation wants to
Returns:
absolute path for screenshot to be taken

getAutomaticScreenshotPath

java.lang.String getAutomaticScreenshotPath()
Path to the (filesystem-)location where screenshot should be saved. Will be used by generateFilenameForAutomaticScreenshot()

Returns:
current location path

setAutomaticScreenshotPath

void setAutomaticScreenshotPath(java.lang.String automaticScreenshotPath)
Path to the (filesystem-)location where screenshot should be saved. Will be used by generateFilenameForAutomaticScreenshot()

Parameters:
automaticScreenshotPath - location (only path) to where screenshots should be saved


Copyright © 2009. All Rights Reserved.