return current_url for application (webdriver, culerity)

This commit is contained in:
Andrew Brown 2009-12-16 15:16:52 +01:00
parent 7b8e6a640d
commit 22f8727114
5 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,8 @@
class Capybara::Driver::Base
def current_url
raise "Not implemented"
end
def visit(path)
raise "Not implemented"
end

View File

@ -65,6 +65,10 @@ class Capybara::Driver::Culerity < Capybara::Driver::Base
browser.html
end
def current_url
browser.url
end
def find(selector)
browser.elements_by_xpath(selector).map { |node| Node.new(self, node) }
end

View File

@ -76,6 +76,10 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
driver.page_source
end
def current_url
driver.current_url
end
def find(selector)
driver.find_elements(:xpath, selector).map { |node| Node.new(self, node) }
end

View File

@ -47,7 +47,7 @@ module Capybara
end
SESSION_METHODS = [
:visit, :body, :click_link, :click_button, :drag, :fill_in, :choose, :has_xpath?, :has_css?,
:visit, :current_url, :body, :click_link, :click_button, :drag, :fill_in, :choose, :has_xpath?, :has_css?,
:check, :uncheck, :attach_file, :select, :has_content?, :within, :within_fieldset,
:within_table, :save_and_open_page, :find, :find_field, :find_link, :find_button,
:field_labeled, :all, :wait_for, :evaluate_script, :click, :click_element

View File

@ -21,6 +21,10 @@ module Capybara
end
end
def current_url
driver.current_url
end
def visit(path)
driver.visit(path)
end