123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- import time
- import unittest
- import page_official
- import page_login
- import page_main
- import page_sign_and_send_prepare
- import page_sign_and_send_assign
- import page_task
- import os
- from selenium import webdriver
- from selenium.webdriver.support.ui import WebDriverWait
- class test_sign_yourself(unittest.TestCase):
- pdf_path = os.getcwd() + "/test.pdf"
- baseURL = "https://www.dottedsign.com/"
- email = "user_email"
- password = "user_password"
- driver = webdriver.Chrome()
- wait = WebDriverWait(driver, 60)
- @classmethod
- def setUpClass(cls):
- cls.driver.get(cls.baseURL)
- cls.driver.maximize_window()
- def test(self):
- try:
- official = page_official.page_official(self.driver, self.wait)
- official.wait_sign_in_button()
- official.click_sign_in_button()
- except Exception as e:
- print("An exception occured when working on Official Page.")
- print(e)
-
- try:
- login = page_login.page_login(self.driver, self.wait)
- login.wait_email_textbox()
- login.input_email_textbox(self.email)
- login.wait_1st_next_step_button()
- login.click_1st_next_step_button()
- login.wait_password_textbox()
- login.input_password_textbox(self.password)
- login.wait_2nd_next_step_button()
- login.click_2nd_next_step_button()
- except Exception as e:
- print("An exception occured when working on Login Page")
- print(e)
-
- try:
- main = page_main.page_main(self.driver,self.wait)
- main.wait_purple_circle()
- main.click_purple_circle()
- main.wait_sign_yourself_button()
- main.click_sign_yourself_button()
- except Exception as e:
- print("An exception occured when working on Main Page")
- print(e)
- try:
- sign_and_send_prepare = page_sign_and_send_prepare.page_sign_and_send_prepare(self.driver,self.wait)
- sign_and_send_prepare.wait_pdf_button(3)
- sign_and_send_prepare.upload_pdf_button(self.pdf_path)
- sign_and_send_prepare.wait_next_step_button()
- sign_and_send_prepare.click_next_step_button()
- except Exception as e:
- print("An exception occured when working on Sign and Send Prepare Page")
- print(e)
- try:
- sign_and_send_assign = page_sign_and_send_assign.page_sign_and_send_assign(self.driver,self.wait)
- sign_and_send_assign.wait_radio_button_item()
- sign_and_send_assign.click_radio_button_item()
-
- sign_and_send_assign.wait_document()
- sign_and_send_assign.click_document()
- sign_and_send_assign.wait_next_step_button()
- sign_and_send_assign.click_next_step_button()
- sign_and_send_assign.wait_finish_button()
- sign_and_send_assign.click_finish_button()
- except Exception as e:
- print("An exception occured when working on Sign and Send Assign Page")
- print(e)
- try:
- task = page_task.page_task(self.driver, self.wait)
- task.wait_back_to_main_button()
- task.click_back_to_main_button()
- except Exception as e:
- print("An exception occured when working on Task Page")
- print(e)
- try:
- main.wait_completed_tab()
- main.click_completed_tab()
- main.wait_latest_task_option()
- main.click_latest_task_option()
- except Exception as e:
- print("An exception occured when working on Main Page")
- print(e)
-
- @classmethod
- def tearDownClass(cls):
- time.sleep(10)
- cls.driver.close()
- if __name__ == '__main__':
- unittest.main()
|