Created
December 9, 2016 18:38
-
-
Save gaggle/01d9b9f6f71a31789d03a5f8a656481d to your computer and use it in GitHub Desktop.
WebdriverIO page objects
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
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