mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge pull request #1487 from eoinkelly/node-element
Fix API doc references to non-existent Capybara::Element
This commit is contained in:
commit
bea393fe98
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:
|
||||
#
|
||||
# session = Capybara::Session.new(:rack_test, my_app)
|
||||
|
@ -11,7 +11,7 @@ module Capybara
|
|||
# bar = session.find('#bar') # from Capybara::Node::Finders
|
||||
# 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:
|
||||
#
|
||||
# bar.value
|
||||
|
@ -93,10 +93,10 @@ module Capybara
|
|||
#
|
||||
def set(value, options={})
|
||||
options ||= {}
|
||||
|
||||
|
||||
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"
|
||||
end
|
||||
|
||||
|
@ -235,7 +235,7 @@ module Capybara
|
|||
# target = page.find('#bar')
|
||||
# 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)
|
||||
synchronize { base.drag_to(node.base) }
|
||||
|
@ -254,9 +254,9 @@ module Capybara
|
|||
end
|
||||
|
||||
def inspect
|
||||
%(#<Capybara::Element tag="#{tag_name}" path="#{path}">)
|
||||
%(#<Capybara::Node::Element tag="#{tag_name}" path="#{path}">)
|
||||
rescue NotSupportedByDriverError
|
||||
%(#<Capybara::Element tag="#{tag_name}">)
|
||||
%(#<Capybara::Node::Element tag="#{tag_name}">)
|
||||
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.
|
||||
#
|
||||
# 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 [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
|
||||
#
|
||||
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.
|
||||
#
|
||||
# @param [String] locator Which field to find
|
||||
# @return [Capybara::Element] The found element
|
||||
# @param [String] locator Which field to find
|
||||
# @return [Capybara::Node::Element] The found element
|
||||
#
|
||||
def 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.
|
||||
#
|
||||
# @param [String] locator Which link to find
|
||||
# @return [Capybara::Element] The found element
|
||||
# @param [String] locator Which link to find
|
||||
# @return [Capybara::Node::Element] The found element
|
||||
#
|
||||
def 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.
|
||||
#
|
||||
# @param [String] locator Which button to find
|
||||
# @return [Capybara::Element] The found element
|
||||
# @param [String] locator Which button to find
|
||||
# @return [Capybara::Node::Element] The found element
|
||||
#
|
||||
def find_button(locator, options={})
|
||||
find(:button, locator, options)
|
||||
|
@ -82,8 +82,8 @@ module Capybara
|
|||
#
|
||||
# Find a element on the page, given its id.
|
||||
#
|
||||
# @param [String] id Which element to find
|
||||
# @return [Capybara::Element] The found element
|
||||
# @param [String] id Which element to find
|
||||
# @return [Capybara::Node::Element] The found element
|
||||
#
|
||||
def find_by_id(id, options={})
|
||||
find(:id, id, options)
|
||||
|
@ -163,7 +163,7 @@ module Capybara
|
|||
# @param [:css, :xpath] kind The type of selector
|
||||
# @param [String] locator The selector
|
||||
# @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)
|
||||
all(*args).first
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'forwardable'
|
|||
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:
|
||||
#
|
||||
# * []
|
||||
|
@ -16,7 +16,7 @@ module Capybara
|
|||
# * last()
|
||||
# * empty?()
|
||||
#
|
||||
# @see Capybara::Element
|
||||
# @see Capybara::Node::Element
|
||||
#
|
||||
class Result
|
||||
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)
|
||||
# @param [Integer] index index of a frame
|
||||
|
|
Loading…
Reference in a new issue