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)
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)
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)
def setUp(self): self.driver = webdriver.PhantomJS() OkTestCase.setUp(self) OkTestCase.setup_course(self) self.driver.set_window_size(1268, 1024)
def tearDown(self): OkTestCase.tearDown(self) super(WebTest, self).tearDown() self.driver.quit()