def test_set_selenium_timeout_only_affects_open_browsers(): ctx = mock() ctx.timeout = 5.0 _drivers = mock() ctx._drivers = _drivers first_browser, second_browser = mock(), mock() ctx._drivers.active_drivers = [first_browser, second_browser] bm = BrowserManagementKeywords(ctx) bm.set_selenium_timeout("10 seconds") verify(first_browser).set_script_timeout(10.0) verify(second_browser).set_script_timeout(10.0) ctx._drivers.active_drivers = [] bm.set_selenium_timeout("20 seconds") verifyNoMoreInteractions(first_browser) verifyNoMoreInteractions(second_browser)
def test_set_selenium_timeout_only_affects_open_browsers(self): ctx = mock() ctx.timeout = 5.0 _drivers = mock() ctx._drivers = _drivers first_browser, second_browser = mock(), mock() ctx._drivers.active_drivers = [first_browser, second_browser] bm = BrowserManagementKeywords(ctx) bm.set_selenium_timeout("10 seconds") verify(first_browser).set_script_timeout(10.0) verify(second_browser).set_script_timeout(10.0) ctx._drivers.active_drivers = [] bm.set_selenium_timeout("20 seconds") verifyNoMoreInteractions(first_browser) verifyNoMoreInteractions(second_browser) unstub()
def test_set_selenium_timeout_only_affects_open_browsers(self): ctx = mock() ctx.timeout = 5.0 _browsers = mock() ctx._browsers = _browsers first_browser, second_browser = mock(), mock() when(_browsers).get_open_browsers().thenReturn( [first_browser, second_browser]) bm = BrowserManagementKeywords(ctx) bm.set_selenium_timeout("10 seconds") verify(first_browser).set_script_timeout(10.0) verify(second_browser).set_script_timeout(10.0) when(_browsers).get_open_browsers().thenReturn([]) bm.set_selenium_timeout("20 seconds") verifyNoMoreInteractions(first_browser) verifyNoMoreInteractions(second_browser) unstub()
def test_set_selenium_timeout_only_affects_open_browsers(self): ctx = mock() ctx.timeout = 5.0 _browsers = mock() ctx._browsers = _browsers first_browser, second_browser = mock(), mock() when(_browsers).get_open_browsers().thenReturn( [first_browser, second_browser] ) bm = BrowserManagementKeywords(ctx) bm.set_selenium_timeout("10 seconds") verify(first_browser).set_script_timeout(10.0) verify(second_browser).set_script_timeout(10.0) when(_browsers).get_open_browsers().thenReturn( [] ) bm.set_selenium_timeout("20 seconds") verifyNoMoreInteractions(first_browser) verifyNoMoreInteractions(second_browser) unstub()