Skip to content

Keystore

This module contains step implementations for the Keystore task task.

Then keystore get default

Then get "{key}" from keystore and save in variable "{variable}", with default value "{default_value}"

[view_source]

Get a value for key using the Keystore task task.

If key does not exist in the keystore default_value will be used and will be set in the keystore to next iteration. default_value must be JSON serializable (string values must be single-quoted).

See Keystore task task documentation for more information.

Example:

And value for variable "foobar" is "none"
Then get "foobar_key" from keystore and save in variable "foobar", with default value "{'hello': 'world'}"

Then keystore get

Then get "{key}" from keystore and save in variable "{variable}"

[view_source]

Get a value for key using the Keystore task task.

See Keystore task task documentation for more information.

Example:

And value for variable "foobar" is "none"
Then get "foobar_key" from keystore and save in variable "foobar"

Then keystore set

Then set "{key}" in keystore with value "{value}"

[view_source]

Set a value for key using the Keystore task task.

value must be JSON serializable (string values must be single-quoted).

See Keystore task task documentation for more information.

Example:

And value for variable "foobar" is "{'hello': 'world'}"
Then set "foobar_key" in keystore with value "{{ foobar }}"

Then keystore inc default step

Then increment "{key}" in keystore and save in variable "{variable}"

[view_source]

Increment the integer value for key (with step 1) using the Keystore task task.

If there is no value for key incrementing will start from 0. The new value is saved in variable.

See Keystore task task documentation for more information.

Example:

Given value for variable "counter" is "none"
Then increment "counter_key" in keystore and save in variable "counter"

Then keystore pop

Then pop "{key}" from keystore and save in variable "{variable}"

[view_source]

Pop a value for key using the Keystore task task.

This task will block the scenario until there is a value in the keystore for key key, in other words it can be used to share and synchronize different scenarios.

See Keystore task task documentation for more information.

Example:

Scenario: push
    And value for variable "foobar" is "none"
    Then push "foobar_key" in keystore with value "foobar"

Scenario: pop
    And value for variable "foobar" is "none"
    Then pop "foobar_key" from keystore and save in variable "foobar"

Then keystore push

Then push "{key}" in keystore with value "{value}"

[view_source]

Push a value for key using the Keystore task task.

value must be JSON serializable (string values must be single-quoted).

See Keystore task task documentation for more information.

Example:

Scenario: push
    And value for variable "foobar" is "none"
    Then push "foobar_key" in keystore with value "foobar"

Scenario: pop
    And value for variable "foobar" is "none"
    Then pop "foobar_key" from keystore and save in variable "foobar"

Then keystore del

Then remove "{key}" from keystore

[view_source]

Remove key using the Keystore task task.

See Keystore task task documentation for more information.

Example:

And value for variable "foobar" is "hello"
Then set "foobar_key" in keystore with value "{{ foobar }}"
...
Then remove "foobar_key" from keystore