Skip to content

Commit e418dd8

Browse files
committed
expose doc with local variables
1 parent 2312490 commit e418dd8

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

docs/references/http-reference.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ request:
115115
</book>
116116
</catalog>
117117
118-
expose: ~
118+
expose:
119+
- $_response
119120
```
120121
121122
---
@@ -301,4 +302,6 @@ request:
301302
```
302303
### `expose`
303304

305+
`expose` is a sub-block, that can be used to expose local variable of this file to outer scope. For specification document that support http request also have a local variable called `$_response` which holds successful response in parsed format.
306+
304307
See docs on [expose node](/references/variable-reference#expose-node)

docs/references/testcase-reference.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Testcase specification format is how anyone express one or more Testcase(s)
1414

1515
Testcase specification document is a versioned document, meaning there MUST be a `version:` key on the document.
1616

17-
> [TBD] It's also an exposable document meaning, you can expose local variables to whatever other spec. document it's called from.
17+
It's also an _**exposable document**_ meaning you can expose local data using `expose:` key in the document. More on this in [variable spec. reference](/references/variable-reference)
1818

1919
### Reference as example
2020

@@ -46,6 +46,9 @@ spec:
4646
asserts:
4747
- {type: AssertEqual, actual: $Response.code, expected: 201}
4848
- {type: AssertIsMap, actual: $Response.body}
49+
50+
expose:
51+
- $_assertion_results
4952
```
5053
5154
---
@@ -432,3 +435,10 @@ spec:
432435
actual: $StudentObject
433436
expected: ['name', 'section', 'class', 'class_teacher_id']
434437
```
438+
439+
440+
### `expose`
441+
442+
`expose` is a sub-block, that can be used to expose local variable of this file to outer scope. For testcase specification document have a local variable called `$_assertion_results` which holds after assertion output.
443+
444+
See docs on [expose node](/references/variable-reference#expose-node)

0 commit comments

Comments
 (0)