Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 def setUp(self):
     self.driver = webdriver.PhantomJS()
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)
Exemplo n.º 6
0
 def tearDown(self):
     OkTestCase.tearDown(self)
     super(WebTest, self).tearDown()
     self.driver.quit()
Exemplo n.º 7
0
 def tearDown(self):
     OkTestCase.tearDown(self)
     super(WebTest, self).tearDown()
     self.driver.quit()
Exemplo n.º 8
0
 def setUp(self):
     self.driver = webdriver.PhantomJS()
     OkTestCase.setUp(self)
     OkTestCase.setup_course(self)
     self.driver.set_window_size(1268, 1024)