-
Notifications
You must be signed in to change notification settings - Fork 13
Add Playwright-based YouTube UI tests using Optics #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 28 commits
62e5d7d
c0823be
88d364d
aaac0f9
e9c11e9
270690a
7353be0
6111047
ee2a608
dd635a3
b158339
d50aead
6d5774e
a457b2b
0b40bf8
7397778
22eb817
bf6f6d1
097fa70
d942f13
99f6c1d
88b0329
92ee4fa
f4398a9
c591cf5
44a2baa
f01fe63
f6ec6aa
3937379
d21491e
f22edd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||||||||||||||||||||||
| import asyncio | ||||||||||||||||||||||||||
| import threading | ||||||||||||||||||||||||||
| from concurrent.futures import ThreadPoolExecutor, TimeoutError as FutureTimeoutError | ||||||||||||||||||||||||||
| from typing import Any, Coroutine | ||||||||||||||||||||||||||
| from optics_framework.common.logging_config import internal_logger | ||||||||||||||||||||||||||
| from optics_framework.common.error import OpticsError, Code | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| _persistent_loop: asyncio.AbstractEventLoop | None = None | ||||||||||||||||||||||||||
| _loop_thread: threading.Thread | None = None | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| from typing import Any, Coroutine | |
| from optics_framework.common.logging_config import internal_logger | |
| from optics_framework.common.error import OpticsError, Code | |
| _persistent_loop: asyncio.AbstractEventLoop | None = None | |
| _loop_thread: threading.Thread | None = None | |
| from typing import Any, Coroutine, Optional | |
| from optics_framework.common.logging_config import internal_logger | |
| from optics_framework.common.error import OpticsError, Code | |
| _persistent_loop: Optional[asyncio.AbstractEventLoop] = None | |
| _loop_thread: Optional[threading.Thread] = None |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| except RuntimeError: | |
| except RuntimeError: | |
| # No running event loop in this thread; this is expected and safe to ignore |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| except RuntimeError: | |
| except RuntimeError: | |
| # It's safe to ignore this: a RuntimeError here just means there is no | |
| # currently running event loop in this thread. We always use our own | |
| # persistent background loop below, so this probe is purely informational. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to get_text implementation adds fallback logic to use element_source.locate and driver.get_text_element. However, this code path lacks error handling. If either locate or get_text_element fails, it could raise an unhandled exception. Consider adding try-except blocks or null checks to handle cases where the element cannot be located or text cannot be retrieved.