mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Removed deprecated stuff
This commit is contained in:
parent
d34c2bf10a
commit
9bf7894d31
7 changed files with 5 additions and 55 deletions
|
@ -53,11 +53,6 @@ class Capybara::Driver::Base
|
|||
def reset!
|
||||
end
|
||||
|
||||
def cleanup!
|
||||
Capybara.deprecate("cleanup!", "reset!")
|
||||
reset!
|
||||
end
|
||||
|
||||
def has_shortcircuit_timeout?
|
||||
false
|
||||
end
|
||||
|
|
|
@ -72,15 +72,6 @@ module Capybara
|
|||
base.native
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# @deprecated node is deprecated, please use {Capybara::Element#native} instead
|
||||
#
|
||||
def node
|
||||
Capybara.deprecate("node", "native")
|
||||
native
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# @return [String] The text of the element
|
||||
|
|
|
@ -13,6 +13,7 @@ module Capybara
|
|||
msg = "no link or button '#{locator}' found"
|
||||
find(:xpath, XPath::HTML.link_or_button(locator), :message => msg).click
|
||||
end
|
||||
alias_method :click_on, :click_link_or_button
|
||||
|
||||
##
|
||||
#
|
||||
|
@ -153,18 +154,6 @@ module Capybara
|
|||
msg = "cannot attach file, no file field with id, name, or label '#{locator}' found"
|
||||
find(:xpath, XPath::HTML.file_field(locator), :message => msg).set(path)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# Drag one element to another
|
||||
#
|
||||
# @deprecated Use Capybara::Element#drag_to instead.
|
||||
#
|
||||
def drag(source_locator, target_locator)
|
||||
source = find(:xpath, source_locator, :message => "drag source '#{source_locator}' not found on page")
|
||||
target = find(:xpath, target_locator, :message => "drag target '#{target_locator}' not found on page")
|
||||
source.drag_to(target)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,15 +31,6 @@ module Capybara
|
|||
return node
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# @deprecated {#find} now behaves like locate used to. Use {#find} instead.
|
||||
#
|
||||
def locate(*args)
|
||||
Capybara.deprecate("locate", "find")
|
||||
find(*args)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# Find a form field on the page. The field can be found by its name, id or label text.
|
||||
|
|
|
@ -32,7 +32,7 @@ module Capybara
|
|||
:has_no_content?, :has_no_css?, :has_no_xpath?, :has_xpath?, :locate, :save_and_open_page, :select, :source, :uncheck,
|
||||
:visit, :wait_until, :within, :within_fieldset, :within_table, :within_frame, :within_window, :has_link?, :has_no_link?, :has_button?,
|
||||
:has_no_button?, :has_field?, :has_no_field?, :has_checked_field?, :has_unchecked_field?, :has_no_table?, :has_table?,
|
||||
:unselect, :has_select?, :has_no_select?, :current_path, :click, :has_selector?, :has_no_selector?
|
||||
:unselect, :has_select?, :has_no_select?, :current_path, :click, :has_selector?, :has_no_selector?, :click_on
|
||||
]
|
||||
|
||||
attr_reader :mode, :app
|
||||
|
@ -247,15 +247,6 @@ module Capybara
|
|||
driver.evaluate_script(script)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# @deprecated click is deprecated, please use {Capybara::Node::Actions#click_link_or_button} instead
|
||||
#
|
||||
def click(locator)
|
||||
Capybara.deprecate("click", "click_link_or_button")
|
||||
current_node.click_link_or_button(locator)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# Save a snapshot of the page and open it in a browser for inspection
|
||||
|
|
|
@ -18,10 +18,9 @@ shared_examples_for "click_link_or_button" do
|
|||
extract_results(@session)['first_name'].should == 'John'
|
||||
end
|
||||
|
||||
it "should be aliased as click for backward compatibility" do
|
||||
Capybara.should_receive(:deprecate).with("click", "click_link_or_button")
|
||||
it "should be aliased as click_on" do
|
||||
@session.visit('/form')
|
||||
@session.click('awe123')
|
||||
@session.click_on('awe123')
|
||||
extract_results(@session)['first_name'].should == 'John'
|
||||
end
|
||||
|
||||
|
|
|
@ -13,12 +13,6 @@ shared_examples_for "find" do
|
|||
@session.find("//input[@id='test_field']")[:value].should == 'monkey'
|
||||
end
|
||||
|
||||
it "should be aliased as locate for backward compatibility" do
|
||||
Capybara.should_receive(:deprecate).with("locate", "find").twice
|
||||
@session.locate('//h1').text.should == 'This is a test'
|
||||
@session.locate("//input[@id='test_field']")[:value].should == 'monkey'
|
||||
end
|
||||
|
||||
it "should find the first element using the given locator and options" do
|
||||
@session.find('//a', :text => 'Redirect')[:id].should == 'red'
|
||||
@session.find(:css, 'a', :text => 'A link')[:title].should == 'twas a fine link'
|
||||
|
|
Loading…
Reference in a new issue