mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge pull request #1033 from tricknotes/fix-method-comments
Fix method comments
This commit is contained in:
commit
ca0fbb2ae0
7 changed files with 19 additions and 20 deletions
|
@ -37,7 +37,7 @@ module Capybara
|
|||
# `Capybara.asset_host`.
|
||||
#
|
||||
# @param [String] html HTML code to inject into
|
||||
# @param [String] The modified HTML code
|
||||
# @return [String] The modified HTML code
|
||||
#
|
||||
def inject_asset_host(html)
|
||||
if Capybara.asset_host
|
||||
|
|
|
@ -44,8 +44,8 @@ module Capybara
|
|||
#
|
||||
# page.fill_in 'Name', :with => 'Bob'
|
||||
#
|
||||
# @param [String] locator Which field to fill in
|
||||
# @param [Hash{:with => String}] The value to fill in
|
||||
# @param [String] locator Which field to fill in
|
||||
# @param [Hash{:with => String}] options The value to fill in
|
||||
#
|
||||
def fill_in(locator, options={})
|
||||
raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
|
||||
|
@ -100,8 +100,8 @@ module Capybara
|
|||
#
|
||||
# page.select 'March', :from => 'Month'
|
||||
#
|
||||
# @param [String] value Which option to select
|
||||
# @param [Hash{:from => String}] The id, name or label of the select box
|
||||
# @param [String] value Which option to select
|
||||
# @param [Hash{:from => String}] options The id, name or label of the select box
|
||||
#
|
||||
def select(value, options={})
|
||||
if options.has_key?(:from)
|
||||
|
@ -120,8 +120,8 @@ module Capybara
|
|||
#
|
||||
# page.unselect 'March', :from => 'Month'
|
||||
#
|
||||
# @param [String] value Which option to unselect
|
||||
# @param [Hash{:from => String}] The id, name or label of the select box
|
||||
# @param [String] value Which option to unselect
|
||||
# @param [Hash{:from => String}] options The id, name or label of the select box
|
||||
#
|
||||
def unselect(value, options={})
|
||||
if options.has_key?(:from)
|
||||
|
|
|
@ -49,9 +49,8 @@ module Capybara
|
|||
# ignored. This behaviour can be overridden by passing `:all` to this
|
||||
# method.
|
||||
#
|
||||
# @param [:all, :visible] Whether to return only visible or all text
|
||||
#
|
||||
# @return [String] The text of the element
|
||||
# @param [:all, :visible] type Whether to return only visible or all text
|
||||
# @return [String] The text of the element
|
||||
#
|
||||
def text(type=nil)
|
||||
type ||= :all unless Capybara.ignore_hidden_elements or Capybara.visible_text_only
|
||||
|
|
|
@ -137,7 +137,7 @@ module Capybara
|
|||
# @overload first([kind], locator, options)
|
||||
# @param [:css, :xpath] kind The type of selector
|
||||
# @param [String] locator The selector
|
||||
# @param [Hash] options Additional options; see {all}
|
||||
# @param [Hash] options Additional options; see {#all}
|
||||
# @return [Capybara::Element] The found element or nil
|
||||
#
|
||||
def first(*args)
|
||||
|
|
|
@ -28,12 +28,12 @@ module Capybara
|
|||
# page.has_selector?(:xpath, XPath.descendant(:p))
|
||||
#
|
||||
# @param (see Capybara::Node::Finders#all)
|
||||
# @param options a customizable set of options
|
||||
# @option options [Integer] :count (nil) Number of times the text should occur
|
||||
# @option options [Integer] :minimum (nil) Minimum number of times the text should occur
|
||||
# @option options [Integer] :maximum (nil) Maximum number of times the text should occur
|
||||
# @option options [Range] :between (nil) Range of times that should contain number of times text occurs
|
||||
# @return [Boolean] If the expression exists
|
||||
# @param args
|
||||
# @option args [Integer] :count (nil) Number of times the text should occur
|
||||
# @option args [Integer] :minimum (nil) Minimum number of times the text should occur
|
||||
# @option args [Integer] :maximum (nil) Maximum number of times the text should occur
|
||||
# @option args [Range] :between (nil) Range of times that should contain number of times text occurs
|
||||
# @return [Boolean] If the expression exists
|
||||
#
|
||||
def has_selector?(*args)
|
||||
assert_selector(*args)
|
||||
|
|
|
@ -36,8 +36,8 @@ module Capybara
|
|||
#
|
||||
# element[:title] # => HTML title attribute
|
||||
#
|
||||
# @param [Symbol] attribute The attribute to retrieve
|
||||
# @return [String] The value of the attribute
|
||||
# @param [Symbol] name The attribute name to retrieve
|
||||
# @return [String] The value of the attribute
|
||||
#
|
||||
def [](name)
|
||||
attr_name = name.to_s
|
||||
|
|
|
@ -325,7 +325,7 @@ module Capybara
|
|||
#
|
||||
# Save a snapshot of the page and open it in a browser for inspection
|
||||
#
|
||||
# @param [String] path The path to where it should be saved [optional]
|
||||
# @param [String] file_name The path to where it should be saved [optional]
|
||||
#
|
||||
def save_and_open_page(file_name=nil)
|
||||
require "launchy"
|
||||
|
|
Loading…
Add table
Reference in a new issue