feat: add basic k6 load testing script
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
parent
c8fc143efa
commit
734ed64e8e
9
misc/k6/README.md
Normal file
9
misc/k6/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# K6 - Load Test
|
||||
|
||||
Very basic load testing script for [k6](https://k6.io/).
|
||||
|
||||
## How to run
|
||||
|
||||
```shell
|
||||
k6 run cadoles-loadtest.js
|
||||
```
|
29
misc/k6/cadoles-loadtest.js
Normal file
29
misc/k6/cadoles-loadtest.js
Normal file
@ -0,0 +1,29 @@
|
||||
import { check } from 'k6';
|
||||
import { browser } from 'k6/experimental/browser';
|
||||
|
||||
export const options = {
|
||||
scenarios: {
|
||||
browser: {
|
||||
vus: 10,
|
||||
iterations: 100,
|
||||
executor: 'shared-iterations',
|
||||
options: {
|
||||
browser: {
|
||||
type: 'chromium',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default async function () {
|
||||
const page = browser.newPage();
|
||||
try {
|
||||
await page.goto('https://www.cadoles.com');
|
||||
check(page, {
|
||||
'Homepage loaded': p => p.locator('h1').textContent().trim() == 'La liberté est un choix',
|
||||
});
|
||||
} finally {
|
||||
page.close();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user