Skip to content

added new memory steps #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/Steps/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ example:
```gherkin
When I save 'value' to memory as 'key'
```

---
### I set {string} = {string}

Save value to memory

| param | type | description | example |
|:-----:|:------:|:-----------:|:-------:|
| key | string | key | |
| value | string | value | |

example:
```gherkin
When I set 'key' = 'value'
```

---
### I save result of math expression {string} as {string}
Expand All @@ -99,3 +114,43 @@ example:
When I save result of math expression '{$variable} + 42' as 'result'
When I save result of math expression '{$random()} * 100' as 'result'
```

---
### I save json to memory as {string}: [Multiline]

Save json value to memory (as JS object)

| param | type | description | example |
|:-----:|:------:|:----------------------:|:-----------------:|
| key | string | key | |
| json | string | multi string with json | {"key" : "value"} |

example:
```gherkin
When I save json to memory as 'object':
"""
{
"someKey": "someValue",
"otherKey": 42
}
"""
Then I expect '$object.someKey' to equal 'someValue'
```

---
### I save key-value pairs to memory as {string}: [DataTable]

Save key-value pairs provided as Data Table to memory (as JS object)

| param | type | description | example |
|:-----:|:------:|:---------------:|:-------:|
| key | string | key | |
| kv | string | key-value pairs | |

example:
```gherkin
When I save key-value pairs to memory as 'key':
| someKey | 42 |
| someOtherKey | $valueFromMemory |
Then I expect '$object.someKey' to equal '42'
```