2023-05-28 15:44:45 -05:00
|
|
|
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
|
2023-05-31 07:14:08 -05:00
|
|
|
- result.bodyjson ShouldContainKey data
|
2023-05-28 15:44:45 -05:00
|
|
|
- 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
|
2023-05-31 07:14:08 -05:00
|
|
|
- result.bodyjson ShouldContainKey data
|
|
|
|
- result.bodyjson.data ShouldContainKey pfp
|
|
|
|
- result.bodyjson.data.username ShouldEqual {{.testStreamerName}}
|
2023-05-28 15:44:45 -05:00
|
|
|
- name: GET categories
|
|
|
|
steps:
|
|
|
|
- type: http
|
|
|
|
method: GET
|
|
|
|
url: {{.url}}/api/discover
|
|
|
|
timeout: 5
|
|
|
|
assertions:
|
|
|
|
- result.statuscode ShouldEqual 200
|
|
|
|
- result.timeseconds ShouldBeLessThan 1
|
2023-05-31 07:14:08 -05:00
|
|
|
- result.bodyjson ShouldContainKey data
|
|
|
|
- result.bodyjson.data.data0.name ShouldNotBeNil
|
2023-05-28 15:44:45 -05:00
|
|
|
- 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
|
2023-05-31 07:14:08 -05:00
|
|
|
- result.bodyjson ShouldContainKey data
|
|
|
|
- result.bodyjson.data.name ShouldEqual Just Chatting
|