diff options
author | mahesh | 2017-08-18 17:13:02 +0530 |
---|---|---|
committer | mahesh | 2017-08-18 17:13:02 +0530 |
commit | 6ab383c02085936ecc20ffeb4b9f41ca642256c3 (patch) | |
tree | 747b5ac02a09498c1d151d306e7eada891418e91 /yaksh/live_server_tests/selenium_test.py | |
parent | 0ffc49f91dd9e21a6b9917b7841999bf853c3c9f (diff) | |
download | online_test-6ab383c02085936ecc20ffeb4b9f41ca642256c3.tar.gz online_test-6ab383c02085936ecc20ffeb4b9f41ca642256c3.tar.bz2 online_test-6ab383c02085936ecc20ffeb4b9f41ca642256c3.zip |
Adds quit quiz function in selenium
Diffstat (limited to 'yaksh/live_server_tests/selenium_test.py')
-rw-r--r-- | yaksh/live_server_tests/selenium_test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/yaksh/live_server_tests/selenium_test.py b/yaksh/live_server_tests/selenium_test.py index aefb724..bc400fd 100644 --- a/yaksh/live_server_tests/selenium_test.py +++ b/yaksh/live_server_tests/selenium_test.py @@ -23,6 +23,7 @@ class SeleniumTest(): self.driver.get(self.url) self.login(username, password) self.open_quiz() + self.quit_quiz() self.close_quiz() self.logout() self.driver.close() @@ -115,6 +116,17 @@ class SeleniumTest(): self.test_python_question(question_label=5) self.test_bash_question(question_label=4) + def quit_quiz(self): + quit_link_elem = WebDriverWait(self.driver, 5).until( + EC.presence_of_element_located((By.NAME, "quit")) + ) + quit_link_elem.click() + + quit_link_elem = WebDriverWait(self.driver, 5).until( + EC.presence_of_element_located((By.NAME, "yes")) + ) + quit_link_elem.click() + def close_quiz(self): quit_link_elem = WebDriverWait(self.driver, 5).until( EC.presence_of_element_located((By.ID, "home")) |