@@ -15,7 +15,7 @@ describe('Testing http chaos Probes', () => {
15
15
variables : {
16
16
projectID : projectID ,
17
17
request : {
18
- name : "exp1 " ,
18
+ name : "exp1111 " ,
19
19
description : '' ,
20
20
tags : [ ] ,
21
21
type : 'httpProbe' ,
@@ -45,7 +45,7 @@ describe('Testing http chaos Probes', () => {
45
45
}
46
46
} ) . then ( ( response ) => {
47
47
expect ( response . status ) . to . equal ( 200 ) ;
48
- expect ( response . body . data . addProbe . name ) . to . equal ( "exp1 " ) ;
48
+ expect ( response . body . data . addProbe . name ) . to . equal ( "exp1111 " ) ;
49
49
} ) ;
50
50
} ) ;
51
51
@@ -59,7 +59,7 @@ describe('Testing http chaos Probes', () => {
59
59
variables : {
60
60
projectID : projectID ,
61
61
request : {
62
- name : "exp1 " ,
62
+ name : "exp1111 " ,
63
63
description : '' ,
64
64
tags : [ ] ,
65
65
type : 'httpProbe' ,
@@ -89,7 +89,7 @@ describe('Testing http chaos Probes', () => {
89
89
}
90
90
} ) . then ( ( response ) => {
91
91
expect ( response . status ) . to . equal ( 200 ) ;
92
- expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp1 " }]' ) ;
92
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp1111 " }]' ) ;
93
93
} ) ;
94
94
} ) ;
95
95
@@ -101,7 +101,7 @@ describe('Testing http chaos Probes', () => {
101
101
variables : {
102
102
projectID : projectID ,
103
103
request : {
104
- name : "exp1 " ,
104
+ name : "exp1111 " ,
105
105
description : '' ,
106
106
tags : [ ] ,
107
107
type : 'httpProbe' ,
@@ -138,11 +138,34 @@ describe('Testing http chaos Probes', () => {
138
138
it ( 'Delete chaos probe' , ( ) => {
139
139
const accessToken = localStorage . getItem ( 'accessToken' ) ;
140
140
const projectID = localStorage . getItem ( 'projectID' ) ;
141
+
142
+ //negative test case for delete chaos probe
143
+ const deleteProbe_payload1 = {
144
+ operationName : 'deleteProbe' ,
145
+ variables : {
146
+ projectID : projectID ,
147
+ probeName : "exp0"
148
+ } ,
149
+ query : delete_httpprobe
150
+ }
151
+
152
+ cy . request ( {
153
+ method : 'POST' ,
154
+ url : '/api/query' ,
155
+ body : deleteProbe_payload1 ,
156
+ headers : {
157
+ Authorization : `Bearer ${ accessToken } `
158
+ }
159
+ } ) . then ( ( response ) => {
160
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'mongo: no documents in result' ) ;
161
+ } ) ;
162
+
163
+ //delete chaos probe
141
164
const deleteProbe_payload = {
142
165
operationName : 'deleteProbe' ,
143
166
variables : {
144
167
projectID : projectID ,
145
- probeName : "exp1 "
168
+ probeName : "exp1111 "
146
169
} ,
147
170
query : delete_httpprobe
148
171
}
@@ -176,7 +199,7 @@ describe('testing CMD chaos probes', () => {
176
199
variables : {
177
200
projectID : projectID ,
178
201
request : {
179
- name : "exp2 " ,
202
+ name : "exp2222 " ,
180
203
description : "" ,
181
204
tags : [ ] ,
182
205
type : "cmdProbe" ,
@@ -209,7 +232,7 @@ describe('testing CMD chaos probes', () => {
209
232
} ,
210
233
} ) . then ( ( response ) => {
211
234
expect ( response . status ) . to . equal ( 200 ) ;
212
- expect ( response . body . data . addProbe . name ) . to . equal ( "exp2 " ) ;
235
+ expect ( response . body . data . addProbe . name ) . to . equal ( "exp2222 " ) ;
213
236
} ) ;
214
237
} ) ;
215
238
@@ -221,7 +244,7 @@ describe('testing CMD chaos probes', () => {
221
244
variables : {
222
245
projectID : projectID ,
223
246
request : {
224
- name : "exp2 " ,
247
+ name : "exp2222 " ,
225
248
description : "" ,
226
249
tags : [ ] ,
227
250
type : "cmdProbe" ,
@@ -253,7 +276,7 @@ describe('testing CMD chaos probes', () => {
253
276
} ,
254
277
} ) . then ( ( response ) => {
255
278
expect ( response . status ) . to . equal ( 200 ) ;
256
- expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp2 " }]' ) ;
279
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp2222 " }]' ) ;
257
280
} ) ;
258
281
} ) ;
259
282
@@ -266,7 +289,7 @@ describe('testing CMD chaos probes', () => {
266
289
variables : {
267
290
projectID : projectID ,
268
291
request : {
269
- name : "exp2 " ,
292
+ name : "exp2222 " ,
270
293
description : "" ,
271
294
tags : [ ] ,
272
295
type : "cmdProbe" ,
@@ -309,12 +332,34 @@ describe('testing CMD chaos probes', () => {
309
332
it ( 'delete chaos probe' , ( ) => {
310
333
const accessToken = localStorage . getItem ( 'accessToken' ) ;
311
334
const projectID = localStorage . getItem ( 'projectID' ) ;
335
+
336
+ //negative test case for delete chaos probe
337
+ const deleteCMDProbe_payload1 = {
338
+ operationName : "deleteProbe" ,
339
+ variables : {
340
+ projectID : projectID ,
341
+ probeName : "exp0" ,
342
+ } ,
343
+ query : delete_CMDprobe ,
344
+ } ;
345
+
346
+ cy . request ( {
347
+ method : "POST" ,
348
+ url : "/api/query" ,
349
+ body : deleteCMDProbe_payload1 ,
350
+ headers : {
351
+ Authorization : `Bearer ${ accessToken } ` ,
352
+ } ,
353
+ } ) . then ( ( response ) => {
354
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'mongo: no documents in result' ) ;
355
+ } ) ;
356
+
312
357
//delete probe
313
358
const deleteCMDProbe_payload = {
314
359
operationName : "deleteProbe" ,
315
360
variables : {
316
361
projectID : projectID ,
317
- probeName : "exp2 " ,
362
+ probeName : "exp2222 " ,
318
363
} ,
319
364
query : delete_CMDprobe ,
320
365
} ;
@@ -348,7 +393,7 @@ describe('testing prometheus chaos probes', () => {
348
393
variables : {
349
394
projectID : projectID ,
350
395
request : {
351
- name : "exp3 " ,
396
+ name : "exp3333 " ,
352
397
description : "" ,
353
398
tags : [ ] ,
354
399
type : "promProbe" ,
@@ -382,7 +427,7 @@ describe('testing prometheus chaos probes', () => {
382
427
} ,
383
428
} ) . then ( ( response ) => {
384
429
expect ( response . status ) . to . equal ( 200 ) ;
385
- expect ( response . body . data . addProbe . name ) . to . equal ( "exp3 " ) ;
430
+ expect ( response . body . data . addProbe . name ) . to . equal ( "exp3333 " ) ;
386
431
} ) ;
387
432
} ) ;
388
433
@@ -394,7 +439,7 @@ describe('testing prometheus chaos probes', () => {
394
439
variables : {
395
440
projectID : projectID ,
396
441
request : {
397
- name : "exp3 " ,
442
+ name : "exp3333 " ,
398
443
description : "" ,
399
444
tags : [ ] ,
400
445
type : "promProbe" ,
@@ -428,7 +473,7 @@ describe('testing prometheus chaos probes', () => {
428
473
} ,
429
474
} ) . then ( ( response ) => {
430
475
expect ( response . status ) . to . equal ( 200 ) ;
431
- expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp3 " }]' ) ;
476
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp3333 " }]' ) ;
432
477
} ) ;
433
478
} ) ;
434
479
@@ -441,7 +486,7 @@ describe('testing prometheus chaos probes', () => {
441
486
variables : {
442
487
projectID : projectID ,
443
488
request : {
444
- name : "exp3 " ,
489
+ name : "exp3333 " ,
445
490
description : "" ,
446
491
tags : [ ] ,
447
492
type : "promProbe" ,
@@ -485,12 +530,34 @@ describe('testing prometheus chaos probes', () => {
485
530
it ( 'delete chaos probe' , ( ) => {
486
531
const accessToken = localStorage . getItem ( 'accessToken' ) ;
487
532
const projectID = localStorage . getItem ( 'projectID' ) ;
533
+
534
+ //negative test case for delete chaos probe
535
+ const deletePROMProbe_payload1 = {
536
+ operationName : "deleteProbe" ,
537
+ variables : {
538
+ projectID : projectID ,
539
+ probeName : "exp0" ,
540
+ } ,
541
+ query : delete_PROMProbe ,
542
+ } ;
543
+
544
+ cy . request ( {
545
+ method : "POST" ,
546
+ url : "/api/query" ,
547
+ body : deletePROMProbe_payload1 ,
548
+ headers : {
549
+ Authorization : `Bearer ${ accessToken } ` ,
550
+ } ,
551
+ } ) . then ( ( response ) => {
552
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'mongo: no documents in result' ) ;
553
+ } ) ;
554
+
488
555
//delete probe
489
- const deletePROMProbe_payload = {
556
+ const deletePROMProbe_payload = {
490
557
operationName : "deleteProbe" ,
491
558
variables : {
492
559
projectID : projectID ,
493
- probeName : "exp3 " ,
560
+ probeName : "exp3333 " ,
494
561
} ,
495
562
query : delete_PROMProbe ,
496
563
} ;
@@ -524,7 +591,7 @@ describe('testing kubernetes chaos probes', () => {
524
591
variables : {
525
592
projectID : projectID ,
526
593
request : {
527
- name : "exp4 " ,
594
+ name : "exp4444 " ,
528
595
description : "" ,
529
596
tags : [ ] ,
530
597
type : "k8sProbe" ,
@@ -556,7 +623,7 @@ describe('testing kubernetes chaos probes', () => {
556
623
} ,
557
624
} ) . then ( ( response ) => {
558
625
expect ( response . status ) . to . equal ( 200 ) ;
559
- expect ( response . body . data . addProbe . name ) . to . equal ( "exp4 " ) ;
626
+ expect ( response . body . data . addProbe . name ) . to . equal ( "exp4444 " ) ;
560
627
} ) ;
561
628
} ) ;
562
629
@@ -568,7 +635,7 @@ describe('testing kubernetes chaos probes', () => {
568
635
variables : {
569
636
projectID : projectID ,
570
637
request : {
571
- name : "exp4 " ,
638
+ name : "exp4444 " ,
572
639
description : "" ,
573
640
tags : [ ] ,
574
641
type : "k8sProbe" ,
@@ -600,7 +667,7 @@ describe('testing kubernetes chaos probes', () => {
600
667
} ,
601
668
} ) . then ( ( response ) => {
602
669
expect ( response . status ) . to . equal ( 200 ) ;
603
- expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp4 " }]' ) ;
670
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'write exception: write errors: [E11000 duplicate key error collection: litmus.chaosProbes index: name_1 dup key: { name: "exp4444 " }]' ) ;
604
671
605
672
} ) ;
606
673
} ) ;
@@ -614,7 +681,7 @@ describe('testing kubernetes chaos probes', () => {
614
681
variables : {
615
682
projectID : projectID ,
616
683
request : {
617
- name : "exp4 " ,
684
+ name : "exp4444 " ,
618
685
description : "" ,
619
686
tags : [ ] ,
620
687
type : "k8sProbe" ,
@@ -658,12 +725,34 @@ describe('testing kubernetes chaos probes', () => {
658
725
it ( 'delete chaos probe' , ( ) => {
659
726
const accessToken = localStorage . getItem ( 'accessToken' ) ;
660
727
const projectID = localStorage . getItem ( 'projectID' ) ;
728
+
729
+ //negative test case for chaos probe
730
+ const delete_K8SProbe_payload1 = {
731
+ operationName : "deleteProbe" ,
732
+ variables : {
733
+ projectID : projectID ,
734
+ probeName : "exp0" ,
735
+ } ,
736
+ query : delete_k8sProbe ,
737
+ } ;
738
+
739
+ cy . request ( {
740
+ method : "POST" ,
741
+ url : "/api/query" ,
742
+ body : delete_K8SProbe_payload1 ,
743
+ headers : {
744
+ Authorization : `Bearer ${ accessToken } ` ,
745
+ } ,
746
+ } ) . then ( ( response ) => {
747
+ expect ( response . body . errors [ 0 ] . message ) . to . equal ( 'mongo: no documents in result' ) ;
748
+ } ) ;
749
+
661
750
//delete probe
662
751
const delete_K8SProbe_payload = {
663
752
operationName : "deleteProbe" ,
664
753
variables : {
665
754
projectID : projectID ,
666
- probeName : "exp4 " ,
755
+ probeName : "exp4444 " ,
667
756
} ,
668
757
query : delete_k8sProbe ,
669
758
} ;
0 commit comments