Exemplo n.º 1
0
 def setUp(self):
     FlaskTestCase.setUp(self)
     self.job = Job.new('http://goo.com')
     self.ran_once = Check(
         job_id = self.job.id,
         url = 'http://www.foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
         filename = 'check.png',
         try_count = 1,
     )
     self.not_ran = Check(
         job_id = self.job.id,
         url = 'http://www.foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
         try_count = 0,
     )
     self.in_flight = Check(
         job_id = self.job.id,
         url = 'http://www.foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
         try_count = 1,
         running = True,
         last_run = datetime.now(),
     )
     for c in [self.ran_once, self.not_ran, self.in_flight]:
         db.session.add(c)
     db.session.commit()
Exemplo n.º 2
0
 def setUp(self):
     FlaskTestCase.setUp(self)
     self.job = Job.new(
         title = 'Test Job',
     )
     self.check = self.job.add_check(
         url = 'http://www.foo.com',
         browser_name = 'firefox',
         platform = 'windows',
         version = '1',
     )
     db.session.commit()
Exemplo n.º 3
0
 def setUp(self):
     FlaskTestCase.setUp(self)
     self.job = Job.new('http://goo.com')
     self.check = self.job.add_check(
         url = 'http://foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
     )
     db.session.add(self.job)
     db.session.add(self.check)
     db.session.commit()
Exemplo n.º 4
0
 def setUp(self):
     FlaskTestCase.setUp(self)
     self.job = Job.new('http://goo.com')
     self.check = Check(
         job_id = self.job.id,
         url = 'http://foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
         try_count = 1,
         running = True,
     )
     db.session.add(self.check)
     db.session.commit()
     self.patcher = patch('browsergrid.runner.webdriver')
     self.webdriver = self.patcher.start()
     self.driver = self.webdriver.Remote.return_value = Mock()
     self.driver.get_screenshot_as_base64.return_value = 'pic'.encode('base64')
     self.tempdir = tempfile.mkdtemp()