From 6ab383c02085936ecc20ffeb4b9f41ca642256c3 Mon Sep 17 00:00:00 2001 From: mahesh Date: Fri, 18 Aug 2017 17:13:02 +0530 Subject: Adds quit quiz function in selenium --- yaksh/live_server_tests/selenium_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'yaksh') 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")) -- cgit