#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# Test.Reporter Class

Defined in: `test/js/Reporter.js:2`
Module: test

An object capable of sending test results to a server.

## Constructor

### `Test.Reporter`

(

- `url`
- `format`

)

Defined in `test/js/Reporter.js:2`

#### Parameters:

- `url` String

  The URL to submit the results to.

- `format` Function

  (Optiona) A function that outputs the results in a specific format. Default is YUITest.TestFormat.XML.

- Index
- Methods
- Properties

## Item Index

### Methods

- addField
- clearFields
- destroy
- report

### Properties

- _fields
- _form
- _iframe
- format
- url

## Methods

### `addField`

(

- `name`
- `value`

)
Void

Defined in `test/js/Reporter.js:58`

Adds a field to the form that submits the results.

#### Parameters:

- `name` String

  The name of the field.

- `value` Variant

  The value of the field.

#### Returns:

Void:

### `clearFields`

() Void

Defined in `test/js/Reporter.js:69`

Removes all previous defined fields.

#### Returns:

Void:

### `destroy`

() Void

Defined in `test/js/Reporter.js:78`

Cleans up the memory associated with the TestReporter, removing DOM elements that were created.

#### Returns:

Void:

### `report`

(

- `results`

)
Void

Defined in `test/js/Reporter.js:96`

Sends the report to the server.

#### Parameters:

- `results` Object

  The results object created by TestRunner.

#### Returns:

Void:

## Properties

### `_fields`

Object private

Defined in `test/js/Reporter.js:28`

Extra fields to submit with the request.

### `_form`

HTMLFormElement private

Defined in `test/js/Reporter.js:36`

The form element used to submit the results.

### `_iframe`

HTMLIFrameElement private

Defined in `test/js/Reporter.js:44`

Iframe used as a target for form submission.

### `format`

Function

Defined in `test/js/Reporter.js:21`

The formatting function to call when submitting the data.

### `url`

String

Defined in `test/js/Reporter.js:14`

The URL to submit the data to.