Internationalisation
Bundled Plugins API
Report
The results of a test run.

API Overview

API Documentation

Constructors

Report

Signature
cp.spec.Report(run) -> cp.spec.Report
Type
Constructor
Description
Creates a new test report.

Fields

aborts

Signature
cp.spec.Report.aborts <number>
Type
Field
Description
The number of aborts in the run.

failures

Signature
cp.spec.Report.failures <number>
Type
Field
Description
The number of failures in the run.

passes

Signature
cp.spec.Report.passes <number>
Type
Field
Description
The number of passes in the run.

run

Signature
cp.spec.Report.run <cp.spec.Run>
Type
Field
Description
The run the reports are for.

startTime

Signature
cp.spec.Report.startTime <number>
Type
Field
Description
The number of seconds since epoch when the test started, or nil if not started yet.

stopTime

Signature
cp.spec.Report.stopTime <number>
Type
Field
Description
The number of seconds since epoch when the tests stopped, or nil if not stopped yet.

totalTime

Signature
cp.spec.Report.totalTime <number>
Type
Field
Description
The number of seconds the run took (may be decimal), or nil if the test hasn't run.

Methods

aborted

Signature
cp.spec.Report:aborted(message)
Type
Method
Description
Records an abort, with the specified message.
Parameters
  • message - The related message to output.

add

Signature
cp.spec.Report:add(otherReport) -> nil
Type
Method
Description
Adds the passes/failures/aborts from the other report into this one.
Parameters
  • otherReport - The other report to add.

failed

Signature
cp.spec.Report:failed(message)
Type
Method
Description
Records a fail, with the specified message.
Parameters
  • message - The related message to output.

passed

Signature
cp.spec.Report:passed([message])
Type
Method
Description
Records a pass, with the specified message.
Parameters
  • message - an optional additional message to output.

start

Signature
cp.spec.Report:start() -> nil
Type
Method
Description
Logs the start time.

stop

Signature
cp.spec.Report:stop() -> nil
Type
Method
Description
Logs the end time.

summary

Signature
cp.spec.Report:summary()
Type
Method
Description
Summarise the reports.

waiting

Signature
cp.spec.Report:waiting(timeout)
Type
Method
Description
Records that a run is waiting for up to the specified amount of time.
Parameters
  • timeout - The timeout to wait for, in seconds.
Last modified 1mo ago