Skip to content

Context

Browse implementations

A context action is a special case of action in Chutney, providing technical support :

  • It does not make use of external services (see target).
  • It does not define outputs.
  • It should not have validations included.

Context Put🔗

Take a list of named values and put them into the execution context (i.e. create a variable for scenario expressions).

Required Name Type Default
* entries Map of <String, Object>

No outputs

Example🔗

1
2
3
4
5
6
7
ContextPutAction(
    entries = mapOf(
        "startDate" to "now().toInstant()".spEL(),
        "isoFormatter" to "isoDateFormatter('instant')".spEL(),
        "uuid" to "generate().uuid()".spEL()
    )
)

Debug🔗

Log the execution context variables.

Required Name Type Default Description
* filters List<String> List of strings that logged keys must contains

No outputs

Example🔗

1
2
3
DebugAction(
    filters = listOf("date")
)

Sleep🔗

Wait for a given time.

Required Name Type Default Description
* duration Duration (String) The time to wait for

No outputs

Example🔗

1
2
3
SleepAction(
    duration =  "5 sec"
)

Final🔗

Define a teardown action, which will be executed at the end of scenario execution.

Required Name Type Default Description
* type String The action type
* name String The name of the teardown action step
inputs Map<String, Object> The inputs to use
validations Map<String, Object> The validations to execute
strategy-type String The type of strategy to use
strategy-properties Map<String, Object> The properties of the strategy to use

No outputs

Example🔗

FinalAction(
    name = "Assert time passes...",
    type = "sleep",
    inputs = mapOf(
        "duration" to "500 ms"
    ),
    strategyType = "retry-with-timeout",
    strategyProperties = mapOf(
        "timeOut" to "3 s",
        "retryDelay" to "1 s"
    ),
    validations = mapOf(
        "date is past" to "now().isAfter(#dateToPass)".spEL()
    )
)

Fail🔗

Just fail.

No inputs

No outputs

Example🔗

FailAction()

Success🔗

Just pass.

No inputs

No outputs

Example🔗

SuccessAction()