page_sign_and_send_assign.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from selenium.webdriver.support import expected_conditions as EC
  2. from selenium.webdriver.common.by import By
  3. import time
  4. class page_sign_and_send_assign():
  5. button_next_step_xpath = "//*[@id='__next']/div/div[1]/div[2]/div[4]"
  6. documemt_xpath = "//*[@id='pageContainer1']/div[2]/div"
  7. item_radio_button_xpath = "//*[@id='__next']/div/div[2]/div[1]/div/div[2]/div[5]"
  8. button_finish_id = "Edit-Field-Send-SignYourself"
  9. new_functions_introduction_xpath = "//*[@id='modal-body-scrollable']/div[3]/div[1]/div"
  10. def __init__(self,driver,wait):
  11. self.driver = driver
  12. self.wait = wait
  13. def wait_radio_button_item(self):
  14. self.wait.until(EC.element_to_be_clickable((By.XPATH, self.item_radio_button_xpath)))
  15. def click_radio_button_item(self):
  16. self.driver.find_element_by_xpath(self.item_radio_button_xpath).click()
  17. def wait_document(self):
  18. self.wait.until(EC.element_to_be_clickable((By.XPATH, self.documemt_xpath)))
  19. def click_document(self):
  20. self.driver.find_element_by_xpath(self.documemt_xpath).click()
  21. def wait_next_step_button(self):
  22. self.wait.until(EC.element_to_be_clickable((By.XPATH, self.button_next_step_xpath)))
  23. def click_next_step_button(self):
  24. self.driver.find_element_by_xpath(self.button_next_step_xpath).click()
  25. def wait_finish_button(self):
  26. self.wait.until(EC.element_to_be_clickable((By.ID, self.button_finish_id)))
  27. def click_finish_button(self):
  28. self.driver.find_element_by_id(self.button_finish_id).click()
  29. def check_the_introdcution_of_new_function(self):
  30. time.sleep(2)
  31. if self.driver.find_element_by_xpath(self.new_functions_introduction_xpath):
  32. self.driver.find_element_by_xpath(self.new_functions_introduction_xpath).click()