mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2024-12-22 05:02:58 -05:00
Add integration testing
This commit is contained in:
parent
708b1ff883
commit
0628d99be2
1 changed files with 60 additions and 0 deletions
60
tests.yml
Normal file
60
tests.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
name: safetwitchApiTest
|
||||
|
||||
vars:
|
||||
url: http://localhost:8080
|
||||
# https://exozy.me/img/logo.avif
|
||||
imgUrlB64: aHR0cHM6Ly9leG96eS5tZS9pbWcvbG9nby5hdmlm
|
||||
testStreamerName: filian
|
||||
|
||||
testcases:
|
||||
- name: GET root
|
||||
steps:
|
||||
- type: http
|
||||
method: GET
|
||||
url: {{.url}}
|
||||
timeout: 5
|
||||
assertions:
|
||||
- result.statuscode ShouldEqual 200
|
||||
- result.bodyjson ShouldContainKey message
|
||||
- name: GET proxy endpoint
|
||||
steps:
|
||||
- type: http
|
||||
method: GET
|
||||
url: {{.url}}/proxy/img/{{.imgUrlB64}}
|
||||
timeout: 5
|
||||
assertions:
|
||||
- result.statuscode ShouldEqual 200
|
||||
- name: GET user
|
||||
steps:
|
||||
- type: http
|
||||
method: GET
|
||||
url: {{.url}}/api/users/{{.testStreamerName}}
|
||||
timeout: 5
|
||||
assertions:
|
||||
- result.statuscode ShouldEqual 200
|
||||
- result.timeseconds ShouldBeLessThan 1
|
||||
- result.bodyjson ShouldContainKey message
|
||||
- result.bodyjson.message ShouldContainKey pfp
|
||||
- result.bodyjson.message.username ShouldEqual {{.testStreamerName}}
|
||||
- name: GET categories
|
||||
steps:
|
||||
- type: http
|
||||
method: GET
|
||||
url: {{.url}}/api/discover
|
||||
timeout: 5
|
||||
assertions:
|
||||
- result.statuscode ShouldEqual 200
|
||||
- result.timeseconds ShouldBeLessThan 1
|
||||
- result.bodyjson ShouldContainKey message
|
||||
- result.bodyjson.message.message0.name ShouldNotBeNil
|
||||
- name: GET category
|
||||
steps:
|
||||
- type: http
|
||||
method: GET
|
||||
url: {{.url}}/api/discover/Just Chatting
|
||||
timeout: 5
|
||||
assertions:
|
||||
- result.statuscode ShouldEqual 200
|
||||
- result.timeseconds ShouldBeLessThan 1
|
||||
- result.bodyjson ShouldContainKey message
|
||||
- result.bodyjson.message.name ShouldEqual Just Chatting
|
Loading…
Reference in a new issue