Readded click with deprecation warning
This commit is contained in:
parent
4fea4ade25
commit
ca703d242d
|
@ -235,6 +235,15 @@ module Capybara
|
|||
driver.evaluate_script(script)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# @deprecated click is deprecated, please use {Capybara::Node::Actions#click_link_or_button} instead
|
||||
#
|
||||
def click(locator)
|
||||
warn "DEPRECATED: click is deprecated, use click_link_or_button instead"
|
||||
current_node.click_link_or_button(locator)
|
||||
end
|
||||
|
||||
##
|
||||
#
|
||||
# Save a snapshot of the page and open it in a browser for inspection
|
||||
|
|
|
@ -12,6 +12,12 @@ 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
|
||||
@session.visit('/form')
|
||||
@session.click('awe123')
|
||||
extract_results(@session)['first_name'].should == 'John'
|
||||
end
|
||||
|
||||
context "with a locator that doesn't exist" do
|
||||
it "should raise an error" do
|
||||
@session.visit('/with_html')
|
||||
|
|
Loading…
Reference in New Issue