askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
test-modal-sizes-screenshot.py · 577 bytes · 16 lines
| 1 | from playwright.sync_api import sync_playwright |
| 2 | |
| 3 | with sync_playwright() as p: |
| 4 | browser = p.chromium.launch() |
| 5 | page = browser.new_page() |
| 6 | page.set_viewport_size({"width": 1440, "height": 900}) |
| 7 | page.goto('file:///Users/danq/dbbasic-web-native/test-modal-sizes.html') |
| 8 | page.wait_for_timeout(1000) |
| 9 | |
| 10 | # Open a modal to show in screenshot |
| 11 | page.click('#btn-details') |
| 12 | page.wait_for_timeout(500) |
| 13 | |
| 14 | page.screenshot(path='test-modal-sizes-screenshot.png', full_page=False) |
| 15 | browser.close() |
| 16 | print("Screenshot saved to test-modal-sizes-screenshot.png") |