rcTestReport Class Reference

Test Report class for the ScriptEngine. More...

List of all members.

Public Member Functions

def __init__
 rcTestReport constructor.
def initReport
 Initializes the report class and provides a title for the report.
def addHTML
def addHeading
 Adds a heading to the report.
def addSection
 Adds a section to the report and returns the section id.
def findSection
 Given a caption, finds the section added to the report.
def insertSection
 Inserts a previously added section (with insert=0) to the specified position in the report.
def addSectionItem
 Adds a section item.
def addSectionImage
 Adds an image to a section.
def addSectionTable
 Adds a table to a section.
def addTableHeader
 Adds one column header to the table.
def beginTableRow
 Starts a table row.
def addTableData
 Adds a data column to the table row that was started by the last beginTableRow() call.
def findTag
 Find the child tag with the name tagName.
def xmlToString
 Convert XML to a string.
def transformToFile
 Based on the input template and output filename parameters creates an HTML report.
def getReports
 Retrieve the reports generated by this instance.
def getChildNodes
 Return the child nodes of an XML node.
def escape
 Escape the special HTML characters.


Detailed Description

Test Report class for the ScriptEngine.

This class provides a mechanism to create test reports in a well formed (XML) format using the provided report building methods and lets the user transform it to HTML format by providing an XSLT stylesheet template. A third-party tool called Pyana is used to do the transformation. A sample template (reportStyle.xsl.sample) is provided in the LICOS/start directory. For more information on XSLT see the following links:

XSL Transformations W3C Recommendation

XSLT Tutorial

Definition at line 35 of file rcTestReport.py.


Member Function Documentation

def __init__   self  ) 
 

rcTestReport constructor.

Definition at line 38 of file rcTestReport.py.

def addHeading   self,
  text
 

Adds a heading to the report.

Parameters:
text Heading text

Definition at line 82 of file rcTestReport.py.

def addHTML   self,
  htmlString,
  section = None,
  paragraph = 0
 

Adds an arbitrary HTML fragment to the end of the report or a section

\param htmlString HTML fragment.
\param section    Optional section id that this HTML will be written to.
              If no section is specified then HTML is added to the
              end of the report.
\param paragraph  \a htmlString should be added as a paragraph.

Definition at line 64 of file rcTestReport.py.

def addSection   self,
  caption,
  insert = 1
 

Adds a section to the report and returns the section id.

Parameters:
caption Section caption
insert 0 = Do not insert the section into the report 1 = Insert the section into the report (default)
Returns:
Section id.

Definition at line 97 of file rcTestReport.py.

def addSectionImage   self,
  sectionId,
  caption,
  url,
  width = '',
  height = ''
 

Adds an image to a section.

Images can have a caption, and an optional width and height. The url parameter specifies the location of the image.

Parameters:
sectionId Id of the section that this image will be inserted in.
caption Image caption
url Image source URL
width Optional width of the image
height Optional height of the image

Definition at line 161 of file rcTestReport.py.

def addSectionItem   self,
  sectionId,
  label,
  text,
  url = ''
 

Adds a section item.

Section items are entries with a label and text and an optional URL.

Parameters:
sectionId Id of the section that this item will be inserted in.
label Item label
text Item text
url Item URL

Definition at line 141 of file rcTestReport.py.

def addSectionTable   self,
  sectionId,
  border = '1',
  width = ''
 

Adds a table to a section.

Border and width are optional.

Parameters:
sectionId Id of the section that this image will be inserted in.
border Specifies whether the table will have a border or not. Default value is 1.
width Specifies the width of the border in percentage relative to the width of the page.
Returns:
Table id.

Definition at line 193 of file rcTestReport.py.

def addTableData   self,
  text,
  url = '',
  align = '',
  width = ''
 

Adds a data column to the table row that was started by the last beginTableRow() call.

Parameters:
text Text of the data column.
url Optional. If the text refers to a hyperlink provide the URL here.
align Optional text alignment.
width Optional column width in percentage.

Definition at line 245 of file rcTestReport.py.

def addTableHeader   self,
  tableId,
  text,
  align = ''
 

Adds one column header to the table.

Parameters:
tableId Id of the table where column headers are being added.
text Column header text.
align Optional text alignment.

Definition at line 215 of file rcTestReport.py.

def beginTableRow   self,
  tableId
 

Starts a table row.

Parameters:
tableId Id of the table where the row is being added.

Definition at line 235 of file rcTestReport.py.

def escape   self,
  text
 

Escape the special HTML characters.

Parameters:
text Text to be escaped

Definition at line 337 of file rcTestReport.py.

def findSection   self,
  caption
 

Given a caption, finds the section added to the report.

Parameters:
caption Section caption
Returns:
Id of the section with caption, or None if no such section found.

Definition at line 115 of file rcTestReport.py.

def findTag   self,
  node,
  tagName
 

Find the child tag with the name tagName.

Parameters:
tagName Tag name.
Returns:
Node for the tag found.

Definition at line 274 of file rcTestReport.py.

def getChildNodes   self,
  node
 

Return the child nodes of an XML node.

This method ignores the empty or line-feed nodes and returns the rest of the child nodes.

Parameters:
node Parent node
Returns:
A list of child nodes

Definition at line 317 of file rcTestReport.py.

def getReports   self  ) 
 

Retrieve the reports generated by this instance.

Returns:
A list of report file names (*.html)

Definition at line 310 of file rcTestReport.py.

def initReport   self,
  title
 

Initializes the report class and provides a title for the report.

Parameters:
title The title that will show in the window title of the HTML browser

Definition at line 44 of file rcTestReport.py.

def insertSection   self,
  sectionId,
  beforeSectionId = None
 

Inserts a previously added section (with insert=0) to the specified position in the report.

Parameters:
sectionId Id of the section to be inserted
beforeSectionId Id of the section that will come after the section specified by sectionId. If it is None then it is appended to the end. Defaults to None.

Definition at line 127 of file rcTestReport.py.

def transformToFile   self,
  xslFileName,
  htmlFileName
 

Based on the input template and output filename parameters creates an HTML report.

Parameters:
xslFileName Input XSLT template file name.
htmlFileName Output HTML filename.

Definition at line 298 of file rcTestReport.py.

def xmlToString   self  ) 
 

Convert XML to a string.

Returns:
String representation of the XML

Definition at line 288 of file rcTestReport.py.


The documentation for this class was generated from the following file:
Generated on Thu Apr 27 20:53:16 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO