Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ Set the scrolling timeout:
Role: role1
Strategy: id/css/xpath/uiautomator/class_chain/...
Id: //some/path
ScrollTimeout: 90 (In seconds - default is 60)
ScrollTimeout: 90 (In seconds - default is the global timeout)

Instruct the target element to be scrolled into full view. This means that once the element is visible, one additional swipe will be executed from the element location, to either the top or the bottom of the scroll target (depending on the scroll direction configured in the swipe action).

Expand Down
8 changes: 4 additions & 4 deletions lib/core/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def scroll_until_element_visible(action)
scroll_mul /= convert_value(sw_action["SwipeSpeedMultiplier"]).to_f if sw_action.key?("SwipeSpeedMultiplier")
scroll_pause = convert_value(sw_action["SwipePauseDuration"]).to_f if sw_action.key?("SwipePauseDuration")
end
scroll_timeout = action.key?("ScrollTimeout") ? convert_value(action["ScrollTimeout"]).to_f : 60
scroll_timeout = action.key?("ScrollTimeout") ? convert_value(action["ScrollTimeout"]).to_f : @timeout
# calculate the exact coordinates for swiping,
# depending on whether a specific element to swipe on is provided
if action.key?("ScrollTarget")
Expand Down Expand Up @@ -804,9 +804,9 @@ def scroll_until_element_visible(action)
bg_el = wait_for(action["ScrollTarget"])
y_top = bg_el.location.y
y_bottom = bg_el.location.y + bg_el.size.height
x_point = bg_el.location.x + (bg_el.size.width * x_frac)
y_start = y_top + (bg_el.size.height * y_start_frac)
y_end = y_top + (bg_el.size.height * y_end_frac)
x_point = bg_el.location.x + (bg_el.size.width * (0.5 + x_frac))
y_start = y_top + (bg_el.size.height * (0.5 + y_start_frac))
y_end = y_top + (bg_el.size.height * (0.5 + y_end_frac))
end
# raise error if timeout exceeded
return if original_noraise
Expand Down