MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

Fixing clicking outside of a viewport issue

Open aik099 opened this issue 1 year ago • 2 comments

Using the moveto WebDriver command the Firefox will trigger an \WebDriver\Exception\MoveTargetOutOfBounds exception when the element is outside of the viewport:

Move target (194, 1001) is out of bounds of viewport dimensions (1550, 970)

The moveto command is used in these driver methods:

  • clickOnElement
    • click (does clickOnElement internally)
    • check (does clickOnElement internally)
    • uncheck (does clickOnElement internally)
    • setValue (checkboxes only; does clickOnElement internally)
  • mouseOver
    • rightClick (does mouseOver internally)
    • doubleClick (does mouseOver internally)

.

The test suite isn't testing mouse-related operations (listed above) outside of the viewport.

P.S.

  • The Chrome implementation of the moveto automatically adjusts the viewport.
  • Fixing idea taken from the https://github.com/minkphp/webdriver-classic-driver .

aik099 avatar Mar 02 '24 10:03 aik099

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.37%. Comparing base (a637df5) to head (b6823ea).

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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 02 '24 10:03 codecov[bot]