From 0f9e351770d8ebbcc1ab389cac25b41360d54080 Mon Sep 17 00:00:00 2001 From: Hassy Veldstra Date: Tue, 19 Dec 2023 16:33:03 +0000 Subject: [PATCH] feat(playwright): track HTTP status codes (#2383) Track HTTP status codes via browser.page.codes. counters. --- packages/artillery-engine-playwright/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/artillery-engine-playwright/index.js b/packages/artillery-engine-playwright/index.js index c258d3d2e7..22a5baa5a6 100644 --- a/packages/artillery-engine-playwright/index.js +++ b/packages/artillery-engine-playwright/index.js @@ -96,7 +96,13 @@ class PlaywrightEngine { debug('page created'); + page.on('response', (response) => { + const status = response.status(); + events.emit('counter', 'browser.page.codes.' + status, 1); + }); + page.on('domcontentloaded', async (page) => { + if (!self.extendedMetrics) { return; }