Skip to content

Instantly share code, notes, and snippets.

@johnytiago
Last active March 31, 2020 15:51
Show Gist options
  • Save johnytiago/059bfd02abdc5f558434ba5c4d433143 to your computer and use it in GitHub Desktop.
Save johnytiago/059bfd02abdc5f558434ba5c4d433143 to your computer and use it in GitHub Desktop.
scenarios:
# Each virtual user created by Artillery will run one of the scenarios,
# randomly choosing one based on the weight attribute
- name: "Add song to an existing collection"
weight: 5
flow:
- get:
# Defined on ./helpers.js, sets env specific auth headers
beforeRequest: "setAuthorizationHeaders"
url: "/v1/collections"
qs:
userId: "{{ userId }}"
# Your can utilised captured variables inside the scenario or in helper functions
capture:
- json: "$.id"
as: "collectionId"
- get:
beforeRequest: "setAuthorizationHeaders"
url: "/v1/saved_songs"
qs:
userId: "{{ userId }}"
capture:
- json: "$.id"
as: "songId"
- post:
beforeRequest: "setAuthorizationHeaders"
url: "/v1/item_connections"
json:
songId: "{{ songId }}"
collectionId: "{{ collectionId }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment