-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_pause_fix.py
More file actions
40 lines (32 loc) · 1.14 KB
/
verify_pause_fix.py
File metadata and controls
40 lines (32 loc) · 1.14 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import time
from playwright.sync_api import sync_playwright
def run(playwright):
browser = playwright.chromium.launch(headless=True)
page = browser.new_page()
try:
page.goto("http://localhost:5173/")
time.sleep(5) # Wait for the demo to load
# 1. Click to start the game
page.locator("#demo-screen").click()
time.sleep(1)
# 2. Press ESC to pause
page.keyboard.press("Escape")
time.sleep(1)
# 3. Press ESC again to return to demo
page.keyboard.press("Escape")
time.sleep(1)
# 4. Take a screenshot to verify the fix
page.screenshot(path="verify_pause_fix.png")
print("Screenshot taken.")
# Check if pause screen is hidden
pause_screen_is_hidden = page.locator("#pause-screen").is_hidden()
if pause_screen_is_hidden:
print("SUCCESS: Pause screen is hidden.")
else:
print("FAILURE: Pause screen is still visible.")
except Exception as e:
print(f"An error occurred: {e}")
finally:
browser.close()
with sync_playwright() as playwright:
run(playwright)