Skip to content

Commit aa85fb1

Browse files
added new memory steps (#35)
1 parent b2a0419 commit aa85fb1

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

docs/Steps/memory.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ example:
8383
```gherkin
8484
When I save 'value' to memory as 'key'
8585
```
86+
87+
---
88+
### I set {string} = {string}
89+
90+
Save value to memory
91+
92+
| param | type | description | example |
93+
|:-----:|:------:|:-----------:|:-------:|
94+
| key | string | key | |
95+
| value | string | value | |
96+
97+
example:
98+
```gherkin
99+
When I set 'key' = 'value'
100+
```
86101
87102
---
88103
### I save result of math expression {string} as {string}
@@ -99,3 +114,43 @@ example:
99114
When I save result of math expression '{$variable} + 42' as 'result'
100115
When I save result of math expression '{$random()} * 100' as 'result'
101116
```
117+
118+
---
119+
### I save json to memory as {string}: [Multiline]
120+
121+
Save json value to memory (as JS object)
122+
123+
| param | type | description | example |
124+
|:-----:|:------:|:----------------------:|:-----------------:|
125+
| key | string | key | |
126+
| json | string | multi string with json | {"key" : "value"} |
127+
128+
example:
129+
```gherkin
130+
When I save json to memory as 'object':
131+
"""
132+
{
133+
"someKey": "someValue",
134+
"otherKey": 42
135+
}
136+
"""
137+
Then I expect '$object.someKey' to equal 'someValue'
138+
```
139+
140+
---
141+
### I save key-value pairs to memory as {string}: [DataTable]
142+
143+
Save key-value pairs provided as Data Table to memory (as JS object)
144+
145+
| param | type | description | example |
146+
|:-----:|:------:|:---------------:|:-------:|
147+
| key | string | key | |
148+
| kv | string | key-value pairs | |
149+
150+
example:
151+
```gherkin
152+
When I save key-value pairs to memory as 'key':
153+
| someKey | 42 |
154+
| someOtherKey | $valueFromMemory |
155+
Then I expect '$object.someKey' to equal '42'
156+
```

0 commit comments

Comments
 (0)