From 09dc529b31006d803b3bc399728d3c5c86ae4a6b Mon Sep 17 00:00:00 2001 From: Yohan Lasorsa Date: Tue, 5 Mar 2024 10:20:16 +0000 Subject: [PATCH] test: fix playwright tests --- package-lock.json | 22 +++++++++++----------- tests/e2e/webapp.spec.ts | 9 +++++---- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f3c862e..4c8cc0e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3807,12 +3807,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.0.tgz", - "integrity": "sha512-2k1HzC28Fs+HiwbJOQDUwrWMttqSLUVdjCqitBOjdCD0svWOMQUVqrXX6iFD7POps6xXAojsX/dGBpKnjZctLA==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "dev": true, "dependencies": { - "playwright": "1.42.0" + "playwright": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -11812,12 +11812,12 @@ } }, "node_modules/playwright": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.0.tgz", - "integrity": "sha512-Ko7YRUgj5xBHbntrgt4EIw/nE//XBHOKVKnBjO1KuZkmkhlbgyggTe5s9hjqQ1LpN+Xg+kHsQyt5Pa0Bw5XpvQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "devOptional": true, "dependencies": { - "playwright-core": "1.42.0" + "playwright-core": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -11830,9 +11830,9 @@ } }, "node_modules/playwright-core": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.0.tgz", - "integrity": "sha512-0HD9y8qEVlcbsAjdpBaFjmaTHf+1FeIddy8VJLeiqwhcNqGCBe4Wp2e8knpqiYbzxtxarxiXyNDw2cG8sCaNMQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", "devOptional": true, "bin": { "playwright-core": "cli.js" diff --git a/tests/e2e/webapp.spec.ts b/tests/e2e/webapp.spec.ts index 44236f5a..80f9e242 100644 --- a/tests/e2e/webapp.spec.ts +++ b/tests/e2e/webapp.spec.ts @@ -124,11 +124,12 @@ test.describe('default', () => { await page.goto('/'); await page.getByTestId('default-question').nth(0).click(); - await page.route('/chat', (route) => + await page.route('/chat', async (route) => { + await new Promise((resolve) => setTimeout(resolve, 5000)); route.fulfill({ - status: -1, - }), - ); + status: 200, + }); + }); await expect(page.getByTestId('loading-indicator')).not.toBeVisible(); await page.getByTestId('submit-question-button').click();