minkphp / MinkSelenium2Driver

Selenium2 (webdriver) driver for Mink framework
MIT License
507 stars 163 forks source link

dragTo should trigger mouseOver before drop #393

Open das-peter opened 4 months ago

das-peter commented 4 months ago

Just fiddled with the Drag n Drop testing and came across an issue when testing it with ExtJs e.g. https://docs.sencha.com/extjs/4.2.2/extjs-build/examples/tree/custom-drop-logic.html Dragging works fine - but dropping runs into nothing because the destination event isn't "ready". I think most dynamic libraries prepare the destination by listening to a hover event - which currently isn't triggered when dragging n droping. However, I think the native browser behavior indeed would trigger a mouse over before a drop event. Hence the added event before the button up.

Tested with:

Feature: DragNDropTest
    Scenario: DragNDropTest
        Given I go to "https://docs.sencha.com/extjs/4.2.2/extjs-build/examples/tree/custom-drop-logic.html"
        And I wait for "2" seconds
        And I drag "#treeview-1013-record-ext-record-1" to "#treeview-1017-record-ext-record-6 div"

Without the patch it fails, with the patch it works as expected.


Found that the mouseover / button up might cause the destination element to be stale. Added a re-fetch before the final event trigger to avoid that issue.