ChromeDriverTest.testActionsMultiTouchPoint fails on Pixel 3
ChromeDriverTest.testActionsMultiTouchPoint fails on Pixel 3 because there is a rounding error, ChromeDriver log file shows that the touch action was dispatched to coordinate (60,60): [03-16-2020 15:03:49.094928][DEBUG]: DevTools WebSocket Command: Input.dispatchTouchEvent (id=29) 0 { "timestamp": -446703130, "touchPoints": [ { "force": 1.0, "id": 1, "radiusX": 1.0, "radiusY": 1.0, "rotationAngle": 0.0, "x": 60, "y": 60 } ], "type": "touchEnd" } But the resulting event had a slightly different coordinate: [03-16-2020 15:03:50.145445][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=32) 0 { "result": { "type": "object", "value": { "status": 0, "value": [ { "type": "touchstart", "x": 50, "y": 50 }, { "type": "touchstart", "x": 60.00000762939453, "y": 60.00000762939453 }, { "type": "touchend" }, { "type": "touchend" } ] } } } We should use assertAlmostEqual instead of assertEqual to just compare the integer part. The decimal part is because the coordinates transformation and conversion through the code pipeline. Bug chromedriver:3397 Change-Id: I3820338e94a9bcff6b5f4d4d180af01569915bfb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108903Reviewed-by:John Chen <johnchen@chromium.org> Commit-Queue: Lan Wei <lanwei@chromium.org> Cr-Commit-Position: refs/heads/master@{#751495}
Showing
Please register or sign in to comment