Skip to content

Instantly share code, notes, and snippets.

@zachlendon
Created May 16, 2012 04:16
Show Gist options
  • Select an option

  • Save zachlendon/2707341 to your computer and use it in GitHub Desktop.

Select an option

Save zachlendon/2707341 to your computer and use it in GitHub Desktop.
MobileSpec
class MobileSpec extends GebReportingSpec {
@Shared
def isMobile = false
def setupSpec() {
if (getBrowser().driver instanceof RemoteWebDriver) {
RemoteWebDriver remoteWebDriver = getBrowser().driver
DesiredCapabilities capabilities = remoteWebDriver.getCapabilities()
if (["android", "iPhone", "iPad"].contains(capabilities.browserName)) {
isMobile = true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment