Skip to content

HappyPathsOnly/K6-examples

Repository files navigation

K6-examples

This repository contains example k6 scripts based on a Udemy course. The scripts demonstrate various types of load testing and k6 features.

Structure

  • section1-intro/: Basic k6 script examples
  • Section2-k6-test-types/: Different types of load tests (smoke, load, stress, spike, soak, breakpoint)
  • Section3-creating-test-scripts/: Advanced scripting (custom metrics, tags, groups, aborting tests, scenarios, etc.)
  • Section4-BuildingAPIs/: Examples of making REST API calls with k6.
  • section5-env-and-data/: Using environment variables and reading external data.
  • section6-cloud/: Running tests in Grafana Cloud.
  • section7-cli-and-output/: Useful k6 CLI options and dashboard features.
  • section9-conclusions/: Browser testing and conclusions.

Running the Tests

  1. Install k6.
  2. Run a script using:
    k6 run path/to/script.js
    For example:
    k6 run Section3-creating-test-scripts/abort.js

Notes

  • Update URLs in scripts as needed for your environment.
  • Scripts are for educational purposes and can be adapted for real-world testing.

Additional Resources

About

Some K6 ideas from a Udemy course

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors