Skip to content

Instantly share code, notes, and snippets.

@SalmonMode
Last active September 12, 2019 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalmonMode/1ede19eba34bd1c25da4c6b0d7edd4c3 to your computer and use it in GitHub Desktop.
Save SalmonMode/1ede19eba34bd1c25da4c6b0d7edd4c3 to your computer and use it in GitHub Desktop.
class UsernameField(PageComponent):
_locator = (By.ID, "username")
class PasswordField(PageComponent):
_locator = (By.ID, "password")
class LoginForm(PageComponent):
_locator = (By.ID, "login-form)
username = UsernameField()
password = PasswordField()
def fill_out(self, credentials: Credentials):
self.username = credentials.username
self.password = credentials.password
class LoginPage(Page):
login_form = LoginForm()
def login(self, credentials: Credentials):
self.login_form.fill_out(credentials)
self.login_form.submit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment