Skip to content

Commit 517de59

Browse files
committed
fix: ensure sessions appear in list before tests proceed
- Add wait for session to appear in session list after creation - Prevents race condition where tests navigate away before session syncs - Should fix the remaining 2 failing tests (activity monitoring and terminal interaction) - Import waitForSessionCard dynamically to avoid circular dependencies
1 parent 5c76a8d commit 517de59

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

web/src/test/playwright/helpers/test-data-manager.helper.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ export class TestSessionManager {
7979
);
8080
} else {
8181
console.log('Created web session which should appear in the session list');
82+
83+
// For web sessions, ensure it appears in the session list before returning
84+
// This prevents race conditions when tests navigate away immediately
85+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
86+
87+
// Import the helper function
88+
const { waitForSessionCard } = await import('./test-optimization.helper');
89+
90+
try {
91+
await waitForSessionCard(this.page, name, { timeout: 20000 });
92+
console.log(`Session ${name} confirmed to be in session list`);
93+
} catch (error) {
94+
console.error(`Session ${name} did not appear in session list within timeout`);
95+
// Continue anyway - the session was created successfully
96+
}
8297
}
8398

8499
return { sessionName: name, sessionId };

0 commit comments

Comments
 (0)