-
-
Save Jiveloper/7da9096d97733289e0cdecb3af359929 to your computer and use it in GitHub Desktop.
블로깅 WDIO 구축
This file contains 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 Page from './page'; | |
/** | |
* sub page containing specific selectors and methods for a specific page | |
*/ | |
class LoginPage extends Page { | |
/** | |
* define selectors using getter methods | |
*/ | |
get inputUsername() { | |
return $('#username'); | |
} | |
get inputPassword() { | |
return $('#password'); | |
} | |
get btnSubmit() { | |
return $('button[type="submit"]'); | |
} | |
/** | |
* a method to encapsule automation code to interact with the page | |
* e.g. to login using username and password | |
*/ | |
async login(username, password) { | |
await this.inputUsername.setValue(username); | |
await this.inputPassword.setValue(password); | |
await this.btnSubmit.click(); | |
await ( | |
await this.btnSubmit | |
).click; | |
} | |
/** | |
* overwrite specific options to adapt it to page object | |
*/ | |
open() { | |
return super.open('login'); | |
} | |
} | |
export default new LoginPage(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment