test_sign_yourself.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import page_official
  2. import page_login
  3. import page_main
  4. import page_sign_and_send_prepare
  5. import page_sign_and_send_assign
  6. import page_task
  7. import mattermost
  8. import os, time
  9. from selenium import webdriver
  10. from selenium.webdriver.support.ui import WebDriverWait
  11. mattermost = mattermost.mattermost(driver, flag_report)
  12. flag_report = Truepdf_path = os.getcwd() + "/test.pdf"
  13. email = SECRET_EMAIL
  14. password = SECRET_PASSWORD
  15. driver = webdriver.Chrome()
  16. wait = WebDriverWait(driver, 60)
  17. baseURL = "https://www.dottedsign.com/"
  18. driver.get(baseURL)
  19. try:
  20. official = page_official.page_official(driver, wait)
  21. official.wait_sign_in_button()
  22. official.click_sign_in_button()
  23. except Exception as error_message:
  24. flag_report = mattermost.reporter_error("Step 1: Official Page", error_message)
  25. try:
  26. login = page_login.page_login(driver, wait)
  27. login.wait_email_textbox()
  28. login.input_email_textbox(email)
  29. login.wait_1st_next_step_button()
  30. login.click_1st_next_step_button()
  31. login.wait_password_textbox()
  32. login.input_password_textbox(password)
  33. login.wait_2nd_next_step_button()
  34. login.click_2nd_next_step_button()
  35. except Exception as error_message:
  36. flag_report = mattermost.reporter_error("Step 2: Login Page", error_message)
  37. try:
  38. main = page_main.page_main(driver,wait)
  39. main.wait_purple_circle()
  40. main.click_purple_circle()
  41. main.wait_sign_yourself_button()
  42. main.click_sign_yourself_button()
  43. except Exception as error_message:
  44. flag_report = mattermost.reporter_error("Step 3: Main Page", error_message)
  45. try:
  46. sign_and_send_prepare = page_sign_and_send_prepare.page_sign_and_send_prepare(driver,wait)
  47. sign_and_send_prepare.wait_pdf_button(3)
  48. sign_and_send_prepare.upload_pdf_button(pdf_path)
  49. sign_and_send_prepare.wait_next_step_button()
  50. sign_and_send_prepare.click_next_step_button()
  51. except Exception as error_message:
  52. flag_report = mattermost.reporter_error("Step 4: Sign and Send Prepare Page", error_message)
  53. try:
  54. sign_and_send_assign = page_sign_and_send_assign.page_sign_and_send_assign(driver,wait)
  55. sign_and_send_assign.check_the_introdcution_of_new_function()
  56. sign_and_send_assign.wait_radio_button_item()
  57. sign_and_send_assign.click_radio_button_item()
  58. sign_and_send_assign.wait_document()
  59. sign_and_send_assign.click_document()
  60. sign_and_send_assign.wait_next_step_button()
  61. sign_and_send_assign.click_next_step_button()
  62. sign_and_send_assign.wait_finish_button()
  63. sign_and_send_assign.click_finish_button()
  64. except Exception as error_message:
  65. flag_report = mattermost.reporter_error("Step 5: Sign and Send Assign Page", error_message)
  66. try:
  67. task = page_task.page_task(driver, wait)
  68. task.wait_back_to_main_button()
  69. task.click_back_to_main_button()
  70. except Exception as error_message:
  71. flag_report = mattermost.reporter_error("Step 6: Task Page", error_message)
  72. try:
  73. main.wait_completed_tab()
  74. main.click_completed_tab()
  75. main.wait_latest_task_option()
  76. main.click_latest_task_option()
  77. mattermost.reprort_success()
  78. except Exception as error_message:
  79. flag_report = mattermost.reporter_error("Step 7: Main Page: (Final Step)", error_message)