Skip to content

Commit faddc1b

Browse files
committed
add failing test to check RelativeLocator#near accept single int
1 parent 478b430 commit faddc1b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: py/test/selenium/webdriver/support/relative_by_tests.py

+7
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ def test_no_such_element_is_raised_rather_than_index_error(driver, pages):
8989
assert "Cannot locate relative element with: {'id': 'nonexistentid'}" in exc.value.msg
9090

9191

92+
# this test will fail with InvalidArgumentException
93+
def test_near_locator_should_accept_single_int(driver, pages):
94+
pages.load("relative_locators.html")
95+
96+
driver.find_element(locate_with(By.ID, "rect2").near(123))
97+
98+
9299
def test_near_locator_should_find_near_elements(driver, pages):
93100
pages.load("relative_locators.html")
94101
rect1 = driver.find_element(By.ID, "rect1")

0 commit comments

Comments
 (0)