Star

Created With

linkBasic Usage

Specs consistent of three basic sections:



linkCreating a Spec

Create a new spec under the specs/ folder:

specs/star-wars-service.yml
1linkmeta:

2link name: Star Wars suite

3linkconfiguration:

4link scheme: https

5link host: swapi.dev

6link base_path: /api

7linkspecs:

8link - name: Fetch info about Luke Skywalker

9link request:

10link path: /people/1/

11link method: get

12link accept: application/json

13link response:

14link status_code: 200

15link headers:

16link - name: content-type

17link value: !!js/regexp application/json

18link json_data:

19link - path: $.name

20link value: Luke Skywalker



linkRunning the Spec

Run the spec from the terminal:

1link$./node_modules/.bin/rest-ez

Test Suite path/pattern/directory is not specified, Looking for suites in specs directory Found suites: - specs/star-wars-service.yml Launcher will run suites: specs/star-wars-service.yml ✓ Fetch info about Luke Skywalker (649ms) Done: specs/star-wars-service.yml (Passed) 0 skipped, 0 failed, 1 passing (1 tests) 0 skipped, 0 failed, 1 passing (1 suites) Duration: 667ms
Basic UsageCreating a SpecRunning the Spec

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