@@ -497,7 +497,12 @@ test("Create session and verify it appears in auth-server sessions list", async
497497 await popup . getByTestId ( "connect" ) . click ( ) ;
498498 await page . waitForTimeout ( 2000 ) ;
499499 await expect ( page . getByText ( "Disconnect" ) ) . toBeVisible ( ) ;
500- console . log ( "✓ Account created" ) ;
500+
501+ // Capture the account address from the page
502+ const demoPageContent = await page . textContent ( "body" ) ;
503+ const accountMatch = demoPageContent ?. match ( / 0 x [ a - f A - F 0 - 9 ] { 40 } / ) ;
504+ const demoAccountAddress = accountMatch ? accountMatch [ 0 ] : "unknown" ;
505+ console . log ( `✓ Account created: ${ demoAccountAddress } ` ) ;
501506
502507 // Step 2: Create session
503508 console . log ( "\nStep 2: Creating session..." ) ;
@@ -576,20 +581,45 @@ test("Create session and verify it appears in auth-server sessions list", async
576581 // Navigate to sessions page
577582 await authPage . goto ( "http://localhost:3002/dashboard/sessions" ) ;
578583 await authPage . waitForLoadState ( "domcontentloaded" ) ;
579- await authPage . waitForTimeout ( 3000 ) ;
584+
585+ // Listen for console logs from the sessions page
586+ authPage . on ( "console" , ( msg ) => {
587+ if ( msg . text ( ) . includes ( "[sessions.vue]" ) ) {
588+ console . log ( ` Auth-server: ${ msg . text ( ) } ` ) ;
589+ }
590+ } ) ;
591+
580592 console . log ( "✓ Navigated to sessions page" ) ;
593+ console . log ( ` Demo account (created session): ${ demoAccountAddress } ` ) ;
581594
582595 // Verify sessions page content
583596 const header = authPage . locator ( "header" ) . getByText ( "Sessions" ) ;
584597 await expect ( header ) . toBeVisible ( ) ;
585598 console . log ( "✓ Sessions page loaded" ) ;
586599
600+ // Wait for sessions data to load - look for either session rows or the table/list container
601+ // The sessions are loaded via WASM asynchronously, so we need to wait
602+ try {
603+ // Wait for the sessions list container or session rows to appear
604+ await authPage . waitForSelector ( "table tbody tr, [role='list'] > div, [data-testid*='session']" , {
605+ timeout : 15000 ,
606+ state : "attached" ,
607+ } ) ;
608+ console . log ( "✓ Sessions data container loaded" ) ;
609+ } catch ( e ) {
610+ console . log ( "⚠ No sessions container appeared within 15s" , e ) ;
611+ }
612+
613+ // Additional wait to ensure console logs are captured
614+ await authPage . waitForTimeout ( 2000 ) ;
615+
587616 // Log page content for debugging
588617 const pageContent = await authPage . locator ( "main" ) . textContent ( ) ;
589618 console . log ( `Page content: ${ pageContent ?. substring ( 0 , 500 ) } ` ) ;
590619
591620 // Verify at least one session is displayed
592- const sessionRows = authPage . locator ( "[data-testid*='session']" ) ;
621+ // The session rows use class="session-row" in the SessionRow component
622+ const sessionRows = authPage . locator ( ".session-row" ) ;
593623 const sessionCount = await sessionRows . count ( ) ;
594624 console . log ( `Found ${ sessionCount } session row(s)` ) ;
595625
0 commit comments