@@ -115,7 +115,7 @@ module WebDriver
115115          driver . navigate . to  url_for ( 'relative_locators.html' ) 
116116
117117          above  =  driver . find_element ( relative : { tag_name : 'td' ,  above : { id : 'center' } } ) 
118-           expect ( above . attribute ( 'id' ) ) . to  eq ( 'second ' ) 
118+           expect ( above . attribute ( 'id' ) ) . to  eq ( 'top ' ) 
119119        end 
120120
121121        it  'finds child element'  do 
@@ -182,7 +182,7 @@ module WebDriver
182182          driver . navigate . to  url_for ( 'relative_locators.html' ) 
183183
184184          above  =  driver . find_elements ( relative : { css : 'td' ,  above : { id : 'center' } } ) 
185-           expect ( above . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ second   first   third ] ) 
185+           expect ( above . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ top   topLeft   topRight ] ) 
186186        end 
187187
188188        it  'finds below element'  do 
@@ -196,36 +196,36 @@ module WebDriver
196196        it  'finds near another within default distance'  do 
197197          driver . navigate . to  url_for ( 'relative_locators.html' ) 
198198
199-           near  =  driver . find_elements ( relative : { tag_name : 'td' ,  near : { id : 'sixth ' } } ) 
199+           near  =  driver . find_elements ( relative : { tag_name : 'td' ,  near : { id : 'right ' } } ) 
200200          expect ( near . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ third  ninth  center  second  eighth ] ) 
201201        end 
202202
203203        it  'finds near another within custom distance' ,  except : { browser : %i[ safari  safari_preview ] }  do 
204204          driver . navigate . to  url_for ( 'relative_locators.html' ) 
205205
206-           near  =  driver . find_elements ( relative : { tag_name : 'td' ,  near : { id : 'sixth ' ,  distance : 100 } } ) 
207-           expect ( near . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ third   ninth  center  second   eighth ] ) 
206+           near  =  driver . find_elements ( relative : { tag_name : 'td' ,  near : { id : 'right ' ,  distance : 100 } } ) 
207+           expect ( near . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ topRight   bottomRight  center  top   bottom ] ) 
208208        end 
209209
210210        it  'finds to the left of another'  do 
211211          driver . navigate . to  url_for ( 'relative_locators.html' ) 
212212
213213          left  =  driver . find_elements ( relative : { tag_name : 'td' ,  left : { id : 'center' } } ) 
214-           expect ( left . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ fourth   first   seventh ] ) 
214+           expect ( left . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ left   topLeft   bottomLeft ] ) 
215215        end 
216216
217217        it  'finds to the right of another'  do 
218218          driver . navigate . to  url_for ( 'relative_locators.html' ) 
219219
220220          right  =  driver . find_elements ( relative : { tag_name : 'td' ,  right : { id : 'center' } } ) 
221-           expect ( right . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ sixth   third   ninth ] ) 
221+           expect ( right . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( %w[ right   topRight   bottomRight ] ) 
222222        end 
223223
224224        it  'finds by combined relative locators'  do 
225225          driver . navigate . to  url_for ( 'relative_locators.html' ) 
226226
227-           found  =  driver . find_elements ( relative : { tag_name : 'td' ,  right : { id : 'second ' } ,  above : { id : 'center' } } ) 
228-           expect ( found . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( [ 'third ' ] ) 
227+           found  =  driver . find_elements ( relative : { tag_name : 'td' ,  right : { id : 'top ' } ,  above : { id : 'center' } } ) 
228+           expect ( found . map  {  |e | e . attribute ( 'id' )  } ) . to  eq ( [ 'topRight ' ] ) 
229229        end 
230230
231231        it  'finds all by empty relative locator'  do 
0 commit comments