1234567891011121314151617181920212223242526272829303132 |
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.by import By
- class page_main():
- item_purple_circle_xpath = "//*[@id='__next']/div/div[3]/div[1]/div[3]/div/div/div"
- button_sign_yourself_id = "Task-AddTask-SignYourself"
- tab_completed_xpath = "//*[@id='__next']/div/div[2]/div/div[3]/div[1]"
- option_latest_task_xpath = "//*[@id='__next']/div/div[3]/div[1]/div[2]/div/div[1]/div[1]"
- def __init__(self,driver,wait):
- self.driver = driver
- self.wait = wait
- def wait_purple_circle(self):
- self.wait.until(EC.element_to_be_clickable((By.XPATH, self.item_purple_circle_xpath)))
- def click_purple_circle(self):
- self.driver.find_element_by_xpath(self.item_purple_circle_xpath).click()
- def wait_sign_yourself_button(self):
- self.wait.until(EC.element_to_be_clickable((By.ID, self.button_sign_yourself_id)))
- def click_sign_yourself_button(self):
- self.driver.find_element_by_id(self.button_sign_yourself_id).click()
- def wait_completed_tab(self):
- self.wait.until(EC.element_to_be_clickable((By.XPATH, self.tab_completed_xpath)))
- def click_completed_tab(self):
- self.driver.find_element_by_xpath(self.tab_completed_xpath).click()
- def wait_latest_task_option(self):
- self.wait.until(EC.element_to_be_clickable((By.XPATH, self.option_latest_task_xpath)))
- def click_latest_task_option(self):
- self.driver.find_element_by_xpath(self.option_latest_task_xpath).click()
|