Skip to content

Commit 796a2f3

Browse files
committed
Add regression spec for debug_url
there was already a unit test exercising the logic, but no feature test actually running against a real browser instance. expecting this spec to fail on the latest version of chrome.
1 parent 4fa8126 commit 796a2f3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

spec/features/driver_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,15 @@ def create_screenshot(file, *args)
16051605

16061606
expect(@session).to have_content("test_cookie")
16071607
end
1608+
1609+
it "has a working debug_url" do
1610+
session = Capybara::Session.new(:cuprite_with_inspector, TestApp)
1611+
session.visit "/cuprite/arbitrary_path/200"
1612+
1613+
expect do
1614+
URI.parse(session.driver.debug_url)
1615+
end.not_to raise_error
1616+
end
16081617
end
16091618
end
16101619
end

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
Capybara::Cuprite::Driver.new(app, options)
3131
end
3232

33+
Capybara.register_driver(:cuprite_with_inspector) do |app|
34+
Capybara::Cuprite::Driver.new(app, { inspector: true })
35+
end
36+
3337
module TestSessions
3438
Cuprite = Capybara::Session.new(:cuprite, TestApp)
3539
end

0 commit comments

Comments
 (0)