Closed mvorisek closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.64%. Comparing base (
a3a5370
) to head (afa138b
).:exclamation: Current head afa138b differs from pull request most recent head 663bfb2. Consider uploading reports for the commit 663bfb2 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
is this something that could be covered by a test in the mink driver testsuite ?
is this something that could be covered by a test in the mink driver testsuite ?
probably by hiding the dragged element on dragstart
event, but not sure if it is worth doing so, I would call this an implementation detail
Well, if we don't have a test covering it, we risk regressing on that case. And if this is necessary to be compatible with the behavior of the draggable library of Shopify, it means there is a real-world use case for that, not just an implementation detail.
if this will imply the fix will be merged then, I can code the test
probably by hiding the dragged element on
dragstart
event
simply like this or use native https://github.com/Shopify/draggable lib? (about 100KB)
if we can do it with a simple implementation, it will be better for the driver testsuite IMO.
and yes, once we have tests for it, I would happily accept that patch.
@stof please merge, tested in https://github.com/minkphp/driver-testsuite/pull/59
I will then address https://github.com/minkphp/driver-testsuite/pull/59#issuecomment-1288109277 and https://github.com/minkphp/MinkSelenium2Driver/pull/354
How to skip the Behat\Mink\Tests\Driver\Js\JavascriptTest::testDragDropOntoHiddenItself
test on Selenium 2? Or any idea how to fix the driver for Selenium 2?
@mvorisek , Test skipping can be done in the \Behat\Mink\Tests\Driver\Selenium2Config::skipMessage
method.
The only purpose of the test you've mentioned (added by you) was to confirm, that code changes from this PR (added by you) will continue to work as expected.
Then, why do you need that test to be skipped?
In Selenium 3 (and with regular mouser/keyboard) the dragging works. In Selenium 2, it seems it does not, IDK why. Help welcomed. I did some experiments with Selenium 2 and it seems the dragging is not emulated well enough.
Please advise what to do and how to detect Selenium 2. Or how to fix Selenium 2 of course if you have an idea.
I've checked on Selenium 2 + Chrome and it works, but Selenium 2 + Firefox doesn't. Visually it looks like once the element is clicked without releasing a mouse button (to perform drag) it disappears somewhere and never drops back.
Maybe it is a bug in Selenium or geckodriver itself.
I've checked with different Firefox versions on Selenium 2 and :
I wish we could use the more recent browser versions on GitHub Actions. Maybe used docker image page can help in detecting what docker image version should get us desired Selenium Server + Firefox version: https://hub.docker.com/r/selenium/standalone-firefox .
@uuf6429 , do you know what tag of the selenium-firefox
Dockerimage needs to be used to get the Selenium 2 and modern Firefox version?
Tests for this PR are failing only because of outdated Firefox version usage in the Selenium Dockerimage.
The same test failure also occurs on the https://github.com/minkphp/webdriver-classic-driver/pull/27 .
@aik099 selenium/standalone-firefox:2
typically means "the latest selenium 2 with the latest firefox available at that time".
In other words, I don't think they are building images for with selenium 2 and updated firefox since they stopped maintaining selenium 2.
That being said, we could probably reverse engineer it (the docker layers are publicly readable) to have an up-to-date firefox.
@aik099
selenium/standalone-firefox:2
typically means "the latest selenium 2 with the latest firefox available at that time". In other words, I don't think they are building images for with selenium 2 and updated firefox since they stopped maintaining selenium 2.That being said, we could probably reverse engineer it (the docker layers are publicly readable) to have an up-to-date firefox.
If that can be done, then both Selenium-based drivers would benefit from this. I've created a #391 about this.
Merging, because test from the https://github.com/minkphp/driver-testsuite/pull/59 is already merged. Thanks @mvorisek .
This fixes dragging over itself, ie. source element = destination element, in such usecase, extra
WebDriver\Session::moveto()
call is redundant.Drag library like https://github.com/Shopify/draggable needs this fix as the source element is very often transformed when dragging and
WebDriver\Session::moveto()
is failing otherwise.also remove
Selenium2Driver::withSyn()
call as completely useless for dragging, the current impl. ofSelenium2Driver::dragTo()
does not use it