| #!/bin/bash |
| |
| |
| |
| |
|
|
| source "$(dirname "$0")/common.sh" |
|
|
| |
| E2E_SERVER="http://pinchtab:9999" |
|
|
| |
| start_test "press Enter: does not type 'Enter' as text" |
|
|
| |
| pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/form.html\"}" |
| sleep 1 |
|
|
| |
| pt_post /action -d '{"kind":"type","selector":"#username","text":"testuser"}' |
| assert_ok "type into username" |
|
|
| |
| pt_post /action -d '{"kind":"press","key":"Enter"}' |
| assert_ok "press Enter" |
|
|
| |
| assert_input_not_contains "#username" "Enter" "Enter key should dispatch event, not type text (bug #236)" |
|
|
| end_test |
|
|
| |
| start_test "press Tab: does not type 'Tab' as text" |
|
|
| |
| pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/form.html\"}" |
| sleep 1 |
|
|
| |
| pt_post /action -d '{"kind":"click","selector":"#username"}' |
| pt_post /action -d '{"kind":"type","selector":"#username","text":"hello"}' |
| assert_ok "type hello" |
|
|
| |
| pt_post /action -d '{"kind":"press","key":"Tab"}' |
| assert_ok "press Tab" |
|
|
| |
| assert_input_not_contains "#username" "Tab" "Tab key should dispatch event, not type text (bug #236)" |
|
|
| end_test |
|
|
| |
| start_test "press Escape: does not type 'Escape' as text" |
|
|
| |
| pt_post /navigate -d "{\"url\":\"${FIXTURES_URL}/form.html\"}" |
| sleep 1 |
|
|
| |
| pt_post /action -d '{"kind":"type","selector":"#username","text":"world"}' |
| assert_ok "type world" |
|
|
| |
| pt_post /action -d '{"kind":"press","key":"Escape"}' |
| assert_ok "press Escape" |
|
|
| |
| assert_input_not_contains "#username" "Escape" "Escape key should dispatch event, not type text (bug #236)" |
|
|
| end_test |
|
|