Skip to content

Instantly share code, notes, and snippets.

@boatcoder
Created September 29, 2020 19:28
Show Gist options
  • Save boatcoder/4788d97d6fdb8b17af6107234ccd9d1b to your computer and use it in GitHub Desktop.
Save boatcoder/4788d97d6fdb8b17af6107234ccd9d1b to your computer and use it in GitHub Desktop.
Locators for the login page, these uniquely describe some element on the login page. You would need a set of these for each "page" in your site
class LoginPageLocators(object):
""" A class for login page locators. """
USERNAME = (By.XPATH, '//input[@data-test-id="login-username"]')
PASSWORD = (By.XPATH, '//input[@data-test-id="login-password"]')
LOGIN_BUTTON = (By.XPATH, '//button[@data-test-id="login-button"]')
LOGIN_ERROR_MESSAGE = (By.XPATH, '//div[@data-test-id="login-error"]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment