File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 30
30
" var jsonData = pm.response.json();" ,
31
31
" pm.test(\" Has correct schema\" , function() {" ,
32
32
" pm.expect(jsonData.data.allFilms.films).to.be.a(\" array\" );" ,
33
- " for(var i=0; i< jsonData.data.allFilms.films.length; i++) {" ,
34
- " pm.expect(jsonData.data.allFilms.films[i]. id).to.be.a(\" string\" );" ,
35
- " pm.expect(jsonData.data.allFilms.films[i]. title).to.be.a(\" string\" );" ,
36
- " pm.expect(jsonData.data.allFilms.films[i]. episodeID).to.be.a(\" number\" );" ,
37
- " }" ,
33
+ " _.each( jsonData.data.allFilms.films, (film) => {" ,
34
+ " pm.expect(film. id).to.be.a(\" string\" , \" Film ID not string. \" );" ,
35
+ " pm.expect(film. title).to.be.a(\" string\" , \" Film Title not string. \" );" ,
36
+ " pm.expect(film. episodeID).to.be.a(\" number\" , \" Film Episode ID not number. \" );" ,
37
+ " }) " ,
38
38
" });"
39
39
],
40
40
"type" : " text/javascript"
44
44
"request" : {
45
45
"method" : " POST" ,
46
46
"header" : [],
47
+ "body" : {
48
+ "mode" : " graphql" ,
49
+ "graphql" : {
50
+ "query" : " query{\n allFilms\n {\n films {\n id\n title\n episodeID\n }\n }\n }" ,
51
+ "variables" : " "
52
+ }
53
+ },
47
54
"url" : {
48
55
"raw" : " https://swapi.apis.guru/" ,
49
56
"protocol" : " https" ,
You can’t perform that action at this time.
0 commit comments