Fixing clicking outside of a viewport issue#389
Open
aik099 wants to merge 1 commit intominkphp:masterfrom
Open
Fixing clicking outside of a viewport issue#389aik099 wants to merge 1 commit intominkphp:masterfrom
aik099 wants to merge 1 commit intominkphp:masterfrom
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. |
stof
reviewed
Jun 26, 2024
| { | ||
| $this->executeJsOnElement( | ||
| $element, | ||
| "arguments[0].scrollIntoView({ behavior: 'instant', block: 'end', inline: 'nearest' });" |
Member
There was a problem hiding this comment.
shouldn't we use nearest as well in the block direction ?
Member
Author
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
Member
Author
|
Not merging yet, because I think we need to add a missing test in driver-testsuite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.