Intermittent /web-platform/tests/webdriver/tests/perform_actions/pointer_tripleclick.py | test_tripleclick_at_coordinates - InvalidArgumentException: invalid argument (400): data did not match any variant of untagged enum PointerActionItem at line 1 colum
Categories
(Remote Protocol :: Marionette, defect)
Tracking
(firefox107 disabled, firefox108 fixed)
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
(Keywords: intermittent-failure)
Attachments
(1 file)
The test is currently marked as failing.
0:15.23 pid:59962 1664998111424 webdriver::server DEBUG -> POST /session/b90081eb-00cd-4201-874a-8e0b15be3d45/actions {"actions": [{"type": "pointer", "id": "pointer_id", "actions": [{"type": "pointerMove", "x": 400.0, "y": 27.0}, {"type": "pointerDown", "button": 0}, {"type": "pointerUp", "button": 0}, {"type": "pointerDown", "button": 0}, {"type": "pointerUp", "button": 0}, {"type": "pointerDown", "button": 0}, {"type": "pointerUp", "button": 0}], "parameters": {"pointerType": "mouse"}}]}
0:15.23 pid:59962 1664998111424 webdriver::server DEBUG <- 400 Bad Request {"value":{"error":"invalid argument","message":"data did not match any variant of untagged enum PointerActionItem at line 1 column 375","stacktrace":""}}
Assignee | ||
Comment 1•2 years ago
|
||
The problem here is the initial PointerMove
action which has the x
and y
values as floating points:
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/webdriver/tests/perform_actions/pointer_tripleclick.py#26
While the test converts the calculated center x
and y
values to int
we still have an addition with the original x
and y
position of the element, which results in a floating number again. Per spec the Pointer Move action requires an integer.
Now there is the question why Pointer Move
requires the position to be integers and not floating point values?
Comment 2•2 years ago
|
||
It requires them to be integers because we only allow integer coordinates (as per the definitions of the related events), and although e.g. 1.0
is probably fine, 1.5
isn't, so it's easier to check for non-integer values than make some "is close enough to an integer that we'll allow it" check.
Having said that Chrome does seem to pass this test: https://wpt.fyi/results/webdriver/tests/perform_actions/pointer_tripleclick.py?label=master&label=experimental&aligned&view=subtest&q=%2Fwebdriver%2Ftests%2Fperform_actions%2Fpointer_tripleclick.py It would be interesting to know what they're doing for conversion e.g. is it round
or floor
, or something else? We could change the spec to match if we think the current behaviour is too restrictive.
It's also possible that this is an unnecessary or unhelpful restriction in these days of high dpi displays where we can have multiple physical pixels per CSS pixel, in which case we should probably really allow floats. But that's definitely a WG discussion question.
Assignee | ||
Comment 3•2 years ago
|
||
Hi Maksim, could you maybe check James' question regarding Chrome? It would be good to know why Chrome currently passes this test. Thanks.
It looks like ChromeDriver implicitly casts x
and y
from double
to int
, which ends up with floor
ing them:
https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/window_commands.cc;drc=cedd38c9e15096e947a62529490a0fd84b743c3f;l=1117
Assignee | ||
Comment 5•2 years ago
|
||
Thanks Maksim! As such I would suggest that we update the test for now and call math.floor()
when calculating the x
and y
coordinates.
Note that with the above change the test still fails with Firefox:
0:22.73 INFO STDOUT: actual_text = session.execute_script("return document.getSelection().toString();")
0:22.73 INFO STDOUT:
0:22.73 INFO STDOUT: > assert lots_of_text == actual_text
0:22.73 INFO STDOUT: E AssertionError: assert ('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '\n 'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, '\n 'quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo '\n 'consequat.') == ''
0:22.73 INFO STDOUT: E + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
First I thought it's because of the browser.triple_click_selects_paragraph
preference but that's not the case. I'll file a follow-up bug to handle that case.
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Comment 7•2 years ago
|
||
(In reply to James Graham [:jgraham] from comment #2)
It's also possible that this is an unnecessary or unhelpful restriction in these days of high dpi displays where we can have multiple physical pixels per CSS pixel, in which case we should probably really allow floats. But that's definitely a WG discussion question.
I've filed https://github.com/w3c/webdriver/issues/1690 for the discussion.
Comment 10•2 years ago
|
||
bugherder |
Assignee | ||
Comment 12•2 years ago
|
||
This is fixed now.
Assignee | ||
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Description
•