Skip to content

Commit

Permalink
add failing test to check RelativeLocator#near accept single int
Browse files Browse the repository at this point in the history
  • Loading branch information
pinterior committed Nov 27, 2023
1 parent 478b430 commit faddc1b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions py/test/selenium/webdriver/support/relative_by_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ def test_no_such_element_is_raised_rather_than_index_error(driver, pages):
assert "Cannot locate relative element with: {'id': 'nonexistentid'}" in exc.value.msg


# this test will fail with InvalidArgumentException
def test_near_locator_should_accept_single_int(driver, pages):
pages.load("relative_locators.html")

driver.find_element(locate_with(By.ID, "rect2").near(123))


def test_near_locator_should_find_near_elements(driver, pages):
pages.load("relative_locators.html")
rect1 = driver.find_element(By.ID, "rect1")
Expand Down

0 comments on commit faddc1b

Please sign in to comment.