return current_url for application (webdriver, culerity)
This commit is contained in:
parent
7b8e6a640d
commit
22f8727114
|
@ -1,4 +1,8 @@
|
||||||
class Capybara::Driver::Base
|
class Capybara::Driver::Base
|
||||||
|
def current_url
|
||||||
|
raise "Not implemented"
|
||||||
|
end
|
||||||
|
|
||||||
def visit(path)
|
def visit(path)
|
||||||
raise "Not implemented"
|
raise "Not implemented"
|
||||||
end
|
end
|
||||||
|
|
|
@ -65,6 +65,10 @@ class Capybara::Driver::Culerity < Capybara::Driver::Base
|
||||||
browser.html
|
browser.html
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_url
|
||||||
|
browser.url
|
||||||
|
end
|
||||||
|
|
||||||
def find(selector)
|
def find(selector)
|
||||||
browser.elements_by_xpath(selector).map { |node| Node.new(self, node) }
|
browser.elements_by_xpath(selector).map { |node| Node.new(self, node) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,6 +76,10 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
|
||||||
driver.page_source
|
driver.page_source
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_url
|
||||||
|
driver.current_url
|
||||||
|
end
|
||||||
|
|
||||||
def find(selector)
|
def find(selector)
|
||||||
driver.find_elements(:xpath, selector).map { |node| Node.new(self, node) }
|
driver.find_elements(:xpath, selector).map { |node| Node.new(self, node) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,7 +47,7 @@ module Capybara
|
||||||
end
|
end
|
||||||
|
|
||||||
SESSION_METHODS = [
|
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,
|
:check, :uncheck, :attach_file, :select, :has_content?, :within, :within_fieldset,
|
||||||
:within_table, :save_and_open_page, :find, :find_field, :find_link, :find_button,
|
:within_table, :save_and_open_page, :find, :find_field, :find_link, :find_button,
|
||||||
:field_labeled, :all, :wait_for, :evaluate_script, :click, :click_element
|
:field_labeled, :all, :wait_for, :evaluate_script, :click, :click_element
|
||||||
|
|
|
@ -21,6 +21,10 @@ module Capybara
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def current_url
|
||||||
|
driver.current_url
|
||||||
|
end
|
||||||
|
|
||||||
def visit(path)
|
def visit(path)
|
||||||
driver.visit(path)
|
driver.visit(path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue