|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.unitedinternet.portal.selenium.utils.logging.HtmlResultFormatter
public class HtmlResultFormatter
Formats all logging events as HTML. Trying to bring the Selenium TestRunner result look-and-feel to Junit. Default formatter for logging. Be sure to pass an encoding-aware writer together with encoding name to the 2 parameters constuctor.
Constructor Summary | |
---|---|
HtmlResultFormatter(java.io.Writer myResultsWriter)
Write results to the specified writer. |
|
HtmlResultFormatter(java.io.Writer myResultsWriter,
java.lang.String myResultFileEncoding)
Write results with an arbitrary encoding. |
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. |
static java.lang.String |
generateEmptyColumns(int numColsToGenerate)
Generate empty HTML columns. |
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. |
static java.text.SimpleDateFormat |
getFILENAME_DATETIME_FORMAT()
|
java.lang.String |
getScreenShotBaseUri()
Base URI to be linked to in the result. |
void |
headerLogEvent(TestMetricsBean metrics)
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. |
static java.lang.String |
quoteHtml(java.lang.String unquoted)
|
void |
setAutomaticScreenshotPath(java.lang.String automaticScreenshotPath)
Automatic screenshots are taken if a Wait-timeout is detected. |
static void |
setFILENAME_DATETIME_FORMAT(java.text.SimpleDateFormat newFormat)
|
void |
setScreenShotBaseUri(java.lang.String screenShotBaseUri)
Set a special uri for screenshots. |
static java.lang.String |
timeStampForFileName()
Generates a Date-Time String based on the current Time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlResultFormatter(java.io.Writer myResultsWriter)
myResultsWriter
- where results will be written in "ISO-8859-1" encodingpublic HtmlResultFormatter(java.io.Writer myResultsWriter, java.lang.String myResultFileEncoding)
new BufferedWriter(new OutputStreamWriter(new FileOutputStream("myResultFile.html"),
"UTF-8")
myResultsWriter
- writer with resultFileEncoding set. See also Example abovemyResultFileEncoding
- any encoding supported by the running jvmMethod Detail |
---|
public void commentLogEvent(LoggingBean loggingBean)
commentLogEvent
in interface LoggingResultsFormatter
loggingBean
- loggingBean containing the comment to be logged.public void headerLogEvent(TestMetricsBean metrics)
headerLogEvent
in interface LoggingResultsFormatter
metrics
- metrics gathered during test-runpublic void footerLogEvent()
footerLogEvent
in interface LoggingResultsFormatter
public void commandLogEvent(LoggingBean loggingBean)
commandLogEvent
in interface LoggingResultsFormatter
loggingBean
- containing all informations for logging a selenium commandpublic void booleanCommandLogEvent(LoggingBean loggingBean)
booleanCommandLogEvent
in interface LoggingResultsFormatter
loggingBean
- containing all informations for logging a selenium commandpublic java.lang.String getScreenShotBaseUri()
getScreenShotBaseUri
in interface LoggingResultsFormatter
public void setScreenShotBaseUri(java.lang.String screenShotBaseUri)
setScreenShotBaseUri
in interface LoggingResultsFormatter
screenShotBaseUri
- the new uri for screenshotspublic java.lang.String generateFilenameForAutomaticScreenshot(java.lang.String baseName)
generateFilenameForAutomaticScreenshot
in interface LoggingResultsFormatter
baseName
- middle part of the name to be enhanced by whatever the implementation wants to
public java.lang.String getAutomaticScreenshotPath()
getAutomaticScreenshotPath
in interface LoggingResultsFormatter
public void setAutomaticScreenshotPath(java.lang.String automaticScreenshotPath)
setAutomaticScreenshotPath
in interface LoggingResultsFormatter
automaticScreenshotPath
- location (only path) to where screenshots should be savedpublic static final java.lang.String generateEmptyColumns(int numColsToGenerate)
numColsToGenerate
- num of columns to be generated
public static final java.lang.String timeStampForFileName()
public void methodLogEvent(LoggingBean loggingBean)
methodLogEvent
in interface LoggingResultsFormatter
loggingBean
- containing all informations for logging a test method and its commandspublic static final java.lang.String quoteHtml(java.lang.String unquoted)
public static java.text.SimpleDateFormat getFILENAME_DATETIME_FORMAT()
public static void setFILENAME_DATETIME_FORMAT(java.text.SimpleDateFormat newFormat)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |