brian-watkins / elm-spec / Spec.Step

A scenario script is a sequence of steps. A step is a function from a Context, which represents the current scenario state, to a Command, which describes an action to be executed before moving to the next step.

See Spec.Command, Spec.File, Spec.Navigator, Spec.Http, Spec.Markup, Spec.Markup.Event, Spec.Port, and Spec.Time for steps you can use to build a scenario script.


type alias Step model msg =
Context model -> Command msg

Represents a step in a scenario script.


type alias Context model =
Context model

Represents the current state of the program.


type alias Command msg =
Command msg

Represents an action to be performed.

Using the Context

model : Context model -> model

Get the current program model from the Context.

Basic Commands

halt : Spec.Report.Report -> Command msg

The spec runner will halt the scenario and print the given report.

log : Spec.Report.Report -> Command msg

The spec runner will log the given report to the console.