Files
kis_trader/scratch/playwright_test.py

22 lines
696 B
Python

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto("http://127.0.0.1:5050/")
# Click tail tab
page.click("a[data-tab='tail']")
page.wait_for_timeout(500)
# Check if tab-tail is visible
display = page.evaluate("window.getComputedStyle(document.getElementById('tab-tail')).display")
print("tab-tail display:", display)
# Dump HTML of tab-tail if display is block
if display == "block":
bounding_box = page.locator("#tab-tail").bounding_box()
print("tab-tail bounding box:", bounding_box)
browser.close()