Star

Created With

linkContext

All types of functions include appropriate context bound to this:

linkSuite

Provides the full context of the suite.

💡 Chain requests by assigning data to this.suite to utilize in subsequent specs

Available in:

get-user-addresses.yml
1link - name: get user

2link request:

3link path: /user

4link method: get

5link before_test:

6link run_type: module

7link module:

8link function: !!js/function >

9link function () {

10link this.suite.user = JSON.parse(this.response.body);

11link }

12link - name: get addresses

13link request:

14link path: /users/{userId}/addresses

15link method: get

16link after_test:

17link run_type: module

18link module:

19link function: !!js/function >

20link function () {

21link const { id } = this.suite.user;

22link this.suite.path_params = { userId: id };

23link }



linkTest

Provides the full context of the test (spec). Modify its properties on a before_* hook to change the spec request.

💡 Chain requests by utilizing data previously saved to this.suite to modify the spec.

Available in:

get-user-addresses.yml
1link - name: get user

2link request:

3link path: /user

4link method: get

5link before_test:

6link run_type: module

7link module:

8link function: !!js/function >

9link function () {

10link this.suite.user = JSON.parse(this.response.body);

11link }

12link - name: get addresses

13link request:

14link path: /users/{userId}/addresses

15link method: get

16link after_test:

17link run_type: module

18link module:

19link function: !!js/function >

20link function () {

21link const { id } = this.suite.user;

22link this.suite.path_params = { userId: id };

23link }



linkResponse

Provides full information about the response of this spec.

Available in:

get-user-addresses.yml
1link - name: get user

2link request:

3link path: /user

4link method: get

5link before_test:

6link run_type: module

7link module:

8link function: !!js/function >

9link function () {

10link this.suite.user = JSON.parse(this.response.body);

11link }



ContextSuiteTestResponse

Home

Getting Startedchevron_right
Basicschevron_right
Requestchevron_right

Request Basics Headers Cookies Query Parameters Path Parameters

Payload Bodychevron_right

File Uploads Auto-Retry Additional Options

Response Validationchevron_right

Overview

Assertionschevron_right

Status Code Headers & Cookies

Bodychevron_right
Hooks & JSchevron_right

Overview

Function Typeschevron_right
Suite-Level Hookschevron_right
Spec-Level Hookschevron_right
Contextchevron_right
DRY & Reusing Specschevron_right
Command Line Interface (CLI)chevron_right