Skip to content

Commit

Permalink
[py] Fix testShouldReturnWhenGettingAUrlThatDoesNotResolve so it does…
Browse files Browse the repository at this point in the history
… not expect an exception
  • Loading branch information
davehunt committed Oct 24, 2016
1 parent f67a7cc commit 2bf6fde
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions py/test/selenium/webdriver/common/page_loading_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,9 @@ def testShouldBeAbleToGetAFragmentOnTheCurrentPage(self, driver, pages):
driver.get(location + "#text")
driver.find_element(by=By.ID, value="id1")

@pytest.mark.ignore_firefox
@pytest.mark.ignore_phantomjs
@pytest.mark.ignore_safari
def testShouldReturnWhenGettingAUrlThatDoesNotResolve(self, driver):
if driver.capabilities['browserName'] == 'chrome':
pytest.xfail("Chrome Issue: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1538")
with pytest.raises(ValueError):
# Of course, we're up the creek if this ever does get registered
driver.get("http://www.thisurldoesnotexist.comx/")
# Of course, we're up the creek if this ever does get registered
driver.get("http://www.thisurldoesnotexist.comx/")

@pytest.mark.ignore_safari
def testShouldReturnWhenGettingAUrlThatDoesNotConnect(self, driver):
Expand Down

2 comments on commit 2bf6fde

@AutomatedTester
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the behaviour of what should be happening and should be backed out. See https://github.com/SeleniumHQ/selenium/blob/master/java/client/test/org/openqa/selenium/PageLoadingTest.java#L212

@davehunt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the referenced Java test is only catching/ignoring isIeDriverTimedOutException. Any other exception would rethrow and cause the test to fail. Therefore, the test is merely checking that get does not throw when the URL does not resolve, which is also suggested by the test name of testShouldReturnWhenGettingAUrlThatDoesNotResolve.

Please sign in to comment.