[py] Remove old test xfail markers from Travis CI by cgoldberg · Pull Request #16377 · SeleniumHQ/selenium
PR Code Suggestions ✨
Explore these optional code suggestions:
| Category | Suggestion | Impact |
| General |
Uncomment test to re-enable itUncomment the 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']
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 actionsAssert the test page loaded successfully to fail fast with a clear reason if 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"
Suggestion importance[1-10]: 5__ Why: | Low |
| ||