(e2e) fix some flaky tests

Some tests were flaky, causing them to fail
intermittently. This commit aims to address
this issue.
This commit is contained in:
Anthony LC
2025-03-31 12:14:20 +02:00
committed by Anthony LC
parent 65ddf7fbe8
commit 50b90f9ae7
3 changed files with 14 additions and 23 deletions

View File

@@ -2,7 +2,7 @@ import path from 'path';
import { expect, test } from '@playwright/test';
import { createDoc, verifyDocName } from './common';
import { createDoc } from './common';
const config = {
AI_FEATURE_ENABLED: true,
@@ -100,22 +100,13 @@ test.describe('Config', () => {
page,
browserName,
}) => {
const webSocketPromise = page.waitForEvent('websocket', (webSocket) => {
return webSocket.url().includes('ws://localhost:4444/collaboration/ws/');
});
await page.goto('/');
const randomDoc = await createDoc(
page,
'doc-collaboration',
browserName,
1,
);
void createDoc(page, 'doc-collaboration', browserName, 1);
await verifyDocName(page, randomDoc[0]);
const webSocket = await webSocketPromise;
const webSocket = await page.waitForEvent('websocket', (webSocket) => {
return webSocket.url().includes('ws://localhost:4444/collaboration/ws/');
});
expect(webSocket.url()).toContain('ws://localhost:4444/collaboration/ws/');
});