Skip to content

Instantly share code, notes, and snippets.

@k1LoW
Created February 9, 2024 08:10
Show Gist options
  • Save k1LoW/b908ae0721300ca45f4e8b81b6be246d to your computer and use it in GitHub Desktop.
Save k1LoW/b908ae0721300ca45f4e8b81b6be246d to your computer and use it in GitHub Desktop.
testdata for runn (Single file)
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