public interface ReportProvider extends Plugin
Interface of report providers. A report provider is an
object which typically registers to script (ScriptListener
and command CommandEvent
events and generates a report on the script execution. Report providers
are instantiated through ReportProviderFactory
, usually by a call
of the Report command.
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Method and Description |
---|---|
int |
create(ScriptingContext context,
Map params)
Create a report using the scripting context.
|
String |
getCode()
Get report provider code.
|
String[] |
getSupportedFormats()
Get formats supported by this particular provider.
|
checkDependencies, getDate, getDescription, getDisplayName, getImplementedInterface, getLowestSupportedVersion, getMessageAfterInstall, getMessageBeforeInstall, getSupportContact, getUniqueId, getVendorHomePage, getVendorName, getVersion, requiresRestart
String getCode()
String[] getSupportedFormats()
Get formats supported by this particular provider. The formats are not
case sensitive and they must correspond to the supported file extensions.
For example, a provider able to generate XML, HTML and Excel formats should
return new String[] {"xml", "html", "htm", "xls"}
.
The method is used by the calling Report instance to validate file name provided by the script command. If the file doesn't have one of the extensions supported by the selected provider, a syntax error is reported.
int create(ScriptingContext context, Map params)
Create a report using the scripting context. This method is called just once right after an instance of this provider is created through the Report command or it's associated Java test script method. It is up to the implementing class whether it prefers to generate one-time report and finish or register as ScriptListener and/or CommandListener and stay alive refreshing the report with updates until the script execution finishes.
The context provides access to all necessary objects associated with the
script and execution. Objects created by commands such as screen shots,
step results etc. may be obtained from ScriptingContext.getOutputObjects()
.
context
- scripting context of the currently executed script.params
- Report command parameters parsed from the command. They typically
contain at least the output file name together with an optional description and scope.
See the Report command specification for more information.