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
debug-tabs.py · 965 bytes · 26 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.goto('file:///Users/danq/dbbasic-web-native/test-tabs.html') |
| 7 | page.wait_for_timeout(1000) |
| 8 | |
| 9 | result = page.evaluate(''' |
| 10 | () => { |
| 11 | const tabs = document.querySelector('semantic-tabs'); |
| 12 | const tabItems = tabs.querySelectorAll('tab-item'); |
| 13 | const tabPanels = tabs.querySelectorAll('tab-panel'); |
| 14 | const tabList = tabs.shadowRoot.querySelector('.tab-list'); |
| 15 | const panelsContainer = tabs.shadowRoot.querySelector('.tab-panels'); |
| 16 | return { |
| 17 | tabItemsFound: tabItems.length, |
| 18 | tabPanelsFound: tabPanels.length, |
| 19 | tabListChildren: tabList.children.length, |
| 20 | panelsContainerChildren: panelsContainer.children.length |
| 21 | }; |
| 22 | } |
| 23 | ''') |
| 24 | |
| 25 | print(result) |
| 26 | browser.close() |