Skip to content

Instantly share code, notes, and snippets.

@gaggle
Created December 9, 2016 18:38
Show Gist options
  • Save gaggle/01d9b9f6f71a31789d03a5f8a656481d to your computer and use it in GitHub Desktop.
Save gaggle/01d9b9f6f71a31789d03a5f8a656481d to your computer and use it in GitHub Desktop.
WebdriverIO page objects
class Page {
open(path = null) {
return browser.url(path || "/")
}
size(size) {
return browser.setViewportSize({
width: size.width,
height: size.height
})
}
}
class BlogPage extends Page {
open(path = null) {
return super.open(path || "/blog")
}
}
class HeaderPage extends Page {
get blog_link() {
return $(".blog > a")
}
get home_link() {
return $(".home > a")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment