-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegistrationPage.py
30 lines (23 loc) · 1023 Bytes
/
RegistrationPage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from selenium.webdriver.common.by import By
from Config.config import TestData
from Pages.BasePage import BasePage
class RegistrationPage(BasePage):
"""finding elements By locators"""
MY_ACCOUNT_BUTTON = (By.ID, "menu-item-22")
USERNAME = (By.ID, "reg_email")
PASSWORD = (By.ID, "reg_password")
REGISTER_BUTTON = (By.NAME, "register")
HELLO = (By.XPATH, "//h1[@class='entry-title']")
def __init__(self, driver):
"""Constructor of the page class"""
super().__init__(driver)
self.driver.get(TestData.BASE_URL)
"""Page actions for registration"""
"""this is used to register new account on the website"""
def do_register(self, username, password):
self.do_click(self.MY_ACCOUNT_BUTTON)
self.do_send_keys(self.USERNAME, username)
self.do_send_keys(self.PASSWORD, password)
self.do_click(self.REGISTER_BUTTON)
def my_account_text_is_visible(self):
return self.is_visible(self.HELLO)