From 4d59e0618415a1235cca6528ed10a1ee5d49f6a8 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 15 Apr 2025 16:10:49 +0200 Subject: [PATCH] test: fix flaky test (#180) Closes https://github.com/microsoft/playwright-mcp/issues/177 `ResizeObserver` isn't instant! --- tests/basic.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts index 13f5684..70ffa57 100644 --- a/tests/basic.spec.ts +++ b/tests/basic.spec.ts @@ -250,5 +250,5 @@ test('browser_resize', async ({ client }) => { }, }); expect(response).toContainTextContent('Resized browser window'); - expect(response).toContainTextContent('Window size: 390x780'); + await expect.poll(() => client.callTool({ name: 'browser_snapshot' })).toContainTextContent('Window size: 390x780'); });