@@ -34,7 +34,7 @@ describe("Validate Airtable Ds", () => {
34
34
35
35
_ . dataSources . RunQuery ( ) ;
36
36
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
37
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
37
+ jsonSpecies = resObj . response . body . data . body ;
38
38
jsonSpecies . records . forEach ( ( record : { fields : any } ) => {
39
39
specieslist . push ( record . fields . Species_ID ) ;
40
40
} ) ;
@@ -53,7 +53,7 @@ describe("Validate Airtable Ds", () => {
53
53
54
54
_ . dataSources . RunQuery ( ) ;
55
55
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
56
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
56
+ jsonSpecies = resObj . response . body . data . body ;
57
57
const hasOnlyAllowedKeys = jsonSpecies . records . every ( ( record : any ) => {
58
58
const fieldKeys = Object . keys ( record . fields ) ;
59
59
return (
@@ -79,7 +79,7 @@ describe("Validate Airtable Ds", () => {
79
79
} ) ;
80
80
_ . dataSources . RunQuery ( ) ;
81
81
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
82
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
82
+ jsonSpecies = resObj . response . body . data . body ;
83
83
expect ( jsonSpecies . records . length ) . to . eq ( 11 ) ; //making sure only 11 record fields are returned
84
84
} ) ;
85
85
@@ -91,7 +91,7 @@ describe("Validate Airtable Ds", () => {
91
91
} ) ;
92
92
_ . dataSources . RunQuery ( ) ;
93
93
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
94
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
94
+ jsonSpecies = resObj . response . body . data . body ;
95
95
expect ( jsonSpecies . records . length ) . to . eq ( 6 ) ; //making sure only 6 record fields are returned, honouring the PageSize
96
96
97
97
//Validating offset
@@ -104,7 +104,7 @@ describe("Validate Airtable Ds", () => {
104
104
_ . dataSources . RunQuery ( ) ;
105
105
106
106
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
107
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
107
+ jsonSpecies = resObj . response . body . data . body ;
108
108
expect ( jsonSpecies . records . length ) . to . eq ( 5 ) ; //making sure only remaining records are returned
109
109
} ) ;
110
110
} ) ;
@@ -124,7 +124,7 @@ describe("Validate Airtable Ds", () => {
124
124
_ . dataSources . RunQuery ( ) ;
125
125
126
126
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
127
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
127
+ jsonSpecies = resObj . response . body . data . body ;
128
128
const allRecordsWithRodentTaxa = jsonSpecies . records . filter (
129
129
( record : { fields : { Taxa : string } } ) =>
130
130
record . fields . Taxa === "Rodent" ,
@@ -158,7 +158,7 @@ describe("Validate Airtable Ds", () => {
158
158
_ . dataSources . RunQuery ( ) ;
159
159
160
160
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
161
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
161
+ jsonSpecies = resObj . response . body . data . body ;
162
162
const sorted = jsonSpecies . records . every (
163
163
( record : { fields : { Species_ID : string } } , i : number ) => {
164
164
if ( i === 0 ) {
@@ -193,7 +193,7 @@ describe("Validate Airtable Ds", () => {
193
193
_ . dataSources . RunQuery ( ) ;
194
194
195
195
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
196
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
196
+ jsonSpecies = resObj . response . body . data . body ;
197
197
const sorted = jsonSpecies . records . every (
198
198
( record : { fields : { Species_ID : string } } , i : number ) => {
199
199
if ( i === 0 ) {
@@ -232,7 +232,7 @@ describe("Validate Airtable Ds", () => {
232
232
_ . dataSources . RunQuery ( ) ;
233
233
234
234
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
235
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
235
+ jsonSpecies = resObj . response . body . data . body ;
236
236
const isJSONValid = jsonSpecies . records . every (
237
237
( record : { fields : { Species_ID : any } } ) => {
238
238
const speciesID = record . fields . Species_ID ;
@@ -269,7 +269,7 @@ describe("Validate Airtable Ds", () => {
269
269
_ . dataSources . RunQuery ( ) ;
270
270
271
271
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
272
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
272
+ jsonSpecies = resObj . response . body . data . body ;
273
273
//cy.log("jsonSpecies is"+ jsonSpecies)
274
274
expect ( jsonSpecies . records . length ) . to . eq ( 1 ) ; //making sure only inserted record is returned
275
275
@@ -289,7 +289,7 @@ describe("Validate Airtable Ds", () => {
289
289
_ . dataSources . RunQuery ( ) ;
290
290
291
291
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
292
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
292
+ jsonSpecies = resObj . response . body . data . body ;
293
293
const hasOnlyInsertedRecord = ( ) => {
294
294
return (
295
295
jsonSpecies . fields . Species_ID === "SF" &&
@@ -325,7 +325,7 @@ describe("Validate Airtable Ds", () => {
325
325
_ . dataSources . RunQuery ( ) ;
326
326
327
327
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
328
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
328
+ jsonSpecies = resObj . response . body . data . body ;
329
329
const hasOnlyUpdatedRecord = ( ) => {
330
330
return (
331
331
jsonSpecies . records [ 0 ] . fields . Species_ID === "SG" &&
@@ -348,7 +348,7 @@ describe("Validate Airtable Ds", () => {
348
348
_ . dataSources . RunQuery ( ) ;
349
349
350
350
cy . get ( "@postExecute" ) . then ( ( resObj : any ) => {
351
- jsonSpecies = JSON . parse ( resObj . response . body . data . body ) ;
351
+ jsonSpecies = resObj . response . body . data . body ;
352
352
expect ( jsonSpecies . deleted ) . to . be . true ;
353
353
} ) ;
354
354
} ) ;
0 commit comments