Last active
April 5, 2018 15:21
-
-
Save bufferings/a8980ea515a893e21a3a95955ace5dc9 to your computer and use it in GitHub Desktop.
Hello Zelenium( https://dev.to/bufferings/tried-zalenium-to-run-selenium-tests-on-scalable-containers-2n7c )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.Platform; | |
import org.openqa.selenium.remote.BrowserType; | |
import org.openqa.selenium.remote.CapabilityType; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
driver = { | |
def capabilities = new DesiredCapabilities(); | |
capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX); | |
capabilities.setCapability(CapabilityType.PLATFORM_NAME, Platform.LINUX); | |
capabilities.setCapability("screenResolution", "1280x720"); | |
capabilities.setCapability("tz", "Asia/Tokyo"); | |
def remoteWebDriverUrl = new URL("http://localhost:4444/wd/hub") | |
new RemoteWebDriver(remoteWebDriverUrl, capabilities) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grapes([ | |
@Grab("org.gebish:geb-core:2.1"), | |
@Grab("org.seleniumhq.selenium:selenium-chrome-driver:3.11.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:3.11.0") | |
]) | |
import geb.Browser | |
Browser.drive { | |
go "http://gebish.org" | |
assert title == "Geb - Very Groovy Browser Automation" | |
$("div.menu a.manuals").click() | |
waitFor { !$("#manuals-menu").hasClass("animating") } | |
$("#manuals-menu a")[0].click() | |
assert title.startsWith("The Book Of Geb") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment