Type Definitions
- 
    
AttributeMap
 - 
    
    
Maps attribute name to value (empty string if the attribute is not set).
Type:
- Object
 
 - 
    
Dialog
 - 
    
    
Represents a pop-up dialog of type
alert,prompt,confirm, orbeforeunloadType:
- Object
 
Properties:
Name Type Description aOrAnstring Appropriate for describing the type of dialog, e.g. 'an alert' or 'a prompt'
typestring One of ['alert', 'prompt', 'confirm', 'beforeunload']
messagestring The message that appeared in the dialog.
 - 
    
DialogCallback(dialog, api)
 - 
    
    
Use this to perform additional validation of the dialog, or pass the test case and skip any further dialog handling.
Parameters:
Name Type Description dialogDialog The dialog object that just popped up.
apiTestCaseAPI  - 
    
DOMNode
 - 
    
    
    
Properties:
Name Type Description tagstring tag name of the node, e.g.
htmlorh3namestring nameattribute of the node, e.g."frog"in<p name="frog">, or undefined.attributesMap.<string, string> A map of attribute name to value.
valuestring The value from the node, if this is meaningful, the empty string if not.
 - 
    
FailedRequest
 - 
    
    
Contains information relating to an HTTP request that failed within the user page. This might be due to a bad
srcattribute on animgtag, or an incorrectly used relative URL. Note that requests for resources inside the student's workspace (eg. a local.jsfile) will appear as a relative url.Type:
- Object
 
Properties:
Name Type Description urlstring statusnumber HTTP status code
statusTextstring Short description of the failure.
 - 
    
FailureReportOptions
 - 
    
    
This object allows you to specify or override various parts of the failure report, when an
expect*API hook results in test failure. All strings are formatted HTML. The failure report shows the details in the following order: [message] [details] [actions] [hint]. You can override parts of the failure report (except the message) to fine-tune what information is shown to the student.
For example:
[message] The text in the top text display element is incorrect. The text was
when it was meant to be:Yellow Sunflowers
[details]Yellow Submarine
[actions != []] We performed these actions before checking:- Entered
 "Hello World"into the top text entry element- Entered
 [hint] Did you remember to add an event listener to the top text entry element?"Some more text"into the top text entry elementType:
- Object
 
Properties:
Name Type Argument Description detailsstring | BaseString More details, if useful. This comes after the message and before the report for 'actions performed so far'. Defaults to an empty string.
actionsArray.<(string|BaseString)> <optional> 
A list of strings to report as the actions performed so far. By default we use the actions recorded during the test. Set to an empty list to suppress the actions report.
hintstring | BaseString Additional hint to follow the action report (e.g. 'Did you hook up an event handler to the "Add" button?'). Defaults to an empty string.
 - Entered
 - 
    
PageElementFunction(element, args)
 - 
    
    
This function is executed inside the browser context, ie. the student page.
Parameters:
Name Type Argument Description elementDOMElement An HTML DOM Element.
args* <repeatable> 
Additional arguments as specified when registering the function.
 - 
    
PageElementGroupFunction(elements, args)
 - 
    
    
This function is executed inside the browser context, ie. the student page.
Parameters:
Name Type Argument Description elementsArray.<DOMElement> A list of DOM Elements.
args* <repeatable> 
Additional arguments as specified when registering the function.
 - 
    
PageFunction()
 - 
    
    
This function is executed inside the browser context, ie. the student page.
 - 
    
StyleAttributeMap
 - 
    
    
Maps style attribute name to BaseString value ('none' if the attribute is not set, or as appropriate to the style).
Type:
- Object
 
 - 
    
UnexpectedNavigationCallback(api)
 - 
    
    
This callback is invoked when there is an unexpected page navigation, and is expected to fail the test case with a suitable message.
Parameters:
Name Type Description apiTestCaseAPI