Skip to content

Instantly share code, notes, and snippets.

@sposterkil
Last active August 18, 2016 18:43
Show Gist options
  • Save sposterkil/20f23c19cb47ac267b918e5d186748aa to your computer and use it in GitHub Desktop.
Save sposterkil/20f23c19cb47ac267b918e5d186748aa to your computer and use it in GitHub Desktop.
Page Object Example
usersPage
.clickAddUserButton() // returns AddUserPage
.enterName("Sam Osterkil") // returns AddUserPage
.enterPassword("Password") // returns AddUserPage
.clickSubmit() // returns AddUserOutcome, which is just an object with "expectValid" and "expectError" methods
.expectValid() // returns UsersPage
.selectUserFromList("Sam Osterkil") // returns UsersPage
.clickEditUserButton() // returns EditUserPage
.enterPassword("") // returns EditUserPage
.clickSubmit() // returns EditUserOutcome, which is just an object with "expectValid" and "expectError" methods
.expectError("Password is required.") // returns EditUserPage
.enterPassword("newPassword") // returns EditUserPage
.clickSubmit() // returns EditUserOutcome, which is just an object with "expectValid" and "expectError" methods
.expectValid() // returns UsersPage
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment