mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
return current_url for application (webdriver, culerity)
This commit is contained in:
parent
7b8e6a640d
commit
22f8727114
5 changed files with 17 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
|||
class Capybara::Driver::Base
|
||||
def current_url
|
||||
raise "Not implemented"
|
||||
end
|
||||
|
||||
def visit(path)
|
||||
raise "Not implemented"
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,10 @@ module Capybara
|
|||
end
|
||||
end
|
||||
|
||||
def current_url
|
||||
driver.current_url
|
||||
end
|
||||
|
||||
def visit(path)
|
||||
driver.visit(path)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue