Skip to content
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

Fix typing logic in the scripting integration tests #18862

Merged

Commits on Oct 6, 2024

  1. Fix typing logic in the scripting integration tests

    The default `page.type()` API from Puppeteer works for text fields that
    only dispatch a sandbox event on e.g. focus loss (i.e. after all
    characters have been inserted), and for those we can also use the
    default typing delay from Puppeteer instead of defining our own value.
    
    However, it doesn't work correctly for text fields where every character
    insertion dispatches a sandbox event. This is because processing the
    sandbox event takes some time and Puppeteer must wait for that before it
    can (safely) insert the next character. This commit therefore introduces
    a helper function to type a given value correctly in such text fields.
    
    Not only does this fix intermittent failures if our delay was too low
    for sandbox processing to complete, but it also speeds up the tests by
    eliminating our delays in places where they were (much) higher than
    necessary. In total the runtime of the scripting integration test suite
    goes from 137 seconds before this patch to 100 seconds after this patch.
    timvandermeij committed Oct 6, 2024
    Configuration menu
    Copy the full SHA
    1d4376c View commit details
    Browse the repository at this point in the history