Skip to content

Instantly share code, notes, and snippets.

@morintd
Created July 6, 2024 20:44
Show Gist options
  • Save morintd/892f8d14d2d5b32c5fa78d086755b151 to your computer and use it in GitHub Desktop.
Save morintd/892f8d14d2d5b32c5fa78d086755b151 to your computer and use it in GitHub Desktop.
config:
environments:
gin:
target: "[GIN URL]"
nest:
target: "[NEST URL]"
processor: "./artillery-processor.js"
plugins:
expect: {}
scenarios:
- name: "create a new user and article flow"
flow:
- post:
url: "/auth/register"
beforeRequest: register
json:
email: "{{ email }}"
password: "{{ password }}"
expect:
- statusCode: 201
- post:
url: "/auth/login"
json:
email: "{{ email }}"
password: "{{ password }}"
expect:
- statusCode: 201
- post:
url: "/article"
beforeRequest: generateArticle
json:
title: "{{ title }}"
content: "{{ content }}"
expect:
- statusCode: 201
- get:
url: "/article?page=1"
expect:
- statusCode: 200
- get:
url: "/article?page=2"
expect:
- statusCode: 200
- get:
url: "/article?page=3"
expect:
- statusCode: 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment