# Input to web content (R4-05): a real click on a link, typing in a field, a right click, the wheel. Offline.
# Clicks go through the window's input path (App::window_input), as a user's would. Run with tools/smoke.sh.
# Layout of pages/input.html: link at y 20..50, field at y 70..100, context-menu box at y 120..180 (x 20..320),
# form field y 200..230, textarea y 250..280.
wait 3
open @PAGES@/input.html
waitload
wait 1
click 60 35
# The first click can take over a second to arrive in the hidden session (S050).
waitfor 5 window.clicks === 1 && location.hash === "#clicked"
click 60 85
wait 0.3
pagetype hello
wait 0.5
assert document.activeElement.id === "field" && document.getElementById("field").value === "hello"
click 60 215
pagetype abc{enter}
wait 1
assert window.submits === 1
click 60 265
pagetype x{enter}
wait 0.5
js JSON.stringify(window.keys)
assert JSON.stringify(window.keys) === '["x:88:Unidentified","Enter:13:Enter"]' || window.keys[1].startsWith("Enter:13")
rclick 60 150
wait 1
assert window.menus === 1
shot context-menu
status menu
key Escape
wait 0.5
pagescroll 200 400 600
wait 1
assert window.scrollY > 0
shot scrolled
status done
quit
