Skip to content

Use native WebDriver calls for mouse-related actions #126

Closed

Description

@aik099

I believe, that all mouse-related driver actions should involve actual mouse movements.

For example the ->click() does move the mouse, but the ->doubleclick() is just emulating the proper JS events but doesn't move the mouse.

This becomes a problem when there is a CSS :hover class that somehow changes the page behavior.

Current doubleclick code:

$script = 'Syn.dblclick({{ELEMENT}})';
$this->withSyn()->executeJsOnXpath($xpath, $script);

Proposed doubleclick code:

$this->wdSession->moveto(array(
    'element' => $this->wdSession->element('xpath', $xpath)->getID()
));

$this->wdSession->doubleclick();

Ideal test that be to make hovered element overlap some other element so it won't be visible anymore. Right now we emulate JS events and use JS to test that emulation passed. It's no wonder that we haven't seen such a problem for a long time.

Related issues:

Activity

  1. stof commented on Apr 10, 2014

    @stof
    Member

    @aik099 do you want to do it in the 1.x version of the driver or wait for 2.0 ?

  2. aik099 commented on Apr 10, 2014

    @aik099
    MemberAuthor

    I don't want to delay the Mink 1.6 release (which should be possible after you complete the Behat/Mink#467), so I can wait for Mink 1.6.1. It doesn't break BC after all.

  3. stof commented on Apr 10, 2014

    @stof
    Member

    @aik099 it would be for MinkSelenium2Driver 1.2 given the version number of the driver (or then 1.3 if we delay it)

  4. aik099 commented on Apr 10, 2014

    @aik099
    MemberAuthor

    But the tests for the driver goes to Mink repo. That's why I wrote Mink release version.

  5. aik099 commented on Apr 10, 2014

    @aik099
    MemberAuthor

    @stof , here is current situation:

    • I've fixed mouse events for MinkSelenium2Driver
    • the MinkSeleniumDriver is controlling browser using JavaScript, so I can't assert any CSS activities
    • I don't know what MinkSahiDriver is doing but I think it's in the same state as the MinkSeleniumDriver

    And the only driver that indeed uses window manager to control the mouse is the MinkSelenium2Driver.

  6. aik099 commented on Apr 14, 2014

    @aik099
    MemberAuthor

    Closing since all related PR's were merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions