예제 #1
0
파일: test_web.py 프로젝트: satasumi1/ok
 def setUp(self):
     self.driver = webdriver.PhantomJS(service_args=[
         '--ignore-ssl-errors=true', '--ssl-protocol=any'
     ])
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)
예제 #2
0
파일: test_web.py 프로젝트: kvakil/ok
        def test_job(self):
            self._login_as(self.staff1.email)

            jobs_list_url = '{}/admin/course/{}/jobs/'.format(
                self.get_server_url(), self.course.id)

            self.page_load(jobs_list_url + 'test')
            input_element = self.driver.find_element_by_id('duration')
            input_element.clear()
            input_element.send_keys('0')
            input_element = self.driver.find_element_by_id('should_fail')
            input_element.click()
            input_element.submit()

            job_url = self.driver.current_url
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Queued', self.driver.page_source)

            self.page_load(jobs_list_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Queued', self.driver.page_source)

            OkTestCase.run_jobs(self)

            self.page_load(job_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Failed', self.driver.page_source)
            self.assertIn('Traceback', self.driver.page_source)
            self.assertIn('ZeroDivisionError', self.driver.page_source)

            self.page_load(jobs_list_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Failed', self.driver.page_source)
예제 #3
0
        def test_job(self):
            self._login_as(self.staff1.email)

            jobs_list_url = '{}/admin/course/{}/jobs/'.format(
                self.get_server_url(), self.course.id)

            self.page_load(jobs_list_url + 'test')
            input_element = self.driver.find_element_by_id('duration')
            input_element.clear()
            input_element.send_keys('0')
            input_element = self.driver.find_element_by_id('should_fail')
            input_element.click()
            input_element.submit()

            job_url = self.driver.current_url
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Queued', self.driver.page_source)

            self.page_load(jobs_list_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Queued', self.driver.page_source)

            OkTestCase.run_jobs(self)

            self.page_load(job_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Failed', self.driver.page_source)
            self.assertIn('Traceback', self.driver.page_source)
            self.assertIn('ZeroDivisionError', self.driver.page_source)

            self.page_load(jobs_list_url)
            self.assertIn('Test Job', self.driver.page_source)
            self.assertIn('Failed', self.driver.page_source)
예제 #4
0
 def setUp(self):
     self.driver = webdriver.PhantomJS(
             service_args=[
                 '--ignore-ssl-errors=true',
                 '--ssl-protocol=any'])
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)
예제 #5
0
 def setUp(self):
     self.driver = webdriver.PhantomJS()
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)
예제 #6
0
 def tearDown(self):
     OkTestCase.tearDown(self)
     super(WebTest, self).tearDown()
     self.driver.quit()
예제 #7
0
파일: test_web.py 프로젝트: gratimax/ok
 def tearDown(self):
     OkTestCase.tearDown(self)
     super(WebTest, self).tearDown()
     self.driver.quit()
예제 #8
0
파일: test_web.py 프로젝트: gratimax/ok
 def setUp(self):
     self.driver = webdriver.PhantomJS()
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)