bouncer/misc/k6/cadoles-loadtest.js
William Petit 734ed64e8e
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: add basic k6 load testing script
2024-03-25 15:40:25 +01:00

29 lines
595 B
JavaScript

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();
}
}