mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix API doc references to non-existent Capybara::Element
This commit is contained in:
parent
0355c9a1c0
commit
988a4f7acc
4 changed files with 21 additions and 21 deletions
|
@ -3,7 +3,7 @@ module Capybara
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
# A {Capybara::Element} represents a single element on the page. It is possible
|
# A {Capybara::Node::Element} represents a single element on the page. It is possible
|
||||||
# to interact with the contents of this element the same as with a document:
|
# to interact with the contents of this element the same as with a document:
|
||||||
#
|
#
|
||||||
# session = Capybara::Session.new(:rack_test, my_app)
|
# session = Capybara::Session.new(:rack_test, my_app)
|
||||||
|
@ -11,7 +11,7 @@ module Capybara
|
||||||
# bar = session.find('#bar') # from Capybara::Node::Finders
|
# bar = session.find('#bar') # from Capybara::Node::Finders
|
||||||
# bar.select('Baz', :from => 'Quox') # from Capybara::Node::Actions
|
# bar.select('Baz', :from => 'Quox') # from Capybara::Node::Actions
|
||||||
#
|
#
|
||||||
# {Capybara::Element} also has access to HTML attributes and other properties of the
|
# {Capybara::Node::Element} also has access to HTML attributes and other properties of the
|
||||||
# element:
|
# element:
|
||||||
#
|
#
|
||||||
# bar.value
|
# bar.value
|
||||||
|
@ -93,10 +93,10 @@ module Capybara
|
||||||
#
|
#
|
||||||
def set(value, options={})
|
def set(value, options={})
|
||||||
options ||= {}
|
options ||= {}
|
||||||
|
|
||||||
driver_supports_options = (base.method(:set).arity != 1)
|
driver_supports_options = (base.method(:set).arity != 1)
|
||||||
|
|
||||||
unless options.empty? || driver_supports_options
|
unless options.empty? || driver_supports_options
|
||||||
warn "Options passed to Capybara::Node#set but the driver doesn't support them"
|
warn "Options passed to Capybara::Node#set but the driver doesn't support them"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ module Capybara
|
||||||
# target = page.find('#bar')
|
# target = page.find('#bar')
|
||||||
# source.drag_to(target)
|
# source.drag_to(target)
|
||||||
#
|
#
|
||||||
# @param [Capybara::Element] node The element to drag to
|
# @param [Capybara::Node::Element] node The element to drag to
|
||||||
#
|
#
|
||||||
def drag_to(node)
|
def drag_to(node)
|
||||||
synchronize { base.drag_to(node.base) }
|
synchronize { base.drag_to(node.base) }
|
||||||
|
@ -254,9 +254,9 @@ module Capybara
|
||||||
end
|
end
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
%(#<Capybara::Element tag="#{tag_name}" path="#{path}">)
|
%(#<Capybara::Node::Element tag="#{tag_name}" path="#{path}">)
|
||||||
rescue NotSupportedByDriverError
|
rescue NotSupportedByDriverError
|
||||||
%(#<Capybara::Element tag="#{tag_name}">)
|
%(#<Capybara::Node::Element tag="#{tag_name}">)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Capybara
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
# Find an {Capybara::Element} based on the given arguments. +find+ will raise an error if the element
|
# Find an {Capybara::Node::Element} based on the given arguments. +find+ will raise an error if the element
|
||||||
# is not found.
|
# is not found.
|
||||||
#
|
#
|
||||||
# If the driver is capable of executing JavaScript, +find+ will wait for a set amount of time
|
# If the driver is capable of executing JavaScript, +find+ will wait for a set amount of time
|
||||||
|
@ -22,7 +22,7 @@ module Capybara
|
||||||
# @option options [Boolean] match The matching strategy to use.
|
# @option options [Boolean] match The matching strategy to use.
|
||||||
# @option options [false, Numeric] wait How long to wait for the element to appear.
|
# @option options [false, Numeric] wait How long to wait for the element to appear.
|
||||||
#
|
#
|
||||||
# @return [Capybara::Element] The found element
|
# @return [Capybara::Node::Element] The found element
|
||||||
# @raise [Capybara::ElementNotFound] If the element can't be found before time expires
|
# @raise [Capybara::ElementNotFound] If the element can't be found before time expires
|
||||||
#
|
#
|
||||||
def find(*args)
|
def find(*args)
|
||||||
|
@ -48,8 +48,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# Find a form field on the page. The field can be found by its name, id or label text.
|
# Find a form field on the page. The field can be found by its name, id or label text.
|
||||||
#
|
#
|
||||||
# @param [String] locator Which field to find
|
# @param [String] locator Which field to find
|
||||||
# @return [Capybara::Element] The found element
|
# @return [Capybara::Node::Element] The found element
|
||||||
#
|
#
|
||||||
def find_field(locator, options={})
|
def find_field(locator, options={})
|
||||||
find(:field, locator, options)
|
find(:field, locator, options)
|
||||||
|
@ -60,8 +60,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# Find a link on the page. The link can be found by its id or text.
|
# Find a link on the page. The link can be found by its id or text.
|
||||||
#
|
#
|
||||||
# @param [String] locator Which link to find
|
# @param [String] locator Which link to find
|
||||||
# @return [Capybara::Element] The found element
|
# @return [Capybara::Node::Element] The found element
|
||||||
#
|
#
|
||||||
def find_link(locator, options={})
|
def find_link(locator, options={})
|
||||||
find(:link, locator, options)
|
find(:link, locator, options)
|
||||||
|
@ -71,8 +71,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# Find a button on the page. The button can be found by its id, name or value.
|
# Find a button on the page. The button can be found by its id, name or value.
|
||||||
#
|
#
|
||||||
# @param [String] locator Which button to find
|
# @param [String] locator Which button to find
|
||||||
# @return [Capybara::Element] The found element
|
# @return [Capybara::Node::Element] The found element
|
||||||
#
|
#
|
||||||
def find_button(locator, options={})
|
def find_button(locator, options={})
|
||||||
find(:button, locator, options)
|
find(:button, locator, options)
|
||||||
|
@ -82,8 +82,8 @@ module Capybara
|
||||||
#
|
#
|
||||||
# Find a element on the page, given its id.
|
# Find a element on the page, given its id.
|
||||||
#
|
#
|
||||||
# @param [String] id Which element to find
|
# @param [String] id Which element to find
|
||||||
# @return [Capybara::Element] The found element
|
# @return [Capybara::Node::Element] The found element
|
||||||
#
|
#
|
||||||
def find_by_id(id, options={})
|
def find_by_id(id, options={})
|
||||||
find(:id, id, options)
|
find(:id, id, options)
|
||||||
|
@ -163,7 +163,7 @@ module Capybara
|
||||||
# @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::Node::Element] The found element or nil
|
||||||
#
|
#
|
||||||
def first(*args)
|
def first(*args)
|
||||||
all(*args).first
|
all(*args).first
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'forwardable'
|
||||||
module Capybara
|
module Capybara
|
||||||
|
|
||||||
##
|
##
|
||||||
# A {Capybara::Result} represents a collection of {Capybara::Element} on the page. It is possible to interact with this
|
# A {Capybara::Result} represents a collection of {Capybara::Node::Element} on the page. It is possible to interact with this
|
||||||
# collection similar to an Array because it implements Enumerable and offers the following Array methods through delegation:
|
# collection similar to an Array because it implements Enumerable and offers the following Array methods through delegation:
|
||||||
#
|
#
|
||||||
# * []
|
# * []
|
||||||
|
@ -16,7 +16,7 @@ module Capybara
|
||||||
# * last()
|
# * last()
|
||||||
# * empty?()
|
# * empty?()
|
||||||
#
|
#
|
||||||
# @see Capybara::Element
|
# @see Capybara::Node::Element
|
||||||
#
|
#
|
||||||
class Result
|
class Result
|
||||||
include Enumerable
|
include Enumerable
|
||||||
|
|
|
@ -116,7 +116,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
# Webdriver supports frame name, id, index(zero-based) or {Capybara::Element} to find iframe
|
# Webdriver supports frame name, id, index(zero-based) or {Capybara::Node::Element} to find iframe
|
||||||
#
|
#
|
||||||
# @overload within_frame(index)
|
# @overload within_frame(index)
|
||||||
# @param [Integer] index index of a frame
|
# @param [Integer] index index of a frame
|
||||||
|
|
Loading…
Reference in a new issue