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`.
|
# `Capybara.asset_host`.
|
||||||
#
|
#
|
||||||
# @param [String] html HTML code to inject into
|
# @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)
|
def inject_asset_host(html)
|
||||||
if Capybara.asset_host
|
if Capybara.asset_host
|
||||||
|
|
|
@ -44,8 +44,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# page.fill_in 'Name', :with => 'Bob'
|
# page.fill_in 'Name', :with => 'Bob'
|
||||||
#
|
#
|
||||||
# @param [String] locator Which field to fill in
|
# @param [String] locator Which field to fill in
|
||||||
# @param [Hash{:with => String}] The value to fill in
|
# @param [Hash{:with => String}] options The value to fill in
|
||||||
#
|
#
|
||||||
def fill_in(locator, options={})
|
def fill_in(locator, options={})
|
||||||
raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
|
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'
|
# page.select 'March', :from => 'Month'
|
||||||
#
|
#
|
||||||
# @param [String] value Which option to select
|
# @param [String] value Which option to select
|
||||||
# @param [Hash{:from => String}] The id, name or label of the select box
|
# @param [Hash{:from => String}] options The id, name or label of the select box
|
||||||
#
|
#
|
||||||
def select(value, options={})
|
def select(value, options={})
|
||||||
if options.has_key?(:from)
|
if options.has_key?(:from)
|
||||||
|
@ -120,8 +120,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# page.unselect 'March', :from => 'Month'
|
# page.unselect 'March', :from => 'Month'
|
||||||
#
|
#
|
||||||
# @param [String] value Which option to unselect
|
# @param [String] value Which option to unselect
|
||||||
# @param [Hash{:from => String}] The id, name or label of the select box
|
# @param [Hash{:from => String}] options The id, name or label of the select box
|
||||||
#
|
#
|
||||||
def unselect(value, options={})
|
def unselect(value, options={})
|
||||||
if options.has_key?(:from)
|
if options.has_key?(:from)
|
||||||
|
|
|
@ -49,9 +49,8 @@ module Capybara
|
||||||
# ignored. This behaviour can be overridden by passing `:all` to this
|
# ignored. This behaviour can be overridden by passing `:all` to this
|
||||||
# method.
|
# method.
|
||||||
#
|
#
|
||||||
# @param [:all, :visible] Whether to return only visible or all text
|
# @param [:all, :visible] type Whether to return only visible or all text
|
||||||
#
|
# @return [String] The text of the element
|
||||||
# @return [String] The text of the element
|
|
||||||
#
|
#
|
||||||
def text(type=nil)
|
def text(type=nil)
|
||||||
type ||= :all unless Capybara.ignore_hidden_elements or Capybara.visible_text_only
|
type ||= :all unless Capybara.ignore_hidden_elements or Capybara.visible_text_only
|
||||||
|
|
|
@ -137,7 +137,7 @@ module Capybara
|
||||||
# @overload first([kind], locator, options)
|
# @overload first([kind], locator, options)
|
||||||
# @param [:css, :xpath] kind The type of selector
|
# @param [:css, :xpath] kind The type of selector
|
||||||
# @param [String] locator The 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
|
# @return [Capybara::Element] The found element or nil
|
||||||
#
|
#
|
||||||
def first(*args)
|
def first(*args)
|
||||||
|
|
|
@ -28,12 +28,12 @@ module Capybara
|
||||||
# page.has_selector?(:xpath, XPath.descendant(:p))
|
# page.has_selector?(:xpath, XPath.descendant(:p))
|
||||||
#
|
#
|
||||||
# @param (see Capybara::Node::Finders#all)
|
# @param (see Capybara::Node::Finders#all)
|
||||||
# @param options a customizable set of options
|
# @param args
|
||||||
# @option options [Integer] :count (nil) Number of times the text should occur
|
# @option args [Integer] :count (nil) Number of times the text should occur
|
||||||
# @option options [Integer] :minimum (nil) Minimum number of times the text should occur
|
# @option args [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 args [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
|
# @option args [Range] :between (nil) Range of times that should contain number of times text occurs
|
||||||
# @return [Boolean] If the expression exists
|
# @return [Boolean] If the expression exists
|
||||||
#
|
#
|
||||||
def has_selector?(*args)
|
def has_selector?(*args)
|
||||||
assert_selector(*args)
|
assert_selector(*args)
|
||||||
|
|
|
@ -36,8 +36,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# element[:title] # => HTML title attribute
|
# element[:title] # => HTML title attribute
|
||||||
#
|
#
|
||||||
# @param [Symbol] attribute The attribute to retrieve
|
# @param [Symbol] name The attribute name to retrieve
|
||||||
# @return [String] The value of the attribute
|
# @return [String] The value of the attribute
|
||||||
#
|
#
|
||||||
def [](name)
|
def [](name)
|
||||||
attr_name = name.to_s
|
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
|
# 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)
|
def save_and_open_page(file_name=nil)
|
||||||
require "launchy"
|
require "launchy"
|
||||||
|
|
Loading…
Add table
Reference in a new issue