Skip to content

Commit 2be8003

Browse files
committed
test: hand the e2e browser tests the tokened console URL
The web e2e tests navigated to a bare server URL, so with a token required the console loaded and then answered 401 on every API call, leaving no elements to assert on. The fixture now yields `console_url`, the same URL the server opens the browser with in production, and the new-run helper appends its fragment to a URL that already carries a query string.
1 parent 449f46f commit 2be8003

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

tests/e2e/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def live_server_url():
3434
Uses 'live_server_url' (not 'base_url') to avoid conflicting with the
3535
autouse session fixture from pytest-base-url, which would force the
3636
server to start even for non-web tests.
37+
38+
The URL carries this run's token, exactly as the server opens the browser
39+
in production, so it already ends with a query string.
3740
"""
3841
try:
3942
import uvicorn
@@ -67,7 +70,6 @@ def live_server_url():
6770
thread.start()
6871

6972
# Wait for server to be ready
70-
url = f"http://127.0.0.1:{port}"
7173
for _ in range(50):
7274
try:
7375
with socket.create_connection(("127.0.0.1", port), timeout=0.2):
@@ -77,7 +79,7 @@ def live_server_url():
7779
else:
7880
raise RuntimeError("Server did not start in time")
7981

80-
yield url
82+
yield server_obj.console_url
8183

8284
uv_server.should_exit = True
8385
thread.join(timeout=5)

tests/e2e/test_web_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def _wait_for_entrypoints(page: Page) -> None:
2222

2323
def _go_to_new_run(page: Page, url: str) -> None:
2424
"""Navigate to the new run page and wait for entrypoints."""
25-
page.goto(f"{url}/#/new")
25+
page.goto(f"{url}#/new")
2626
expect(page.locator("#entrypoint-select")).to_be_visible()
2727
_wait_for_entrypoints(page)
2828

0 commit comments

Comments
 (0)