Exemple #1
0
 def test_bad_browser_name(self):
     bm = BrowserManagementKeywords()
     try:
         bm._make_browser("fireox")
         self.fail("Exception not raised")
     except ValueError as e:
         self.assertEquals(str(e), "fireox is not a supported browser.")
Exemple #2
0
    def verify_browser(self , webdriver_type , browser_name, **kw):
        #todo try lambda *x: was_called = true
        bm = BrowserManagementKeywords()
        old_init = webdriver_type.__init__
        webdriver_type.__init__ = self.mock_init

        try:
            self.was_called = False
            bm._make_browser(browser_name, **kw)
        except AttributeError:
            pass #kinda dangerous but I'm too lazy to mock out all the set_timeout calls
        finally:
            webdriver_type.__init__ = old_init
            self.assertTrue(self.was_called)