diff options
author | ankitjavalkar | 2017-03-01 17:43:38 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-03-01 17:43:38 +0530 |
commit | ee3b4a2a081557f510674df489ac7479e31f5e82 (patch) | |
tree | f5b315ce2f2c2e1bc121685840e145384be52e22 /yaksh/live_server_tests/load_test.py | |
parent | b001bc98db69e1ef1926b0f2103bf5a291682f93 (diff) | |
download | online_test-ee3b4a2a081557f510674df489ac7479e31f5e82.tar.gz online_test-ee3b4a2a081557f510674df489ac7479e31f5e82.tar.bz2 online_test-ee3b4a2a081557f510674df489ac7479e31f5e82.zip |
Fix selenium tests:
- Fix addition of answer to codemirror using selenium
- Add custom exception when selenium fails
- Add id to logout button on student interface
- Fix imports for Python3 support in load_test.py
Diffstat (limited to 'yaksh/live_server_tests/load_test.py')
-rw-r--r-- | yaksh/live_server_tests/load_test.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/yaksh/live_server_tests/load_test.py b/yaksh/live_server_tests/load_test.py index 17934d4..21c25ba 100644 --- a/yaksh/live_server_tests/load_test.py +++ b/yaksh/live_server_tests/load_test.py @@ -9,11 +9,11 @@ from selenium.webdriver.firefox.webdriver import WebDriver from django.contrib.staticfiles.testing import StaticLiveServerTestCase from yaksh.models import User, Profile, Question, Quiz, Course, QuestionPaper, TestCase -from selenium_test import SeleniumTest - from yaksh.code_server import ServerPool from yaksh import settings +from .selenium_test import SeleniumTest + class YakshSeleniumTests(StaticLiveServerTestCase): @classmethod @@ -26,44 +26,46 @@ class YakshSeleniumTests(StaticLiveServerTestCase): "yaksh.cpp_code_evaluator.CppCodeEvaluator" settings.code_evaluators['bash']['standardtestcase'] = \ "yaksh.bash_code_evaluator.BashCodeEvaluator" - settings.SERVER_POOL_PORT = 53578 code_server_pool = ServerPool(ports=settings.SERVER_PORTS, pool_port=settings.SERVER_POOL_PORT) cls.code_server_pool = code_server_pool cls.code_server_thread = t = Thread(target=code_server_pool.run) t.start() - demo_student = User.objects.create_user(username='demo_student', + cls.demo_student = User.objects.create_user(username='demo_student', password='demo_student', email='demo_student@test.com' ) - demo_student_profile = Profile.objects.create(user=demo_student, + cls.demo_student_profile = Profile.objects.create(user=cls.demo_student, roll_number=3, institute='IIT', department='Chemical', position='Student' ) - demo_mod = User.objects.create_user(username='demo_mod', + cls.demo_mod = User.objects.create_user(username='demo_mod', password='demo_mod', email='demo_mod@test.com' ) - demo_mod_profile = Profile.objects.create(user=demo_mod, + cls.demo_mod_profile = Profile.objects.create(user=cls.demo_mod, roll_number=0, institute='IIT', department='Chemical', position='Moderator' ) course_obj = Course() - course_obj.create_demo(demo_mod) - demo_course = Course.objects.get(id=1) + course_obj.create_demo(cls.demo_mod) + cls.demo_course = Course.objects.get(id=1) - demo_course.students.add(demo_student) + cls.demo_course.students.add(cls.demo_student) @classmethod def tearDownClass(cls): - User.objects.all().delete() - Question.objects.all().delete() - Quiz.objects.all().delete() - Course.objects.all().delete() - - settings.SERVER_POOL_PORT = 53579 + # User.objects.all().delete() + # Question.objects.all().delete() + # Quiz.objects.all().delete() + # Course.objects.all().delete() + cls.demo_student.delete() + cls.demo_student_profile.delete() + cls.demo_mod.delete() + cls.demo_mod_profile.delete() + cls.demo_course.delete() cls.code_server_pool.stop() cls.code_server_thread.join() |