Skip to content

Instantly share code, notes, and snippets.

@alfredlucero
Created September 25, 2019 20:31
Show Gist options
  • Save alfredlucero/60457f069d898c20ebba7be5b09fd2d1 to your computer and use it in GitHub Desktop.
Save alfredlucero/60457f069d898c20ebba7be5b09fd2d1 to your computer and use it in GitHub Desktop.
WDIO Specific Page Object - STUI to Webdriver SG Blog
import Page from './page';
class SomePage extends Page {
get submitButton() {
return $("button[data-testid=submit]");
}
get tableRows() {
return $$("tbody > tr[data-testid=tableRow]");
}
// More getter selectors on the page
open() {
super.open("/some_page");
}
// Other helper functions that use the selectors above to interact with the page
// In the functions you can do things like this.submitButton.click();
}
export default new SomePage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment