The Ctrl (Control) library

The Control library allows specification developers to control and direct the execution of generated scripts. This library exposes commands (Ctrl.doXXX) and their respective events (Ctrl.XXXEvent).

Sample usage:

//@provengo summon ctrl (1)

bthread("marker", function(){
    waitFor( enterLoginPage ); (2)
    waitFor( couponApplied );
    waitFor( enterOrderCompletionPage );
    Ctrl.doMark("Sell with coupon complete") (3)
});
1 Summoning the Control library
2 Waiting for a series of events
3 Using the Control library to mark that a sell using coupon was completed

Events

Ctrl.markEvent( markerName )

A marker event, signaling a point of interest in the generated scenario (e.g. business process completion). Does not actuate anything. Useful for filtering and ranking scenarios and test suites.

markerName

Name of the marker.

Ctrl.pauseEvent()

The event of the scenario pausing until a user presses Enter. The command counterpart of this event (see below) is probably more useful than the event itself.

Ctrl.sleepEvent(millis)

The event of the the generated scenario pausing for the specified amount of milliseconds.

millis

The length of the pause, in milliseconds.

Commands

Ctrl.doMark( markerName )

Create a marker event on the scenario. This command can be used to mark the completion of a business process (e.g. Ctrl.doMark("customer signed up")), or other situations of interest. When creating an optimized a test suite, these events can be used for ranking generated scenarios.

markerName

Name of the marker.

Ctrl.doPause()

Pause the test until the user presses Enter. This command is ignored when running in --batch-mode or when no console is present.

Ctrl.doSleep(millis)

Makes the test wait for the specified amount of milliseconds.

millis

Wait time in milliseconds.