Fixing clicking outside of a viewport issue - #389
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #389 +/- ##
============================================
+ Coverage 90.19% 90.37% +0.18%
- Complexity 168 169 +1
============================================
Files 1 1
Lines 469 478 +9
============================================
+ Hits 423 432 +9
Misses 46 46 ☔ View full report in Codecov by Sentry. |
| { | ||
| $this->executeJsOnElement( | ||
| $element, | ||
| "arguments[0].scrollIntoView({ behavior: 'instant', block: 'end', inline: 'nearest' });" |
There was a problem hiding this comment.
shouldn't we use nearest as well in the block direction ?
There was a problem hiding this comment.
I don't use the scrollIntoView method myself. I've only copied the whole line from the PHP WebDriver (see https://github.com/php-webdriver/php-webdriver/blob/11923b4ba312fc9d137266ae67438be65d4d500f/lib/Remote/RemoteWebElement.php#L249 ). I trust that they know what's right here.
b6823ea to
a65aa40
Compare
|
Not merging yet, because I think we need to add a missing test in driver-testsuite. |
Using the
movetoWebDriver command the Firefox will trigger an\WebDriver\Exception\MoveTargetOutOfBoundsexception when the element is outside of the viewport:The
movetocommand is used in these driver methods:clickOnElementclick(doesclickOnElementinternally)check(doesclickOnElementinternally)uncheck(doesclickOnElementinternally)setValue(checkboxes only; doesclickOnElementinternally)mouseOverrightClick(doesmouseOverinternally)doubleClick(doesmouseOverinternally).
The test suite isn't testing mouse-related operations (listed above) outside of the viewport.
P.S.
movetoautomatically adjusts the viewport.