@@ -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} ) ;
0 commit comments