summaryrefslogtreecommitdiff
path: root/yaksh/live_server_tests
diff options
context:
space:
mode:
authormahesh2017-11-24 00:09:34 +0530
committermahesh2017-11-24 00:09:34 +0530
commitd9502c091fec7671bfe31cd655f9fe3f07b8899c (patch)
treecfd693482f9729c77f665493dabeb080ee898a27 /yaksh/live_server_tests
parent63326f9519478f0d9bfb0b843e5dac8ab29428f4 (diff)
parent8dd97bc6855a0e367a67d8a8803623f1c3f7e8f2 (diff)
downloadonline_test-d9502c091fec7671bfe31cd655f9fe3f07b8899c.tar.gz
online_test-d9502c091fec7671bfe31cd655f9fe3f07b8899c.tar.bz2
online_test-d9502c091fec7671bfe31cd655f9fe3f07b8899c.zip
Merge branch 'yaksh_video_lessons' of https://github.com/fossee/online_test into yaksh_video_lessons
Diffstat (limited to 'yaksh/live_server_tests')
-rw-r--r--yaksh/live_server_tests/load_test.py4
-rw-r--r--yaksh/live_server_tests/selenium_test.py9
2 files changed, 10 insertions, 3 deletions
diff --git a/yaksh/live_server_tests/load_test.py b/yaksh/live_server_tests/load_test.py
index 5ab1cc2..c3eb6e6 100644
--- a/yaksh/live_server_tests/load_test.py
+++ b/yaksh/live_server_tests/load_test.py
@@ -73,5 +73,7 @@ class YakshSeleniumTests(StaticLiveServerTestCase):
def test_load(self):
url = '%s%s' % (self.live_server_url, '/exam/login/')
quiz_name = "Yaksh Demo quiz"
- selenium_test = SeleniumTest(url=url, quiz_name=quiz_name)
+ module_name = "demo module"
+ selenium_test = SeleniumTest(url=url, quiz_name=quiz_name,
+ module_name=module_name)
selenium_test.run_load_test(url=url, username='demo_student', password='demo_student')
diff --git a/yaksh/live_server_tests/selenium_test.py b/yaksh/live_server_tests/selenium_test.py
index 31efcac..160ad02 100644
--- a/yaksh/live_server_tests/selenium_test.py
+++ b/yaksh/live_server_tests/selenium_test.py
@@ -26,9 +26,10 @@ class SeleniumTestError(Exception):
pass
class SeleniumTest():
- def __init__(self, url, quiz_name):
+ def __init__(self, url, quiz_name, module_name):
self.driver = webdriver.Firefox()
self.quiz_name = quiz_name
+ self.module_name = module_name
self.url = url
def run_load_test(self, url, username, password):
@@ -119,6 +120,8 @@ class SeleniumTest():
self.submit_answer(question_label, answer, loop_count)
def open_quiz(self):
+ # open module link
+ self.driver.find_element_by_link_text(self.module_name).click()
# open quiz link
quiz_link_elem = self.driver.find_element_by_link_text(self.quiz_name).click()
@@ -171,7 +174,9 @@ if __name__ == '__main__':
opts = parser.parse_args()
quiz_name = "Demo quiz"
- selenium_test = SeleniumTest(url=opts.url, quiz_name=quiz_name)
+ module_name = "demo module"
+ selenium_test = SeleniumTest(url=opts.url, quiz_name=quiz_name,
+ module_name=module_name)
pool = multiprocessing.Pool(opts.number)
pool.map(wrap_run_load_test, user_gen(opts.url, range(opts.start, opts.start + opts.number)))
pool.close()