Created
February 9, 2024 08:10
-
-
Save k1LoW/b908ae0721300ca45f4e8b81b6be246d to your computer and use it in GitHub Desktop.
testdata for runn (Single file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc: Login and get projects. | |
runners: | |
req: https://example.com/api/v1 | |
db: mysql://root:mypass@localhost:3306/testdb | |
vars: | |
username: alice | |
steps: | |
- | |
db: | |
query: SELECT * FROM users WHERE name = '{{ vars.username }}' | |
- | |
req: | |
/login: | |
post: | |
body: | |
application/json: | |
email: "{{ steps[0].rows[0].email }}" | |
password: "{{ steps[0].rows[0].password }}" | |
- | |
test: steps[1].res.status == 200 | |
- | |
req: | |
/projects: | |
headers: | |
Authorization: "token {{ steps[1].res.session_token }}" | |
get: | |
body: nil | |
- | |
test: steps[3].res.status == 200 | |
- | |
test: len(steps[3].res.projects) > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment