-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_dash_js.py
More file actions
26 lines (20 loc) · 909 Bytes
/
test_dash_js.py
File metadata and controls
26 lines (20 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from playwright.sync_api import sync_playwright
def run():
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
errors = []
page.on("pageerror", lambda err: errors.append(f"JS Exception: {err}"))
page.on("console", lambda msg: errors.append(f"Console {msg.type}: {msg.text}") if msg.type in ['error', 'warning'] else None)
print("Navigating to http://127.0.0.1:8050")
try:
page.goto("http://127.0.0.1:8050", wait_until="networkidle", timeout=10000)
print("Loaded. Waiting 2 seconds for callbacks...")
page.wait_for_timeout(2000)
except Exception as e:
print(f"Error navigating: {e}")
print("--- Browser Errors & Warnings ---")
for err in errors:
print(err)
browser.close()
run()