Hi Alexander,
You're right. I was just happy to finally get it to work and frustrated
regarding the time it took for something trivial like triggering a double
click or simulating a drag.
I spent some time digging for the root cause. I also found this thread,
probably similar
problem: https://bugs.chromium.org/p/chromedriver/issues/detail?id=841 so
I'm not the only one
MCVE:
package //todo add package
import geb.spock.GebReportingSpec
class visExampleTest extends GebReportingSpec {
def "dragging vis-js module"() {
given:
go "http://visjs.org/examples/timeline/interaction/animateWindow.html"
waitFor{ $(".vis-item-content").first().displayed }
def visModule = $(".vis-item-content").first()
def xCoordinate = visModule.getX()
when:
// I select and then drag the module 100 pixels right
visModule.click()
waitFor{ $(".vis-drag-center").displayed }
def draggable = $(".vis-drag-center")
interact{
clickAndHold(draggable)
moveByOffset(100, 0)
//Uncomment next line to get it to work with chrome
//moveByOffset(100, 0)
release()
}
then:
// the first visModule should've moved
xCoordinate != visModule.getX()
}
def "double clicking test"() {
given:
go "https://unixpapa.com/js/testmouse-2.html"
waitFor{ $("#link").displayed }
def clickable = $("#link")
when:
interact{
doubleClick(clickable)
}
println("browser ID: " + $("body > tt").text())
println("action log: " + $("body > table > tbody > tr > td:nth-child(1)
> form > textarea").value())
sleep(10000)
then:
true
}
}
So, for me, on mac, the output for the double click test was:
chrome:
browser ID: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/
537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
action log: mousedown which=1 button=0 buttons=1
mouseup which=1 button=0 buttons=0
click which=1 button=0 buttons=0
dblclick which=1 button=0 buttons=0
(the stated browser ID (recognized by the test website) confuses me. But
it's equal to the browser ID when I navigate to the website via my Mac with
chrome installed)
firefoxdriver:
browser ID: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:64.0) Gecko/
20100101 Firefox/64.0
action log: mousedown which=1 button=0 buttons=1
mouseup which=1 button=0 buttons=0
click which=1 button=0 buttons=0
mousedown which=1 button=0 buttons=1
mouseup which=1 button=0 buttons=0
click which=1 button=0 buttons=0
dblclick which=1 button=0 buttons=0
I'm a junior developer and new to the OS community. I'm kinda unsure where
the exact fault lies and what would be the best place to share this
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/63017109-ad6a-48fb-8c37-5b5370268d5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.