-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex04.js
55 lines (46 loc) · 1.15 KB
/
ex04.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
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
cloud: {
name: 'Exercicio 04',
projectID: 3716303
},
scenarios:{
usuarioDesocupado: {
executor: 'ramping-vus',
stages: [
{ target: 3 , duration: '5s'},
{ target: 3 , duration: '30s'},
{ target: 0 , duration: '5s'}
],
exec: 'desocupado'
},
usuarioJaCadastrado:{
executor: 'ramping-vus',
stages: [
{ target: 10 , duration: '1s'},
{ target: 0 , duration: '1s'}
],
exec: 'jaEUsuario',
startTime: '10s'
}
}
};
export function desocupado() {
http.get('http://165.227.93.41/lojinha-web/v2/');
sleep(1);
}
export function jaEUsuario() {
http.get('http://165.227.93.41/lojinha-web/v2/');
http.post(
'http://165.227.93.41/lojinha-web/v2/login/entrar',
{
usuario: 'admin',
senha: 'admin'
},
corpoDaRequestLogin,
opcoesDaRequestDoLogin
)
http.get('http://165.227.93.41/lojinha-web/v2/produto')
sleep(1);
}