Skip to content

Commit

Permalink
Don't pass x, y to test_driver_internal.click
Browse files Browse the repository at this point in the history
This is because the semantics are supposed to be defined by WebDriver,
and that doesn't allow setting the x,y coordinates for the click
command (you have to use Actions for that instead). Therefore
implementations are expected to compute the coordinates rather than
use passed-in values.

By the same argument we could remove the scrollIntoView and initial
check, since those just replicate checks WebDriver already does. Since
that comes with the possibility of timing changes it isn't included in
this change.
  • Loading branch information
jgraham committed Sep 11, 2024
1 parent 49e4115 commit 23d32be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions resources/testdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@
return Promise.reject(new Error("element click intercepted error"));
}

var rect = element.getClientRects()[0];
var centerPoint = getInViewCenterPoint(rect);
return window.test_driver_internal.click(element,
{x: centerPoint[0],
y: centerPoint[1]});
return window.test_driver_internal.click(element);
},

/**
Expand Down

0 comments on commit 23d32be

Please sign in to comment.