@@ -108,7 +108,7 @@ module WebDriver
108
108
driver . navigate . to url_for ( 'relative_locators.html' )
109
109
110
110
above = driver . find_element ( relative : { tag_name : 'td' , above : { id : 'center' } } )
111
- expect ( above . attribute ( 'id' ) ) . to eq ( 'first ' )
111
+ expect ( above . attribute ( 'id' ) ) . to eq ( 'second ' )
112
112
end
113
113
114
114
it 'should find child element' do
@@ -153,14 +153,14 @@ module WebDriver
153
153
154
154
lowest = driver . find_element ( id : 'below' )
155
155
above = driver . find_elements ( relative : { tag_name : 'p' , above : lowest } )
156
- expect ( above . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ above mid ] )
156
+ expect ( above . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ mid above ] )
157
157
end
158
158
159
159
it 'should find above another' do
160
160
driver . navigate . to url_for ( 'relative_locators.html' )
161
161
162
162
above = driver . find_elements ( relative : { tag_name : 'td' , above : { id : 'center' } } )
163
- expect ( above . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ first second third ] )
163
+ expect ( above . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ second first third ] )
164
164
end
165
165
166
166
it 'should find below element' do
@@ -175,28 +175,28 @@ module WebDriver
175
175
driver . navigate . to url_for ( 'relative_locators.html' )
176
176
177
177
near = driver . find_elements ( relative : { tag_name : 'td' , near : { id : 'sixth' } } )
178
- expect ( near . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ second third center eighth ninth ] )
178
+ expect ( near . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ third ninth center second eighth ] )
179
179
end
180
180
181
181
it 'should find near another within custom distance' do
182
182
driver . navigate . to url_for ( 'relative_locators.html' )
183
183
184
184
near = driver . find_elements ( relative : { tag_name : 'td' , near : { id : 'sixth' , distance : 100 } } )
185
- expect ( near . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ second third center eighth ninth ] )
185
+ expect ( near . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ third ninth center second eighth ] )
186
186
end
187
187
188
188
it 'should find to the left of another' do
189
189
driver . navigate . to url_for ( 'relative_locators.html' )
190
190
191
191
left = driver . find_elements ( relative : { tag_name : 'td' , left : { id : 'center' } } )
192
- expect ( left . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ first fourth seventh ] )
192
+ expect ( left . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ fourth first seventh ] )
193
193
end
194
194
195
195
it 'should find to the right of another' do
196
196
driver . navigate . to url_for ( 'relative_locators.html' )
197
197
198
198
right = driver . find_elements ( relative : { tag_name : 'td' , right : { id : 'center' } } )
199
- expect ( right . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ third sixth ninth ] )
199
+ expect ( right . map { |e | e . attribute ( 'id' ) } ) . to eq ( %w[ sixth third ninth ] )
200
200
end
201
201
202
202
it 'should find by combined relative locators' do
0 commit comments