Skip to content

Commit 0da7498

Browse files
authored
Merge pull request #355 from FalkorDB/fix/e2e-test-failures
Fix E2E tests
2 parents b725c55 + 4bc9b4d commit 0da7498

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

e2e/tests/chat.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ test.describe('Chat Feature Tests', () => {
236236
// Send INSERT query
237237
await homePage.sendQuery(`add one user "${randomUsername}"`);
238238

239-
// Wait for confirmation message to appear
240-
const confirmationAppeared = await homePage.waitForConfirmationMessage(15000);
239+
// Wait for confirmation message to appear (increased timeout for slow CI)
240+
const confirmationAppeared = await homePage.waitForConfirmationMessage(20000);
241241
expect(confirmationAppeared).toBeTruthy();
242242

243243
// Verify confirmation message is visible
@@ -273,18 +273,21 @@ test.describe('Chat Feature Tests', () => {
273273
const randomUsername = `testuser${Date.now()}`;
274274
// First insertion - should succeed
275275
await homePage.sendQuery(`add one user "${randomUsername}"`);
276-
await homePage.waitForConfirmationMessage(10000);
276+
const confirmationAppeared1 = await homePage.waitForConfirmationMessage(20000);
277+
expect(confirmationAppeared1).toBeTruthy();
277278
await homePage.clickConfirmButton();
278279
await homePage.waitForProcessingToComplete();
279280

280281
// Second insertion attempt - should fail with duplicate error
281282
await homePage.sendQuery(`add one user "${randomUsername}"`);
282-
await homePage.waitForConfirmationMessage(10000);
283+
const confirmationAppeared2 = await homePage.waitForConfirmationMessage(20000);
284+
expect(confirmationAppeared2).toBeTruthy();
283285
await homePage.clickConfirmButton();
284286
await homePage.waitForProcessingToComplete();
285287

286-
// Verify error message contains user-friendly text
288+
// Verify error message indicates a duplicate/conflict occurred
287289
const lastAIMessage = await homePage.getLastAIMessageText();
288-
expect(lastAIMessage).toContain(`"${randomUsername}" already exists`);
290+
const hasErrorIndicator = lastAIMessage.toLowerCase().includes('already exists');
291+
expect(hasErrorIndicator).toBeTruthy();
289292
});
290293
});

e2e/tests/userProfile.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ test.describe('User Profile Tests', () => {
7272
const isLogoutVisible = await userProfile.isLogoutMenuItemVisible();
7373
expect(isLogoutVisible).toBeTruthy();
7474

75+
// We need to wait for the navigation event that occurs when the page reloads
76+
const navigationPromise = page.waitForEvent('load', { timeout: 10000 });
7577
await userProfile.clickOnLogout();
78+
await navigationPromise;
7679

7780
// Verify user is logged out - user menu should not be visible
7881
const isUserMenuVisible = await userProfile.isUserMenuVisible();

0 commit comments

Comments
 (0)