Skip to content

Commit e7e8c8d

Browse files
feat: changes to success criteria checks display (#1943)
* feat: changes to success criteria checks display * chore: update smoke snapshot * chore: make check display function * chore: update name * chore: update smoke * chore: update smoke again --------- Co-authored-by: Roman Hotsiy <[email protected]>
1 parent dec8062 commit e7e8c8d

File tree

34 files changed

+294
-281
lines changed

34 files changed

+294
-281
lines changed

__tests__/respect/case-insensitive-headers/__snapshots__/case-insensitive-headers.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ exports[`should send in request and proceed case-insensitive headers in runtime
66
Running workflow case-insensitive-headers.yaml / get-museum-hours
77
88
✓ GET /museum-hours - step get-museum-hours
9-
    ✓ success criteria check
10-
    ✓ success criteria check
11-
    ✓ success criteria check
12-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
9+
    ✓ success criteria check - $request.header.content-type == 'third'
10+
    ✓ success criteria check - $request.header.CammelCasedHeader == 'custom-heade...
11+
    ✓ success criteria check - $response.header.X-Content-Type-Options == 'nosnif...
12+
    ✓ status code check - $statusCode in [200, 400, 404]
1313
    ✓ content-type check
1414
    ✓ schema check
1515

__tests__/respect/cat-fact-api/__snapshots__/cat-fact-api.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`cats api test case 1`] = `
66
Running workflow auto-cat.yaml / get-breeds-workflow
77
88
✗ GET /breeds - step get-breeds-step
9-
    ✓ status code check (Response code 200 matches one of description codes: [200])
9+
    ✓ status code check - $statusCode in [200]
1010
    ✓ content-type check
1111
    ✗ schema check
1212
@@ -15,7 +15,7 @@ exports[`cats api test case 1`] = `
1515
Running workflow auto-cat.yaml / get-fact-workflow
1616
1717
✓ GET /fact - step get-fact-step
18-
    ✓ status code check (Response code 200 matches one of description codes: [200, 404])
18+
    ✓ status code check - $statusCode in [200, 404]
1919
    ✓ content-type check
2020
    ✓ schema check
2121
@@ -24,7 +24,7 @@ exports[`cats api test case 1`] = `
2424
Running workflow auto-cat.yaml / get-facts-workflow
2525
2626
✗ GET /facts - step get-facts-step
27-
    ✓ status code check (Response code 200 matches one of description codes: [200])
27+
    ✓ status code check - $statusCode in [200]
2828
    ✓ content-type check
2929
    ✗ schema check
3030

__tests__/respect/free-apis/__snapshots__/free-apis.test.ts.snap

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ exports[`free apis test case 1`] = `
66
Running workflow free.yaml / json
77
88
✓ GET https://jsonplaceholder.typicode.com/posts/1 - step get-first-post
9-
    ✓ success criteria check
10-
    ✓ success criteria check
11-
    ✓ success criteria check
12-
    ✓ success criteria check
13-
    ✓ success criteria check
9+
    ✓ success criteria check - $statusCode == 200
10+
    ✓ success criteria check - $response.body#/id == 1
11+
    ✓ success criteria check - $response.body#/title == 'sunt aut facere repellat...
12+
    ✓ success criteria check - $response.body#/body == "quia et suscipit\\nsuscipi...
13+
    ✓ success criteria check - $response.body#/userId == 1
1414
1515
✓ GET https://jsonplaceholder.typicode.com/posts/wrong-id - step get-wrong-post
16-
    ✓ success criteria check
16+
    ✓ success criteria check - $statusCode == 404
1717
1818
────────────────────────────────────────────────────────────────────────────────
1919
2020
Running workflow free.yaml / xml
2121
2222
✗ POST http://restapi.adequateshop.com/api/Traveler - step post-traveler
23-
    ✓ success criteria check
24-
    ✓ success criteria check
25-
    ✗ success criteria check
23+
    ✓ success criteria check - $statusCode == 404
24+
    ✓ success criteria check - $response.header.content-type == 'text/html; chars...
25+
    ✗ success criteria check - $response.body == '<Error><Message>Pleae try with ...
2626
2727
2828
  Failed tests info:

__tests__/respect/implicit/__snapshots__/implicit.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exports[`should implicitly add content type header based on requestBody.content
3434
    Response Body:
3535
      {}
3636
37-
    ✓ status code check (Response code 204 matches one of description codes: [204, 400])
37+
    ✓ status code check - $statusCode in [204, 400]
3838
3939
✓ POST /quizzes - step post-quizzes
4040
@@ -74,8 +74,8 @@ exports[`should implicitly add content type header based on requestBody.content
7474
       "instance": "string"
7575
      }
7676
77-
    ✓ success criteria check
78-
    ✓ status code check (Response code 400 matches one of description codes: [201, 400])
77+
    ✓ success criteria check - $request.header.content-type == 'application/origi...
78+
    ✓ status code check - $statusCode in [201, 400]
7979
    ✓ content-type check
8080
    ✓ schema check
8181

__tests__/respect/inputs-with-cli-and-env/__snapshots__/inputs-with-cli-and-env.test.ts.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ exports[`should use inputs from CLI and env 1`] = `
6969
       }
7070
      ]
7171
72-
    ✓ success criteria check
73-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
72+
    ✓ success criteria check - $statusCode == 200
73+
    ✓ status code check - $statusCode in [200, 400, 404]
7474
    ✓ content-type check
7575
    ✓ schema check
7676
@@ -103,8 +103,8 @@ exports[`should use inputs from CLI and env 1`] = `
103103
       "confirmationCode": "ticket-general-e5e5c6-dce78"
104104
      }
105105
106-
    ✓ success criteria check
107-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
106+
    ✓ success criteria check - $statusCode == 201
107+
    ✓ status code check - $statusCode in [201, 400, 404]
108108
    ✓ content-type check
109109
    ✓ schema check
110110
@@ -152,9 +152,9 @@ exports[`should use inputs from CLI and env 1`] = `
152152
       "price": 0
153153
      }
154154
155-
    ✓ success criteria check
156-
    ✓ success criteria check
157-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
155+
    ✓ success criteria check - $statusCode == 201
156+
    ✓ success criteria check - $.name == 'Mermaid Treasure Identification and Ana...
157+
    ✓ status code check - $statusCode in [201, 400, 404]
158158
    ✓ content-type check
159159
    ✓ schema check
160160

__tests__/respect/local-json-server/__snapshots__/local-json-server.test.ts.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`local-json-server local-json-server test case 1`] = `
66
Running workflow local-json-server.yaml / before
77
88
✓ GET /items - step get-all-items-before
9-
    ✓ status code check (Response code 200 matches one of description codes: [200])
9+
    ✓ status code check - $statusCode in [200]
1010
    ✓ content-type check
1111
    ✓ schema check
1212
@@ -15,55 +15,55 @@ exports[`local-json-server local-json-server test case 1`] = `
1515
Running workflow local-json-server.yaml / crud-items
1616
1717
✓ POST /items - step add-item
18-
    ✓ success criteria check
19-
    ✓ status code check (Response code 201 matches one of description codes: [201])
18+
    ✓ success criteria check - $statusCode == 201
19+
    ✓ status code check - $statusCode in [201]
2020
    ✓ content-type check
2121
    ✓ schema check
2222
2323
✗ GET /items - step get-all-items-again
24-
    ✗ success criteria check
25-
    ✓ status code check (Response code 200 matches one of description codes: [200])
24+
    ✗ success criteria check - $response.body#/0/value == 100
25+
    ✓ status code check - $statusCode in [200]
2626
    ✓ content-type check
2727
    ✓ schema check
2828
2929
✓ GET /items/{id} - step get-item-by-id
30-
    ✓ success criteria check
31-
    ✓ success criteria check
32-
    ✓ success criteria check
33-
    ✓ status code check (Response code 200 matches one of description codes: [200, 404])
30+
    ✓ success criteria check - $statusCode == 200
31+
    ✓ success criteria check - $response.body#/id == $steps.add-item.outputs.crea...
32+
    ✓ success criteria check - $response.body#/value == $steps.add-item.outputs.c...
33+
    ✓ status code check - $statusCode in [200, 404]
3434
    ✓ content-type check
3535
    ✓ schema check
3636
3737
✓ DELETE /items/{id} - step drop-item
38-
    ✓ success criteria check
39-
    ✓ status code check (Response code 200 matches one of description codes: [200])
38+
    ✓ success criteria check - $statusCode == 200
39+
    ✓ status code check - $statusCode in [200]
4040
4141
✓ GET /items/{id} - step get-after-deleting
42-
    ✓ success criteria check
43-
    ✓ status code check (Response code 404 matches one of description codes: [200, 404])
42+
    ✓ success criteria check - $statusCode == 404
43+
    ✓ status code check - $statusCode in [200, 404]
4444
    ✓ content-type check
4545
4646
────────────────────────────────────────────────────────────────────────────────
4747
4848
Running workflow local-json-server.yaml / auto-inherit
4949
5050
✓ POST /items - step add-item-auto-inherit
51-
    ✓ status code check (Response code 201 matches one of description codes: [201])
51+
    ✓ status code check - $statusCode in [201]
5252
    ✓ content-type check
5353
    ✓ schema check
5454
5555
✓ GET /items - step get-all-items
56-
    ✓ status code check (Response code 200 matches one of description codes: [200])
56+
    ✓ status code check - $statusCode in [200]
5757
    ✓ content-type check
5858
    ✓ schema check
5959
6060
✓ GET /items/{id} - step get-item-by-id-auto-inherit
61-
    ✓ status code check (Response code 404 matches one of description codes: [200, 404])
61+
    ✓ status code check - $statusCode in [200, 404]
6262
    ✓ content-type check
6363
6464
✓ DELETE /items/{id} - step drop-item-auto-inherit
65-
    ✓ success criteria check
66-
    ✓ status code check (Response code 200 matches one of description codes: [200])
65+
    ✓ success criteria check - $statusCode == 200
66+
    ✓ status code check - $statusCode in [200]
6767
6868
6969
  Failed tests info:

__tests__/respect/mask-input-secrets/__snapshots__/mask-input-secrets.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ exports[`should hide sensitive input values 1`] = `
7272
       }
7373
      ]
7474
75-
    ✓ success criteria check
76-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
75+
    ✓ success criteria check - $statusCode == 200
76+
    ✓ status code check - $statusCode in [200, 400, 404]
7777
    ✓ content-type check
7878
    ✓ schema check
7979
@@ -211,7 +211,7 @@ exports[`should hide sensitive input values 1`] = `
211211
       }
212212
      ]
213213
214-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
214+
    ✓ status code check - $statusCode in [200, 400, 404]
215215
    ✓ content-type check
216216
    ✓ schema check
217217
@@ -254,9 +254,9 @@ exports[`should hide sensitive input values 1`] = `
254254
       "price": 0
255255
      }
256256
257-
    ✓ success criteria check
258-
    ✓ success criteria check
259-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
257+
    ✓ success criteria check - $statusCode == 201
258+
    ✓ success criteria check - $.name == 'Mermaid Treasure Identification and Ana...
259+
    ✓ status code check - $statusCode in [201, 400, 404]
260260
    ✓ content-type check
261261
    ✓ schema check
262262

__tests__/respect/outputs-access-syntax-variations/__snapshots__/outputs-access-syntax-variations.test.ts.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ exports[`should resolve outputs access syntax variations 1`] = `
6969
       }
7070
      ]
7171
72-
    ✓ success criteria check
73-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
72+
    ✓ success criteria check - $statusCode == 200
73+
    ✓ status code check - $statusCode in [200, 400, 404]
7474
    ✓ content-type check
7575
    ✓ schema check
7676
@@ -103,8 +103,8 @@ exports[`should resolve outputs access syntax variations 1`] = `
103103
       "confirmationCode": "ticket-general-e5e5c6-dce78"
104104
      }
105105
106-
    ✓ success criteria check
107-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
106+
    ✓ success criteria check - $statusCode == 201
107+
    ✓ status code check - $statusCode in [201, 400, 404]
108108
    ✓ content-type check
109109
    ✓ schema check
110110
@@ -242,7 +242,7 @@ exports[`should resolve outputs access syntax variations 1`] = `
242242
       }
243243
      ]
244244
245-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
245+
    ✓ status code check - $statusCode in [200, 400, 404]
246246
    ✓ content-type check
247247
    ✓ schema check
248248
@@ -281,10 +281,10 @@ exports[`should resolve outputs access syntax variations 1`] = `
281281
       "price": 0
282282
      }
283283
284-
    ✓ success criteria check
285-
    ✓ success criteria check
286-
    ✓ success criteria check
287-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
284+
    ✓ success criteria check - $statusCode == 201
285+
    ✓ success criteria check - $workflows.get-museum-hours.outputs.message == 'Mu...
286+
    ✓ success criteria check - $.name == 'Mermaid Treasure Identification and Ana...
287+
    ✓ status code check - $statusCode in [201, 400, 404]
288288
    ✓ content-type check
289289
    ✓ schema check
290290
@@ -316,9 +316,9 @@ exports[`should resolve outputs access syntax variations 1`] = `
316316
       "price": 60
317317
      }
318318
319-
    ✓ success criteria check
320-
    ✓ success criteria check
321-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
319+
    ✓ success criteria check - $workflows.events-crud.outputs.createdEventData#/p...
320+
    ✓ success criteria check - ^200$
321+
    ✓ status code check - $statusCode in [200, 400, 404]
322322
    ✓ content-type check
323323
    ✓ schema check
324324

__tests__/respect/reusable-components/__snapshots__/reusable-components.test.ts.snap

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
7070
       }
7171
      ]
7272
73-
    ✓ success criteria check
74-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
73+
    ✓ success criteria check - $statusCode == 200
74+
    ✓ status code check - $statusCode in [200, 400, 404]
7575
    ✓ content-type check
7676
    ✓ schema check
7777
@@ -140,8 +140,8 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
140140
       }
141141
      ]
142142
143-
    ✗ success criteria check
144-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
143+
    ✗ success criteria check - $statusCode == 201
144+
    ✓ status code check - $statusCode in [200, 400, 404]
145145
    ✓ content-type check
146146
    ✓ schema check
147147
@@ -213,8 +213,8 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
213213
       }
214214
      ]
215215
216-
    ✓ success criteria check
217-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
216+
    ✓ success criteria check - $statusCode == 200
217+
    ✓ status code check - $statusCode in [200, 400, 404]
218218
    ✓ content-type check
219219
    ✓ schema check
220220
@@ -354,7 +354,7 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
354354
       }
355355
      ]
356356
357-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
357+
    ✓ status code check - $statusCode in [200, 400, 404]
358358
    ✓ content-type check
359359
    ✓ schema check
360360
@@ -401,8 +401,8 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
401401
       "price": 0
402402
      }
403403
404-
    ✓ success criteria check
405-
    ✓ status code check (Response code 201 matches one of description codes: [201, 400, 404])
404+
    ✓ success criteria check - $statusCode == 201
405+
    ✓ status code check - $statusCode in [201, 400, 404]
406406
    ✓ content-type check
407407
    ✓ schema check
408408
@@ -475,8 +475,8 @@ exports[`should use inputs from CLI and env to mapp with resolved refs 1`] = `
475475
       }
476476
      ]
477477
478-
    ✓ success criteria check
479-
    ✓ status code check (Response code 200 matches one of description codes: [200, 400, 404])
478+
    ✓ success criteria check - $statusCode == 200
479+
    ✓ status code check - $statusCode in [200, 400, 404]
480480
    ✓ content-type check
481481
    ✓ schema check
482482

0 commit comments

Comments
 (0)