Home

Awesome

K6-Multi-Scenario-Template

It is a performance testing template that shows how to use K6 to implement a Multi Scenario template applying some best practices along some examples.

Getting Started

Clone the code, install K6 and run the k6_multi_scenario_executor.bat and watch the outcome. then learn the basics of K6, there are some code snippets for the main concepts (lifetime, VUs, Duration, checks, Thresholds, Stages, Executors, Scenarios). And once you are familiar with them, go and look the K6_multi_scenario_template.js file which is the k6 template, and modify it to match your SUT (System Under Test).

Features

The purpose of this project is to show how to put all the K6 techniques together while:

The BackendFlowTest and the BackendReadTest as well as the Setup have been taken from the 'Advanced API Flow' example, located at fabulous example section of k6.io, with some modifications. All the credit is theirs :)

Usage

To try it out, just open a command line with cmd.exe in windows in the root folder and type 'k6_multi_scenario_executor.bat' It should execute the smoke test which will run several scenarios:

Please note that https://rickandmortyapi.com/ is not meant for testing, so the usage in the code is limited to a single VU, so this does not cause a DOS attack to them. So, please, be kind.

Contribution

If you have an idea or suggestion, create an issue or, even better, implement it in a PR so we can improve it and add more functionality.

Community

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the Swiss Life OSS Code of Conduct.