@@ -157,9 +157,9 @@ def test_no_such_element_is_raised_rather_than_index_error_by_locator(driver, pa
157157
158158def test_near_locator_should_find_near_elements (driver , pages ):
159159 pages .load ("relative_locators.html" )
160- rect1 = driver .find_element (By .ID , "rect1" )
160+ rect = driver .find_element (By .ID , "rect1" )
161161
162- el = driver .find_element (locate_with (By .ID , "rect2" ).near (rect1 ))
162+ el = driver .find_element (locate_with (By .ID , "rect2" ).near (rect ))
163163
164164 assert el .get_attribute ("id" ) == "rect2"
165165
@@ -174,10 +174,10 @@ def test_near_locator_should_find_near_elements_by_locator(driver, pages):
174174
175175def test_near_locator_should_not_find_far_elements (driver , pages ):
176176 pages .load ("relative_locators.html" )
177- rect2 = driver .find_element (By .ID , "rect2" )
177+ rect = driver .find_element (By .ID , "rect2" )
178178
179179 with pytest .raises (NoSuchElementException ) as exc :
180- driver .find_element (locate_with (By .ID , "rect4" ).near (rect3 ))
180+ driver .find_element (locate_with (By .ID , "rect4" ).near (rect ))
181181
182182 assert "Cannot locate relative element with: {'id': 'rect4'}" in exc .value .msg
183183
@@ -193,17 +193,17 @@ def test_near_locator_should_not_find_far_elements_by_locator(driver, pages):
193193
194194def test_near_locator_should_find_far_elements (driver , pages ):
195195 pages .load ("relative_locators.html" )
196- rect3 = driver .find_element (By .ID , "rect3 " )
196+ rect = driver .find_element (By .ID , "rect2 " )
197197
198- el = driver .find_element (locate_with (By .ID , "rect4" ).near (rect3 , 100 ))
198+ el = driver .find_element (locate_with (By .ID , "rect4" ).near (rect , 100 ))
199199
200200 assert el .get_attribute ("id" ) == "rect4"
201201
202202
203203def test_near_locator_should_find_far_elements_by_locator (driver , pages ):
204204 pages .load ("relative_locators.html" )
205205
206- el = driver .find_element (locate_with (By .ID , "rect4" ).near ({By .ID : "rect3 " }, 100 ))
206+ el = driver .find_element (locate_with (By .ID , "rect4" ).near ({By .ID : "rect2 " }, 100 ))
207207
208208 assert el .get_attribute ("id" ) == "rect4"
209209
0 commit comments