@@ -319,7 +319,7 @@ class TestE2ESessionDemo:
319319 def test_01_dashboard_loads_with_session_metadata (self , demo_session , page ):
320320 """Dashboard shows topic, energy, and timer."""
321321 page .set_extra_http_headers ({"Authorization" : _auth_header ()})
322- page .goto (f"http://127.0.0.1:{ WEB_PORT } /session" )
322+ page .goto (f"http://127.0.0.1:{ WEB_PORT } /#study- session" )
323323 page .wait_for_load_state ("load" )
324324 page .wait_for_timeout (2000 )
325325
@@ -342,7 +342,7 @@ def test_01_dashboard_loads_with_session_metadata(self, demo_session, page):
342342 def test_02_activity_feed_shows_agent_topics (self , demo_session , page ):
343343 """SSE activity feed populates with topics logged by the mock agent."""
344344 page .set_extra_http_headers ({"Authorization" : _auth_header ()})
345- page .goto (f"http://127.0.0.1:{ WEB_PORT } /session" )
345+ page .goto (f"http://127.0.0.1:{ WEB_PORT } /#study- session" )
346346 page .wait_for_load_state ("load" )
347347
348348 # Wait for SSE to push activity items (poll every 2s)
@@ -359,7 +359,7 @@ def test_02_activity_feed_shows_agent_topics(self, demo_session, page):
359359 def test_03_counter_bar_tracks_wins_and_parked (self , demo_session , page ):
360360 """Counter bar shows wins and parked topic counts."""
361361 page .set_extra_http_headers ({"Authorization" : _auth_header ()})
362- page .goto (f"http://127.0.0.1:{ WEB_PORT } /session" )
362+ page .goto (f"http://127.0.0.1:{ WEB_PORT } /#study- session" )
363363 page .wait_for_load_state ("load" )
364364 page .wait_for_timeout (5000 )
365365
@@ -376,27 +376,29 @@ def test_03_counter_bar_tracks_wins_and_parked(self, demo_session, page):
376376 def test_04_terminal_iframe_loads_xterm (self , demo_session , page ):
377377 """Terminal panel shows an embedded ttyd xterm via the same-origin proxy."""
378378 page .set_extra_http_headers ({"Authorization" : _auth_header ()})
379- page .goto (f"http://127.0.0.1:{ WEB_PORT } /session" )
379+ page .goto (f"http://127.0.0.1:{ WEB_PORT } /#study- session" )
380380 page .wait_for_load_state ("load" )
381381 page .wait_for_timeout (3000 )
382382
383383 # Iframe should be visible with /terminal/ src
384- iframe = page .locator (".terminal-iframe" )
384+ iframe = page .locator (".terminal-panel" , has_text = "Agent Terminal" ).locator (
385+ ".terminal-iframe"
386+ )
385387 assert iframe .is_visible (), "Terminal iframe should be visible"
386388
387389 src = iframe .get_attribute ("src" )
388390 assert "/terminal/" in src , f"Iframe src should use proxy path, got: { src } "
389391
390392 # xterm should render inside the iframe
391- frame = page .frame_locator (".terminal-iframe" )
393+ frame = page .frame_locator (".terminal-iframe" ). first
392394 xterm = frame .locator (".xterm" )
393395 xterm .wait_for (timeout = 15000 )
394396 assert xterm .is_visible (), "xterm should be visible inside the proxied iframe"
395397
396398 def test_05_popout_and_return (self , demo_session , page , context ):
397399 """Pop-out opens terminal in new window; return closes it and re-embeds."""
398400 page .set_extra_http_headers ({"Authorization" : _auth_header ()})
399- page .goto (f"http://127.0.0.1:{ WEB_PORT } /session" )
401+ page .goto (f"http://127.0.0.1:{ WEB_PORT } /#study- session" )
400402 page .wait_for_load_state ("load" )
401403 page .wait_for_timeout (3000 )
402404
@@ -412,7 +414,9 @@ def test_05_popout_and_return(self, demo_session, page, context):
412414 new_page .wait_for_timeout (2000 )
413415
414416 # Placeholder should show in main page
415- placeholder = page .locator (".terminal-placeholder" )
417+ placeholder = page .locator (".terminal-panel" , has_text = "Agent Terminal" ).locator (
418+ ".terminal-placeholder"
419+ )
416420 assert placeholder .is_visible (), "Placeholder should show when terminal is popped out"
417421
418422 # Click "+" to return to inline — should close the pop-out
@@ -421,7 +425,9 @@ def test_05_popout_and_return(self, demo_session, page, context):
421425 page .wait_for_timeout (1000 )
422426
423427 # Iframe should be visible again
424- iframe = page .locator (".terminal-iframe" )
428+ iframe = page .locator (".terminal-panel" , has_text = "Agent Terminal" ).locator (
429+ ".terminal-iframe"
430+ )
425431 # CSS visibility check — element is in DOM but may have visibility:hidden
426432 assert iframe .is_visible (), "Iframe should be visible after returning from pop-out"
427433
0 commit comments