Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. from selenium.webdriver.common.by import By
  2. from pypom import Page
  3.  
  4. class LoginPage(Page):
  5.  
  6.     _email_locator = (By.NAME, 'email')
  7.     _password_locator = (By.NAME, 'password')
  8.     _login_locator = (By.CSS_SELECTOR, '.px-2')
  9.  
  10.     def click_login(self):
  11.         self.find_element(*self._login_locator).click()
  12.  
  13.     @property
  14.     def type_email(self, value):
  15.         self.find_element(*self._email_locator).send_keys(value)
  16.    
  17.     def type_password(self, value):
  18.         self.find_element(*self._password_locator).send_keys(value)
  19.    
  20.     def login(self, email, password):
  21.         self.type_email(email)
  22.         self.type_password(password)
  23.         self.click_login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement