Skip to content

Commit 6652c1a

Browse files
committed
[rb] fix bug in default durations
1 parent f677d2d commit 6652c1a

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

rb/lib/selenium/webdriver/common/interactions/pointer_actions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module PointerActions
2828
#
2929

3030
def default_move_duration
31-
@default_move_duration ||= @duration / 1000 # convert ms to seconds
31+
@default_move_duration ||= @duration / 1000.0 # convert ms to seconds
3232
end
3333

3434
#

rb/lib/selenium/webdriver/common/interactions/wheel_actions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module WheelActions
2828
#
2929

3030
def default_scroll_duration
31-
@default_scroll_duration ||= @duration / 1000 # convert ms to seconds
31+
@default_scroll_duration ||= @duration / 1000.0 # convert ms to seconds
3232
end
3333

3434
#

rb/spec/integration/selenium/webdriver/action_builder_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ module WebDriver
262262

263263
describe 'pen stylus', except: {browser: :firefox, reason: 'Unknown pointerType'} do
264264
it 'sets pointer event properties' do
265-
driver.get 'https://titusfortner.com/examples/pointerActionsPage.html'
265+
driver.navigate.to url_for('pointerActionsPage.html')
266266
pointer_area = driver.find_element(id: 'pointerArea')
267267
rect = pointer_area.rect
268268
x_val = rect.x

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize
2929

3030
extract_browser_from_bazel_target_name
3131

32-
@driver = ENV.fetch('WD_SPEC_DRIVER', :firefox).to_sym
32+
@driver = ENV.fetch('WD_SPEC_DRIVER', :chrome).to_sym
3333
@driver_instance = nil
3434
end
3535

rb/spec/unit/selenium/webdriver/common/action_builder_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ module WebDriver
6060
expect(action_builder.devices).to eq([mouse, keyboard, none, touch])
6161
end
6262

63+
it 'accepts duration' do
64+
action_builder = ActionBuilder.new(bridge, duration: 2200)
65+
expect(action_builder.default_move_duration).to eq(2.2)
66+
end
67+
6368
it 'does not accept additional devices if deprecated parameters are used' do
6469
none = Interactions.none('none')
6570
touch = Interactions.pointer(:touch, name: 'touch')

0 commit comments

Comments
 (0)