-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
62 lines (50 loc) · 1.85 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import * as petTests from './tests/pet/mainPet.js';
import * as storeTests from './tests/store/mainStore.js';
import * as userTests from './tests/user/mainUser.js';
// create consolidated options set using imported options from tests
let scenarioCollection = {};
Object.entries(petTests.options.scenarios).forEach(item => scenarioCollection[item[0]] = item[1]);
Object.entries(storeTests.options.scenarios).forEach(item => scenarioCollection[item[0]] = item[1]);
Object.entries(userTests.options.scenarios).forEach(item => scenarioCollection[item[0]] = item[1]);
let thresholdsCollection = {};
Object.entries(petTests.options.thresholds).forEach(item => thresholdsCollection[item[0]] = item[1]);
Object.entries(storeTests.options.thresholds).forEach(item => thresholdsCollection[item[0]] = item[1]);
Object.entries(userTests.options.thresholds).forEach(item => thresholdsCollection[item[0]] = item[1]);
// options
export let options = {
scenarios: scenarioCollection,
thresholds: thresholdsCollection,
discardResponseBodies: true,
userAgent: 'k6',
}
// Setup code
export const setup = () =>
// Return collective data object
({
testStartTime: Date.now(),
});
// VU code ->
// tests -> pets
export const getFindByStatus = (data) => {
petTests.getFindByStatus(data);
}
export const addUpdateAndDeletePets = (data) => {
petTests.addUpdateAndDeletePets(data);
}
// tests -> Store
export const getStoreInventory = (data) => {
storeTests.getStoreInventory(data);
}
export const createUpdateAndDeleteOrder = (data) => {
storeTests.createUpdateAndDeleteOrder(data);
}
// tests -> user
export const getUserLogin = (data) => {
userTests.getUserLogin(data);
}
export const getUserLogout = (data) => {
userTests.getUserLogout(data);
}
export const createUpdateAndDeleteUsers = (data) => {
userTests.createUpdateAndDeleteUsers(data);
}