Skip to content

Commit

Permalink
Document wait option on methods where it was undocumented
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed May 23, 2019
1 parent 871652d commit b50bb0c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/capybara/node/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ def set(value, **options)

##
#
# Select this node if is an option element inside a select tag
# Select this node if it is an option element inside a select tag
#
# @!macro action_waiting_behavior
# If the driver dynamic pages (JS) and the element is currently non-interactable, this method will
# continuously retry the action until either the element becomes interactable or the maximum
# wait time expires.
#
# @param [false, Numeric] wait
# Maximum time to wait for the action to succeed. Defaults to {Capybara.configure default_max_wait_time}.
# @return [Capybara::Node::Element] The element
def select_option(wait: nil)
synchronize(wait) { base.select_option }
Expand All @@ -132,8 +139,9 @@ def select_option(wait: nil)

##
#
# Unselect this node if is an option element inside a multiple select tag
# Unselect this node if it is an option element inside a multiple select tag
#
# @macro action_waiting_behavior
# @return [Capybara::Node::Element] The element
def unselect_option(wait: nil)
synchronize(wait) { base.unselect_option }
Expand All @@ -144,9 +152,10 @@ def unselect_option(wait: nil)
#
# Click the Element
#
# @macro action_waiting_behavior
# @!macro click_modifiers
# Both x: and y: must be specified if an offset is wanted, if not specified the click will occur at the middle of the element
# @overload $0(*modifier_keys, **offset)
# Both x: and y: must be specified if an offset is wanted, if not specified the click will occur at the middle of the element.
# @overload $0(*modifier_keys, wait: nil, **offset)
# @param *modifier_keys [:alt, :control, :meta, :shift] ([]) Keys to be held down when clicking
# @option offset [Integer] x X coordinate to offset the click location from the top left corner of the element
# @option offset [Integer] y Y coordinate to offset the click location from the top left corner of the element
Expand All @@ -162,6 +171,7 @@ def click(*keys, wait: nil, **offset)
#
# Right Click the Element
#
# @macro action_waiting_behavior
# @macro click_modifiers
# @return [Capybara::Node::Element] The element
def right_click(*keys, wait: nil, **offset)
Expand All @@ -175,6 +185,7 @@ def right_click(*keys, wait: nil, **offset)
#
# Double Click the Element
#
# @macro action_waiting_behavior
# @macro click_modifiers
# @return [Capybara::Node::Element] The element
def double_click(*keys, wait: nil, **offset)
Expand Down

0 comments on commit b50bb0c

Please sign in to comment.