Beispiel #1
0
    def test_should_return_absolute_url_when_base_url_is_a_file_one(
        self, mocker, chrome_driver, given_url, absolute_url
    ):
        mocker.patch('selenium.webdriver.remote.webdriver.WebDriver.current_url', 'file:/C/foo/bar.html')
        response = BaseSeleniumResponse(driver=chrome_driver, handle='4')

        assert absolute_url == response._get_absolute_url(given_url)
Beispiel #2
0
 def test_should_raise_error_when_handle_does_not_have_the_correct_type(self, chrome_driver, handle):
     with pytest.raises(TypeError):
         BaseSeleniumResponse(driver=chrome_driver, handle=handle)
Beispiel #3
0
 def test_should_not_raise_error_when_parameters_are_correct(self, chrome_driver):
     try:
         BaseSeleniumResponse(driver=chrome_driver, handle='4')
     except TypeError:
         pytest.fail('unexpected error when initializing BaseSeleniumResponse')
Beispiel #4
0
 def test_should_raise_error_when_driver_does_not_have_the_correct_type(self):
     with pytest.raises(TypeError):
         BaseSeleniumResponse(
             driver='foo',
             handle='4',
         )