[py] Remove old test xfail markers from Travis CI by cgoldberg · Pull Request #16377 · SeleniumHQ/selenium

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Uncomment test to re-enable it

Uncomment the test_should_maximize_the_window test to re-enable it, as the PR's
changes removed Travis-specific xfail markers but left the test itself commented
out.

py/test/selenium/webdriver/common/window_tests.py [23-32]

-# @pytest.mark.xfail_ie
-# def test_should_maximize_the_window(driver):
-#     resize_timeout = 5
-#     wait = WebDriverWait(driver, resize_timeout)
-#     size_before = driver.get_window_size()
-#     driver.maximize_window()
-#     wait.until(lambda dr: dr.get_window_size()['width'] > size_before['width'])
-#     size_after = driver.get_window_size()
-#     assert size_after['width'] > size_before['width']
-#     assert size_after['height'] > size_before['height']
+@pytest.mark.xfail_ie
+def test_should_maximize_the_window(driver):
+    resize_timeout = 5
+    wait = WebDriverWait(driver, resize_timeout)
+    size_before = driver.get_window_size()
+    driver.maximize_window()
+    wait.until(lambda dr: dr.get_window_size()['width'] > size_before['width'])
+    size_after = driver.get_window_size()
+    assert size_after['width'] > size_before['width']
+    assert size_after['height'] > size_before['height']

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that a test remains commented out after its Travis-specific markers were removed, making the PR's change ineffective for this test. Uncommenting the test is a logical next step to re-enable it, which aligns with the PR's intent.

Medium
Learned
best practice
Verify page load before actions

Assert the test page loaded successfully to fail fast with a clear reason if
navigation failed.

py/test/selenium/webdriver/common/w3c_interaction_tests.py [149-151]

 def test_double_click(driver, pages):
     """Copied from org.openqa.selenium.interactions.TestBasicMouseInterface."""
     pages.load("javascriptPage.html")
+    assert "javascript" in driver.current_url, "Failed to load javascriptPage.html"

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why:
Relevant best practice - Validate inputs and states early with precise checks to prevent logic errors.

Low
  • Update