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 the "Text selection using mouse doesn't jump when hovering on an empty area in a single page" integration test #18923

Merged

Conversation

timvandermeij
Copy link
Contributor

The getSpanRectFromText helper function returns the location as float values. This could be desirable in cases where the exact values matter (for example during comparisons), but in the text layer tests we don't need this precision. Moreover, the Puppeteer page.mouse.move API apparently doesn't work correctly if float values are given as input.

Note that this test only failed because it couldn't move to the initial selection position; any subsequent moves actually worked because the moveInSteps helper function already rounded all values correctly.

This commit fixes the issue by consistently rounding all values that we pass to Puppeteer's page.mouse.move API.

Fixes #18774.

@timvandermeij
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/ce5b434f00d4001/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/acc10694e51dd8f/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/ce5b434f00d4001/output.txt

Total script time: 9.21 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/acc10694e51dd8f/output.txt

Total script time: 20.23 mins

  • Integration Tests: Passed

…empty area in a single page" integration test

The `getSpanRectFromText` helper function returns the location as float
values. This could be desirable in cases where the exact values matter
(for example during comparisons), but in the text layer tests we don't
need this precision. Moreover, the Puppeteer `page.mouse.move` API
apparently doesn't work correctly if float values are given as input.

Note that this test only failed because it couldn't move to the initial
selection position; any subsequent moves actually worked because the
`moveInSteps` helper function already rounded all values correctly.

This commit fixes the issue by consistently rounding all values that we
pass to Puppeteer's `page.mouse.move` API.
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@timvandermeij timvandermeij merged commit 17419de into mozilla:master Oct 20, 2024
8 checks passed
@timvandermeij timvandermeij deleted the integration-test-text-layer branch October 20, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants