Last active
October 20, 2018 17:30
-
-
Save rickschubert/2f512f96d49dbf08b05eef44636ff90e to your computer and use it in GitHub Desktop.
Standard page object pattern
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
// Login.page.js | |
class LoginPage { | |
get username() { return '#username' } | |
get password() { return '#password' } | |
get submit() { return '#login' } | |
login() { | |
browser.setValue(this.username, "R2D2") | |
browser.setValue(this.password, "c3po") | |
browser.click(this.submit) | |
} | |
} | |
export default new LoginPage() | |
// Inside test file | |
import LoginPage from "./pages/Login.page.js" | |
LoginPage.login() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment