diff options
author | ankitjavalkar | 2018-10-01 18:41:45 +0530 |
---|---|---|
committer | ankitjavalkar | 2018-10-09 16:46:46 +0530 |
commit | 28edb315ce60a1ad95b7a608301a67ee8ba3e9d6 (patch) | |
tree | 66081612a5d754d8beeb36b6caf857b819adf333 /yaksh/live_server_tests/selenium_test.py | |
parent | bdd20668da9631396866e8a1942bcb8b2e623396 (diff) | |
download | online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.tar.gz online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.tar.bz2 online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.zip |
Minor UI changes and selenium test fixes
Diffstat (limited to 'yaksh/live_server_tests/selenium_test.py')
-rw-r--r-- | yaksh/live_server_tests/selenium_test.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/yaksh/live_server_tests/selenium_test.py b/yaksh/live_server_tests/selenium_test.py index 5bf1988..41a0fad 100644 --- a/yaksh/live_server_tests/selenium_test.py +++ b/yaksh/live_server_tests/selenium_test.py @@ -27,6 +27,8 @@ class SeleniumTestError(Exception): class SeleniumTest(): def __init__(self, url, quiz_name, module_name, course_name): self.driver = webdriver.Firefox() + self.driver.set_window_position(0, 0) + self.driver.set_window_size(1024, 768) self.quiz_name = quiz_name self.module_name = module_name self.course_name = course_name @@ -124,8 +126,8 @@ class SeleniumTest(): def open_quiz(self): # open module link self.driver.find_elements_by_partial_link_text( - self.course_name)[0].click() - self.driver.find_element_by_link_text(self.module_name).click() + 'START')[0].click() + self.driver.find_element_by_link_text('Start').click() # open quiz link self.driver.find_element_by_link_text(self.quiz_name).click() @@ -157,12 +159,15 @@ class SeleniumTest(): quit_link_elem.click() def logout(self): - logout_link_elem = WebDriverWait(self.driver, 5).until( - EC.presence_of_element_located((By.ID, "logout")) + logout_link_menu = WebDriverWait(self.driver, 10).until( + EC.presence_of_element_located((By.ID, "user_dropdown")) + ) + logout_link_menu.click() + logout_link_elem = WebDriverWait(self.driver, 10).until( + EC.presence_of_element_located((By.ID, "user_logout")) ) logout_link_elem.click() - def user_gen(url, ids): return [(url, 'User%d' % x, 'User%d' % x) for x in ids] |