k6-cucumber-steps 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +17 -0
- package/.env.example +17 -0
- package/.github/workflows/k6-load-test.yml +35 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +10 -0
- package/LICENSE +21 -0
- package/README.md +179 -0
- package/assets/k6-cucumber-report.png +0 -0
- package/assets/paschal logo (2).png +0 -0
- package/cucumber.js +26 -0
- package/generateReport.js +24 -0
- package/libs/helpers/buildK6Script.js +94 -0
- package/libs/helpers/generateHeaders.js +29 -0
- package/libs/helpers/resolveBody.js +55 -0
- package/libs/utils/k6Runner.js +71 -0
- package/package.json +60 -0
- package/reports/load-results.json +231 -0
- package/reports/report.html +1234 -0
- package/step_definitions/load_test_steps.js +130 -0
- package/step_definitions/world.js +13 -0
- package/temp/k6_script.js +27 -0
- package/tmp/k6_script_01d24b4b-b76e-45b1-a457-9668fb82d33a.js +32 -0
- package/tmp/k6_script_1438a7b8-37a7-4556-8da9-12e588e666da.js +32 -0
- package/tmp/k6_script_15971355-7bba-45c2-85a8-81899162beab.js +32 -0
- package/tmp/k6_script_32f4609f-8abb-4d48-9454-321bd66409eb.js +32 -0
- package/tmp/k6_script_42cd4c8b-dee1-4b23-997b-ca1b0b8aae34.js +32 -0
- package/tmp/k6_script_49e30b01-9631-4b7f-a2e9-f538bfdade19.js +31 -0
- package/tmp/k6_script_4c01eb2e-b7d2-4597-a146-a6990dd92853.js +32 -0
- package/tmp/k6_script_4d779cfb-0c34-472c-b5fe-85ceb25f2422.js +31 -0
- package/tmp/k6_script_4f00954e-7f02-4c0c-8a89-df8183266fac.js +32 -0
- package/tmp/k6_script_4f166411-c40b-44a9-9561-94ab8d4c97bd.js +32 -0
- package/tmp/k6_script_4fba8ca6-c90f-467e-bc49-15f30a8eae81.js +32 -0
- package/tmp/k6_script_5054b6db-ae03-453e-ad29-8b79869c17b7.js +32 -0
- package/tmp/k6_script_5d64d2e5-7cde-4313-969c-ca14c9178bff.js +32 -0
- package/tmp/k6_script_61db2aea-6187-4b51-b450-67f773c8050c.js +32 -0
- package/tmp/k6_script_6b6147df-69a8-4ed3-9479-0edd8a3e64cd.js +32 -0
- package/tmp/k6_script_6dda7a7d-dd36-4775-87f5-d0365715ae2b.js +32 -0
- package/tmp/k6_script_6fca496e-f9d3-47e6-b214-8b998b69e9c8.js +32 -0
- package/tmp/k6_script_7ca87434-af5c-4ecc-9a7e-0ce7ae5c05c3.js +32 -0
- package/tmp/k6_script_7ff302b6-5bfd-440d-a7e4-bf60cf3ec23b.js +31 -0
- package/tmp/k6_script_817f7c24-46a8-4c8e-8c8b-7d63ae8c90f9.js +32 -0
- package/tmp/k6_script_88b6b615-94b7-4af4-a05b-40439f73c38a.js +32 -0
- package/tmp/k6_script_8a9b2d06-fdf9-408b-98e6-4228e039f66b.js +32 -0
- package/tmp/k6_script_93acfc41-ce38-4363-8394-faf4568c62a7.js +33 -0
- package/tmp/k6_script_9424816a-7712-400d-80b1-235cf298b102.js +32 -0
- package/tmp/k6_script_a8ddb599-632f-4a05-9d6f-b99c93e7533f.js +32 -0
- package/tmp/k6_script_a9b18f14-bf36-4423-a706-1e132ff3cfda.js +32 -0
- package/tmp/k6_script_a9eb065f-d0b9-42b8-b4fa-90d9c67787a4.js +32 -0
- package/tmp/k6_script_aac9cc10-b5cd-4fd6-9ba7-ad37b55a5e0c.js +32 -0
- package/tmp/k6_script_ac7f2225-f35b-4330-aa95-ea7468d652ed.js +32 -0
- package/tmp/k6_script_acb5057c-60cc-47b3-b8aa-718912587694.js +32 -0
- package/tmp/k6_script_aecaaf81-a2e9-4342-a90b-3077eba3fdbe.js +32 -0
- package/tmp/k6_script_b054781a-fbe3-41ab-8a55-52c7923bb4e3.js +32 -0
- package/tmp/k6_script_b210e574-c636-4b1a-9245-f9d9ce9ba731.js +32 -0
- package/tmp/k6_script_b4abecc0-91a9-4dc4-8e40-480a31b7954e.js +32 -0
- package/tmp/k6_script_b5a61631-afe3-47c4-af92-40213c3afe1a.js +32 -0
- package/tmp/k6_script_b6c1de34-edde-4e1d-be3f-504147837617.js +32 -0
- package/tmp/k6_script_be52dc14-7325-4ba0-ba2c-125c1dffab0c.js +42 -0
- package/tmp/k6_script_c2dbe965-703c-4c8d-83f0-db2eb73b1ab3.js +32 -0
- package/tmp/k6_script_c2ecca4f-7a01-4560-9fe0-4a5184497482.js +33 -0
- package/tmp/k6_script_cd13c408-4d59-490a-b788-f2e69ab5aeac.js +32 -0
- package/tmp/k6_script_cde84f7c-9d97-4c51-a315-005af6463f40.js +33 -0
- package/tmp/k6_script_cfbf49b0-d50a-4e00-b0ee-c1f37ae101bc.js +32 -0
- package/tmp/k6_script_d0599a1d-7fe5-4a58-b1f7-571a9c586732.js +32 -0
- package/tmp/k6_script_d1cd0a14-dc18-4034-a859-cd8b30da7c68.js +32 -0
- package/tmp/k6_script_d2365925-9612-48b5-87e9-4ecd81212133.js +32 -0
- package/tmp/k6_script_d38531f2-a437-4117-a4d3-076a11f7dfa6.js +32 -0
- package/tmp/k6_script_d415abc5-41b3-4445-a8bf-9c13c3208c59.js +32 -0
- package/tmp/k6_script_d9a6e7f4-5b88-4fcf-90d8-0183a1b96608.js +32 -0
- package/tmp/k6_script_e70b4a0a-1d52-431c-92e1-a53fd6739dfc.js +32 -0
- package/tmp/k6_script_e7bc2c96-7603-468b-b4be-d609d3c2f6ce.js +32 -0
- package/tmp/k6_script_e9687b8a-7885-48e5-91ad-9dcd21acc401.js +32 -0
- package/tmp/k6_script_ee2c199b-643d-4a78-b8df-7319e02783c1.js +32 -0
- package/tmp/k6_script_fe495d2f-7943-4151-a7fe-004ad443083d.js +32 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const { Given, When, Then } = require("@cucumber/cucumber");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const resolveBody = require("../libs/helpers/resolveBody.js");
|
|
6
|
+
const buildK6Script = require("../libs/helpers/buildK6Script.js");
|
|
7
|
+
const generateHeaders = require("../libs/helpers/generateHeaders.js");
|
|
8
|
+
const { generateK6Script, runK6Script } = require("../libs/utils/k6Runner.js");
|
|
9
|
+
require("dotenv").config();
|
|
10
|
+
|
|
11
|
+
// Validate thresholds (e.g., "rate<0.01")
|
|
12
|
+
const validateThreshold = (threshold) => {
|
|
13
|
+
const regex = /^[\w{}()<>:]+[<>=]\d+(\.\d+)?$/;
|
|
14
|
+
if (!regex.test(threshold)) {
|
|
15
|
+
throw new Error(`Invalid threshold format: ${threshold}`);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
Given("I have a k6 script for {word} testing", function (method) {
|
|
20
|
+
this.config = { method: method.toUpperCase() };
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
When(
|
|
24
|
+
"I run the k6 script with the following configurations:",
|
|
25
|
+
function (dataTable) {
|
|
26
|
+
const row = dataTable.hashes()[0];
|
|
27
|
+
|
|
28
|
+
// Validate thresholds only if they are not placeholders
|
|
29
|
+
const validateIfNotPlaceholder = (value) => {
|
|
30
|
+
if (value && !/^<.*>$/.test(value)) {
|
|
31
|
+
validateThreshold(value);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
validateIfNotPlaceholder(row.http_req_failed);
|
|
36
|
+
validateIfNotPlaceholder(row.http_req_duration);
|
|
37
|
+
validateIfNotPlaceholder(row.error_rate);
|
|
38
|
+
|
|
39
|
+
if (row.stages) {
|
|
40
|
+
// User provided a stages definition (JSON array)
|
|
41
|
+
try {
|
|
42
|
+
this.config.options = {
|
|
43
|
+
stages: JSON.parse(row.stages),
|
|
44
|
+
thresholds: {
|
|
45
|
+
http_req_failed: [row.http_req_failed],
|
|
46
|
+
http_req_duration: [row.http_req_duration],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
} catch (err) {
|
|
50
|
+
throw new Error("Invalid stages JSON format.");
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
// Default to VUs and duration
|
|
54
|
+
this.config.options = {
|
|
55
|
+
vus: parseInt(row.virtual_users),
|
|
56
|
+
duration: `${row.duration}s`,
|
|
57
|
+
thresholds: {
|
|
58
|
+
http_req_failed: [row.http_req_failed],
|
|
59
|
+
http_req_duration: [row.http_req_duration],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (row.error_rate && !/^<.*>$/.test(row.error_rate)) {
|
|
65
|
+
this.config.options.thresholds.error_rate = [row.error_rate];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
When("the request headers are:", function (dataTable) {
|
|
70
|
+
const headers = {};
|
|
71
|
+
dataTable.hashes().forEach(({ Header, Value }) => {
|
|
72
|
+
headers[Header] = Value;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
this.config.headers = {
|
|
76
|
+
...this.config.headers, // preserve auth headers if set
|
|
77
|
+
...headers,
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
When("the following endpoint\\(s) is\\/are used:", function (docString) {
|
|
82
|
+
this.config.endpoints = docString
|
|
83
|
+
.trim()
|
|
84
|
+
.split("\n")
|
|
85
|
+
.map((line) => line.trim());
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
When(
|
|
89
|
+
"the following {word} body is used for {string}",
|
|
90
|
+
function (method, endpoint, docString) {
|
|
91
|
+
this.config.method = method.toUpperCase();
|
|
92
|
+
this.config.body = resolveBody(docString, process.env);
|
|
93
|
+
this.config.endpoint = endpoint;
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
When("the authentication type is {string}", function (authType) {
|
|
98
|
+
this.config.headers = generateHeaders(authType, process.env);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
Then(
|
|
102
|
+
"the API should handle the {word} request successfully",
|
|
103
|
+
{ timeout: 60000 }, // Increase timeout to 60 seconds
|
|
104
|
+
async function (method) {
|
|
105
|
+
// Normalize both values to uppercase for comparison
|
|
106
|
+
const expectedMethod = method.toUpperCase();
|
|
107
|
+
const actualMethod = this.config.method.toUpperCase();
|
|
108
|
+
|
|
109
|
+
if (actualMethod !== expectedMethod) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
`Mismatched HTTP method: expected "${expectedMethod}", got "${actualMethod}"`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
try {
|
|
116
|
+
// Generate the k6 script content
|
|
117
|
+
const scriptContent = buildK6Script(this.config);
|
|
118
|
+
|
|
119
|
+
// Generate the temporary k6 script file
|
|
120
|
+
const scriptPath = generateK6Script(scriptContent);
|
|
121
|
+
|
|
122
|
+
// Run the k6 script and capture the output
|
|
123
|
+
const stdout = await runK6Script(scriptPath);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error("k6 execution failed:", error.message);
|
|
126
|
+
console.error("k6 stderr:", error.stderr); // Log stderr for debugging
|
|
127
|
+
throw new Error("k6 test execution failed");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { setWorldConstructor } = require('@cucumber/cucumber');
|
|
2
|
+
|
|
3
|
+
class CustomWorld {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.options = {};
|
|
6
|
+
this.configurations = {};
|
|
7
|
+
this.endpoints = [];
|
|
8
|
+
this.authType = '';
|
|
9
|
+
this.postBody = {};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
setWorldConstructor(CustomWorld);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import http from "k6/http";
|
|
2
|
+
import { check, group } from "k6";
|
|
3
|
+
import { sleep } from "k6";
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
vus: undefined,
|
|
7
|
+
duration: "3",
|
|
8
|
+
thresholds: {
|
|
9
|
+
"http_req_failed": "rate<0.05",
|
|
10
|
+
"http_req_duration": "p(95)<1000"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function () {
|
|
15
|
+
|
|
16
|
+
group("Request 1: /api/v1/delete-record", function () {
|
|
17
|
+
const res = http.delete("/api/v1/delete-record", null, {
|
|
18
|
+
headers: {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
check(res, {
|
|
23
|
+
"status is 200": (r) => r.status === 200,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
sleep(1);
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<5000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 100,
|
|
7
|
+
"duration": "15s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 50,
|
|
7
|
+
"duration": "10s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const res0 = http.request("GET", "/api/v1/performance/appraisal/cycle/list", null, {
|
|
21
|
+
headers: {
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
"Authorization": "Bearer "
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
check(res0, {
|
|
27
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const res0 = http.request("GET", "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list", null, {
|
|
21
|
+
headers: {
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
check(res0, {
|
|
27
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 50,
|
|
7
|
+
"duration": "10s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 50,
|
|
7
|
+
"duration": "10s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<3000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<1000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import http from 'k6/http';
|
|
3
|
+
import { check } from 'k6';
|
|
4
|
+
|
|
5
|
+
export const options = {
|
|
6
|
+
"vus": 10,
|
|
7
|
+
"duration": "5s",
|
|
8
|
+
"thresholds": {
|
|
9
|
+
"http_req_failed": [
|
|
10
|
+
"rate<0.05"
|
|
11
|
+
],
|
|
12
|
+
"http_req_duration": [
|
|
13
|
+
"p(95)<5000"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function () {
|
|
19
|
+
|
|
20
|
+
const resolvedUrl0 = "https://runthrough-two.seamlesshrms.com/api/v1/performance/appraisal/cycle/list";
|
|
21
|
+
const res0 = http.request("GET", resolvedUrl0, null, {
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json",
|
|
24
|
+
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3J1bnRocm91Z2gtdHdvLnNlYW1sZXNzaHJtcy5jb20vYXBpL3YxL2F1dGgvbG9naW4iLCJpYXQiOjE3NDU2MjAwNDEsImV4cCI6MTc0NTYyMzY0MSwibmJmIjoxNzQ1NjIwMDQxLCJqdGkiOiJkQmZHZW9Takh3MlZ0NEF6Iiwic3ViIjoiMjI2IiwicHJ2IjoiYzIwM2QyYmJmODZhN2IyNzcyZWUyNGNhODIyNzBmOTA5NTgyZjg3YyJ9.WGdq8QMpSZvCJB6cj0hn3xrUIfhIbOE4Ft4bo8u1JKw"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
check(res0, {
|
|
28
|
+
"status is 2xx": (r) => r.status >= 200 && r.status < 300
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|