-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscreenshot.py
More file actions
25 lines (20 loc) · 866 Bytes
/
Copy pathscreenshot.py
File metadata and controls
25 lines (20 loc) · 866 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
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch()
# open a chat with user and assistant message and tool calls
# for simplicity, let's just use the current page
page = browser.new_page()
page.goto("http://localhost:5173/")
page.wait_for_timeout(2000)
# Click on the textarea, type some text, and send it
page.fill('textarea', 'Hello')
page.press('textarea', 'Enter')
page.wait_for_timeout(2000)
page.screenshot(path="/home/jules/verification/screenshots/screenshot_chat.png")
# Also open the settings to see it
page.goto("http://localhost:5173/")
page.wait_for_timeout(2000)
page.click('text=Settings')
page.wait_for_timeout(2000)
page.screenshot(path="/home/jules/verification/screenshots/screenshot_settings.png")
browser.close()