Nacre/tests/hidden/web.txt
astar76 4eeb72a25a S045: YouTube plays after a real click in the hidden run; address field lets go when a page takes focus
The hidden click landed on <html> because YouTube keeps its main thread busy ~7 s after
load and swaps its skeleton for the player meanwhile; web.txt now clicks once the point
hits #movie_player. focus_page drops egui's text focus and attaches the view first; new
foreground web tabs, tab switches and new views use it. Selftest status gets ui_typing
and page_focused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 04:18:41 -06:00

36 lines
1.8 KiB
Text

# S045 hidden check (needs internet): Wikipedia under the chrome, YouTube plays after a real click (driver
# tests/hidden/web-driver.sh clicks with wl-input when the log says "click-video"), tabs open/switch/close.
wait 3
set /theme/mode "dark"
open https://en.wikipedia.org/wiki/Web_browser
waitload 60
wait 3
shot wiki-dark
assert document.querySelector('#firstHeading').textContent.includes('Web browser')
set /theme/mode "light"
wait 2
shot wiki-light
newtab https://www.youtube.com/watch?v=jNQXAC9IVRw
waitload 60
wait 8
shot yt-loaded
save yt-before JSON.stringify((()=>{const v=document.querySelector('video');return v&&{t:v.currentTime,p:v.paused,rs:v.readyState}})())
js window.__ev = []; for (const t of ['pointerdown', 'pointerup', 'click']) addEventListener(t, e => window.__ev.push(t + ':' + e.clientX + ',' + e.clientY + ':' + (e.target.className || e.target.tagName).toString().slice(0, 30)), true); true
# YouTube keeps the page's main thread busy for several seconds after load (software GL, ~7 s here) and swaps its
# skeleton for the real player meanwhile; a click in that window lands on <html>. Click once the player is hit.
waitfor 60 (()=>{const e=document.elementFromPoint(402,354);return !!e && !!e.closest('#movie_player')})()
log click-video
wait 4
waitfor 60 (()=>{const v=document.querySelector('video');return !!v && v.currentTime > 2})()
save yt-after JSON.stringify((()=>{const v=document.querySelector('video');return v&&{t:v.currentTime,p:v.paused,rs:v.readyState}})())
save clicks JSON.stringify([window.__ev, (()=>{const v=document.querySelector('video');return v&&[v.error&&v.error.code,v.networkState,v.src.slice(0,30)]})()])
shot yt-playing
status tabs
assert location.href.includes('jNQXAC9IVRw')
cmd select 0
wait 1
assert location.host.endsWith('wikipedia.org')
cmd close_tab
wait 1
status closed
quit