@@ -176,6 +176,7 @@ module WebDriver
176
176
driver . navigate . to url_for ( 'javascriptPage.html' )
177
177
element = driver . find_element ( id : 'doubleClickField' )
178
178
179
+ sleep 0.5
179
180
driver . action . double_click ( element ) . perform
180
181
expect ( element . attribute ( :value ) ) . to eq ( 'DoubleClicked' )
181
182
end
@@ -252,7 +253,7 @@ module WebDriver
252
253
driver . navigate . to url_for ( 'javascriptPage.html' )
253
254
element = driver . find_element ( id : 'clickField' )
254
255
rect = element . rect
255
- driver . action . move_to_location ( rect . x , rect . y ) . click . perform
256
+ driver . action . move_to_location ( rect . x . ceil , rect . y . ceil ) . click . perform
256
257
257
258
expect ( element . attribute ( :value ) ) . to eq ( 'Clicked' )
258
259
end
@@ -269,7 +270,7 @@ def in_viewport?(element)
269
270
driver . execute_script ( in_viewport , element )
270
271
end
271
272
272
- describe '#scroll_to' do
273
+ describe '#scroll_to' , only : { browser : %i[ chrome edge ] } do
273
274
it 'scrolls to element' do
274
275
driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html' )
275
276
iframe = driver . find_element ( tag_name : 'iframe' )
@@ -281,7 +282,7 @@ def in_viewport?(element)
281
282
end
282
283
end
283
284
284
- describe '#scroll_from' do
285
+ describe '#scroll_from' , only : { browser : %i[ chrome edge ] } do
285
286
it 'scrolls from element by the provided amount' do
286
287
driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html' )
287
288
@@ -315,7 +316,7 @@ def in_viewport?(element)
315
316
end
316
317
end
317
318
318
- describe '#scroll_by' do
319
+ describe '#scroll_by' , only : { browser : %i[ chrome edge ] } do
319
320
it 'scrolls by amount provided' do
320
321
driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html' )
321
322
@@ -326,25 +327,25 @@ def in_viewport?(element)
326
327
327
328
expect ( in_viewport? ( footer ) ) . to eq true
328
329
end
329
- end
330
330
331
- it 'scrolls by amount provided from provided origin' do
332
- driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame.html' )
331
+ it 'scrolls by amount provided from provided origin' do
332
+ driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame.html' )
333
333
334
- iframe = driver . find_element ( tag_name : 'iframe' )
335
- driver . action . scroll_by ( 0 , 200 , origin_x : 10 , origin_y : 10 ) . perform
334
+ iframe = driver . find_element ( tag_name : 'iframe' )
335
+ driver . action . scroll_by ( 0 , 200 , origin_x : 10 , origin_y : 10 ) . perform
336
336
337
- driver . switch_to . frame ( iframe )
338
- checkbox = driver . find_element ( name : 'scroll_checkbox' )
339
- expect ( in_viewport? ( checkbox ) ) . to eq true
340
- end
337
+ driver . switch_to . frame ( iframe )
338
+ checkbox = driver . find_element ( name : 'scroll_checkbox' )
339
+ expect ( in_viewport? ( checkbox ) ) . to eq true
340
+ end
341
341
342
- it 'throws MoveTargetOutOfBoundsError when origin offset is out of viewport' do
343
- driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame.html' )
342
+ it 'throws MoveTargetOutOfBoundsError when origin offset is out of viewport' do
343
+ driver . navigate . to url_for ( 'scrolling_tests/frame_with_nested_scrolling_frame.html' )
344
344
345
- expect {
346
- driver . action . scroll_by ( 0 , 200 , origin_x : -10 , origin_y : -10 ) . perform
347
- } . to raise_error ( Error ::MoveTargetOutOfBoundsError )
345
+ expect {
346
+ driver . action . scroll_by ( 0 , 200 , origin_x : -10 , origin_y : -10 ) . perform
347
+ } . to raise_error ( Error ::MoveTargetOutOfBoundsError )
348
+ end
348
349
end
349
350
end # ActionBuilder
350
351
end # WebDriver
0 commit comments