Create a new spec under the specs/
folder:
1linkmeta:
2link name: GraphQL location service
3linkconfiguration:
4link host: graphql.contentful.com
5link scheme: https
6link base_path: /content/v1
7linkspecs:
8link - name: Get list of Lesson collections
9link request:
10link method: post
11link path: /spaces/f8bqpb154z8p/environments/master
12link query_params:
13link - name: access_token
14link value: 9d5de88248563ebc0d2ad688d0473f56fcd31c600e419d6c8962f6aed0150599
15link headers:
16link - name: content-type
17link value: application/json
18link payload:
19link body:
20link type: json
21link content:
22link query: >
23link {
24link lessonCollection(where: {OR: [{title_contains: "content"}, {title_contains: "SDK"}]}) {
25link items {
26link title
27link slug
28link }
29link }
30link }
31link variables: null
32link operationName: null
33link response:
34link status_code: 200
35link json_data:
36link - path: $.data.lessonCollection.items[0].title
37link value: Content model
38link - path: $.data.lessonCollection.items[0].slug
39link value: content-model
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/graphql-service.yml
Launcher will run suites: specs/graphql-service.yml
✓ Get list of Lesson collections (649ms)
Done: specs/graphql-service.yml (Passed)
0 skipped, 0 failed, 1 passing (1 tests)
0 skipped, 0 failed, 1 passing (1 suites)
Duration: 667ms