Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### Added

### Changed
- `Driver#current_url` and `Driver#title` read Ferrum's `url` and `title` of the window, not `current_url` and
`current_title` deprecated in Ferrum 0.21 [rubycdp/ferrum#687]

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions docs/1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ browser.downloads.files

A few things to keep in mind:

- It follows Capybara. Page methods such as `browser.evaluate`, `browser.css`
or `browser.current_url` run in the window and frame Capybara is switched to,
for example inside `within_window` or `within_frame`.
- It follows Capybara. Page methods such as `browser.evaluate` or `browser.css`
run in the window and frame Capybara is switched to, for example inside
`within_window` or `within_frame`.
- It's reset between tests. Capybara's reset disposes the browser context, so
headers, cookies, request interception, recorded traffic, console messages
and downloads are gone in the next test. Browser-wide settings such as
Expand Down
5 changes: 2 additions & 3 deletions lib/capybara/cuprite/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ class Driver < Capybara::Driver::Base
extend Forwardable
include Extensions

delegate %i[quit current_url title
window_handles current_window_handle close_window switch_to_window
refresh] => :browser
delegate %i[quit title window_handles current_window_handle close_window switch_to_window refresh] => :browser
delegate %i[send_keys] => :active_element
def_delegator :browser, :url, :current_url
def_delegator :browser, :body, :html
def_delegator :browser, :back, :go_back
def_delegator :browser, :forward, :go_forward
Expand Down
8 changes: 1 addition & 7 deletions lib/capybara/cuprite/page/frames.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ class Page < Ferrum::Page
module Frames
extend Forwardable

delegate %i[at_css at_xpath css xpath
current_url current_title body execution_id execution_id!
evaluate execute] => :active_frame
delegate %i[at_css at_xpath css xpath body execution_id execution_id! evaluate execute] => :active_frame

def initialize(...)
@frame_stack = []
Expand All @@ -28,10 +26,6 @@ def switch_to_frame(handle)
end
end

def title
active_frame.current_title
end

private

def active_frame
Expand Down
2 changes: 1 addition & 1 deletion spec/features/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@
browser.goto("http://example.com")
puts "Please type enter"
sleep 1
browser.current_url
browser.url
RUBY
end

Expand Down
Loading