Skip to content

Commit d2e6ed2

Browse files
committed
Fix E2E tests
1 parent 0da7498 commit d2e6ed2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

e2e/tests/chat.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,12 @@ test.describe('Chat Feature Tests', () => {
230230
// Ensure database is connected
231231
await homePage.ensureDatabaseConnected(apiCall);
232232

233-
// Generate random username to avoid conflicts
233+
// Generate random username and email to avoid conflicts
234234
const randomUsername = `testuser${Date.now()}`;
235+
const randomEmail = `${randomUsername}@test.com`;
235236

236237
// Send INSERT query
237-
await homePage.sendQuery(`add one user "${randomUsername}"`);
238+
await homePage.sendQuery(`add one user "${randomUsername}" with email "${randomEmail}"`);
238239

239240
// Wait for confirmation message to appear (increased timeout for slow CI)
240241
const confirmationAppeared = await homePage.waitForConfirmationMessage(20000);
@@ -271,15 +272,17 @@ test.describe('Chat Feature Tests', () => {
271272
// Ensure database is connected
272273
await homePage.ensureDatabaseConnected(apiCall);
273274
const randomUsername = `testuser${Date.now()}`;
275+
const randomEmail = `${randomUsername}@test.com`;
276+
274277
// First insertion - should succeed
275-
await homePage.sendQuery(`add one user "${randomUsername}"`);
278+
await homePage.sendQuery(`add one user "${randomUsername}" with email "${randomEmail}"`);
276279
const confirmationAppeared1 = await homePage.waitForConfirmationMessage(20000);
277280
expect(confirmationAppeared1).toBeTruthy();
278281
await homePage.clickConfirmButton();
279282
await homePage.waitForProcessingToComplete();
280283

281284
// Second insertion attempt - should fail with duplicate error
282-
await homePage.sendQuery(`add one user "${randomUsername}"`);
285+
await homePage.sendQuery(`add one user "${randomUsername}" with email "${randomEmail}"`);
283286
const confirmationAppeared2 = await homePage.waitForConfirmationMessage(20000);
284287
expect(confirmationAppeared2).toBeTruthy();
285288
await homePage.clickConfirmButton();

0 commit comments

Comments
 (0)