#cp.spec.Scenario
A Definition which describes a specific scenario.
A Scenario
is most typically created via the it function, like so:
Scenarios can be run asynchronously via the Run.This instance passed to the doing
function. To indicate a scenario is asynchronous, call this:wait()
, then call this:done()
, to indicate it has completed. Any assert
call which fails will result in the run failing, and stop at that point.
For example:
Definitions can also be data-driven, via the where method:
This will do a run for each variation and interpolate the value into the run name for each.
Note: "where" parameters will not override built-in functions and fields in the this instance (such as "async" or "done") so ensure that you pick names that don't clash.
#API Overview
Constructors - API calls which return an object, typically one that offers API methods
Methods - API calls which can only be made on an object returned by a constructor