Skip to content

Instantly share code, notes, and snippets.

View Vmihajlovic's full-sized avatar

Viktor Mihajlovic Vmihajlovic

View GitHub Profile
import http from "k6/http";
import { check, group, sleep } from "k6";
import { Counter, Rate, Trend } from "k6/metrics";
import { randomSeed } from 'k6';
const loginData = JSON.parse(open("./users.json")); // download the data file here: https://test.k6.io/static/examples/users.json
/* Options
Global options for your script
stages - Ramping pattern
thresholds - pass/fail criteria for the test
/*
A simple script meant to be used with `k6 run` when doing a product walkthrough.
Handy for showing how debugging works from the command line.
e.g. `k6 run simpleDemo.js -i 1 -u1 --http-debug`
*/
import http from "k6/http";
import { sleep, check } from "k6";
import { Counter } from "k6/metrics";
import http from "k6/http";
import { sleep, check } from "k6";
import { Counter } from "k6/metrics";
export let options = {
stages: [
{ target: 10, duration: "30s" },
{ target: 20, duration: "30s" },
{ target: 0, duration: "30s" }
// Creator: k6 Browser Recorder 0.6.2
import { sleep, group } from "k6";
import http from "k6/http";
import { FormData } from "https://jslib.k6.io/formdata/0.0.1/index.js";
export const options = {};
export default function main() {
import http from 'k6/http';
export let options = {
vus: 5,
duration: "5s",
ext: {
loadimpact: {
projectID: 3537921, //3481255
name: "expected status",
distribution: {
import http from "k6/http";
import { check, group, sleep } from "k6";
import { Counter, Rate, Trend } from "k6/metrics";
import { randomIntBetween, randomItem } from "https://jslib.k6.io/k6-utils/1.0.0/index.js";
const loginData= JSON.parse(open("./users.json")); // download the data file here: https://test.k6.io/static/examples/users.json
/* Options
Global options for your script
stages - Ramping pattern
// Creator: k6 Browser Recorder 0.6.1
import { sleep, group } from "k6";
import http from "k6/http";
import {
randomIntBetween,
randomItem,
} from "https://jslib.k6.io/k6-utils/1.0.0/index.js";
export const options = { vus: 10, duration: "5m" };
// Creator: k6 Browser Recorder 0.6.1
import { sleep, group } from "k6";
import http from "k6/http";
import { randomIntBetween, randomItem } from "https://jslib.k6.io/k6-utils/1.0.0/index.js";
export const options = { vus: 10, duration: "5m" };
export default function main() {
let response;
import http from "k6/http";
import { check, group, sleep } from "k6";
import { Counter, Rate, Trend } from "k6/metrics";
const loginData = JSON.parse(open("./users.json")); // download the data file here: https://test.k6.io/static/examples/users.json
/* Options
Global options for your script
stages - Ramping pattern
thresholds - pass/fail criteria for the test
ext - Options used by Load Impact cloud service test name and distribution
*/
{
"users": [
{ "username": "admin", "password": "123" },
{ "username": "test", "password": "1234" },
{ "username": "invaliduser", "password": "password"}
]
}