pdf.js/test/integration
Tim van der Meij 6e584adfc5
Use realistic typing delays for the scripting integration tests
In the scripting integration tests we use a few different typing
delays, mostly 100 or 200 milliseconds. According to for example
https://www.typingpal.com/en/documentation/school-edition/pedagogical-resources/typing-speed,
a fast typing speed is around 300 characters per minute, which is 5
characters per second and therefore a delay of 200 milliseconds between
each keystroke. Note that this is already above average, so in practice
the delay will be even larger. Therefore the 100 milliseconds variant
is unrealistically fast and therefore not suitable for the integration
tests which aim to simulate the average user behavior.

On top of that, the quick typing speeds are problematic for the tests
that involve validation alert dialogs appearing during typing. In those
tests a handler is registered to close the dialog once it pops up, but
it takes time for Puppeteer to notice the dialog, trigger the handler
and close it. If the typing delay, which is the delay between the key
down and key up events according to the Puppeteer source code at
https://github.com/puppeteer/puppeteer/blob/master/packages/puppeteer-core/src/cdp/Input.ts#L209-L215,
is too short, the key up event will be fired before the dialog is
closed. In that time the text box we're typing in is not focused, so
when the dialog is closed the `page.type()` call on the text box will
never resolve because the key up event never reached the text box.

This commit aims to fix the issues by converting all 100 millisecond
delays to 200 milliseconds. For instance the "must check input for US
zip format" failed pretty consistently locally before and hasn't failed
anymore with a 200 millisecond delay.
2023-09-24 15:47:21 +02:00
..
accessibility_spec.js Ignore null-chars when using structTree-data in the viewer 2023-08-31 16:29:10 +02:00
annotation_spec.js Make annotations focusable (bug 1851489) 2023-09-04 17:12:23 +02:00
copy_paste_spec.js [api-minor] Don't normalize the text used in the text layer. 2023-04-17 14:31:23 +02:00
find_spec.js XFA - Support text search in XFA documents. 2021-08-23 08:44:20 -07:00
freetext_editor_spec.js [Editor] The ::before containter containing the border of a selected editor mustn't catch mouse events (bug 1854818) 2023-09-23 23:53:19 +02:00
ink_editor_spec.js [Editor] Move an the editor div in the DOM once a translation with the keyboard is done 2023-08-08 21:02:05 +02:00
scripting_spec.js Use realistic typing delays for the scripting integration tests 2023-09-24 15:47:21 +02:00
stamp_editor_spec.js [Editor] Remove the stamp editor displayed when the image was loading (bug 1848313) 2023-08-11 16:46:23 +02:00
test_utils.js [Editor] Avoid to use parent of editors in destroyed pages 2023-09-07 12:30:29 +02:00