Internationalisation
Bundled Plugins API
Handler
Subclasses of this can customise how reports are handled. All methods do nothing.

API Overview

API Documentation

Functions

default

Signature
cp.spec.Handler.default([handler]) -> cp.spec.Handler
Type
Function
Description
Gets and sets the current default Handler implementation.
Parameters
  • handler - (optional) when provided, sets the default to the specified handler.
Returns
  • The current Handler implementation.

Constructors

Handler

Signature
cp.spec.Handler() -> cp.spec.Handler
Type
Constructor
Description
Creates a new Handler

Methods

aborted

Signature
cp.spec.Handler:aborted(run)
Type
Method
Description
Call to indicate the run has had an abort.
Parameters
  • run - The test run.
  • msg - The message.
Signature
cp.spec.Handler:checkVerbose(run) -> boolean
Type
Method
Description
Indicates if either the handler or the individual Run is

failed

Signature
cp.spec.Handler:failed(run)
Type
Method
Description
Call to indicate the run has failed.
Parameters
  • run - The test run.
  • msg - The message.

filter

Signature
cp.spec.Handler:filter(run, msg)
Type
Method
Description
Call to indicate the run is running due to being filtered.
Parameters
  • run - The test run.
  • msg - The message.

passed

Signature
cp.spec.Handler:passed(run)
Type
Method
Description
Call to indicate the run has passed.
Parameters
  • run - The test run.

start

Signature
cp.spec.Handler:start(run)
Type
Method
Description
Call to indicate the run has started.
Parameters
  • run - The test run.

stop

Signature
cp.spec.Handler:stop(run)
Type
Method
Description
Call to indicate the run has completed.
Parameters
  • run - The test run.

summary

Signature
cp.spec.Handler:summary(run, report)
Type
Method
Description
Call to indicate the run has passed with the given report.
Parameters
  • run - The test run.
  • report - The test reports.

verbose

Signature
cp.spec.Handler:verbose([isVerbose]) -> self
Type
Method
Description
Indicate that the handler is (or is not) verbose.
Parameters
  • isVerbose - (optional) If set to false, the handler will not be verbose. Defaults to true.
Returns
  • The Handler instance, for chaining.

waiting

Signature
cp.spec.Handler:waiting(run, timeout)
Type
Method
Description
Call to indicate that the run is waiting asynchronously.
Parameters
  • run - The test run.
  • timeout - The timeout, in seconds.
Last modified 1mo ago