Skip to content

Commit 9badae8

Browse files
committed
feat: add timeout accessor per page
1 parent 42728ae commit 9badae8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/capybara/cuprite/browser.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ def initialize(options = nil)
2323
@page = false
2424
end
2525

26+
def timeout=(value)
27+
super
28+
@page.timeout = value unless @page.nil?
29+
end
30+
2631
def page
2732
raise Ferrum::NoSuchPageError if @page.nil?
2833

spec/spec_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
require "support/external_browser"
1515

1616
puts ""
17-
command = Ferrum::Browser::Command.build({ window_size: [] }, nil)
17+
command = Ferrum::Browser::Command.build(Ferrum::Browser::Options.new, nil)
1818
puts `'#{command.path}' --version`
1919
puts ""
2020

@@ -69,6 +69,7 @@ module TestSessions
6969
#all with obscured filter should find top nodes outside the viewport when true
7070
#all with obscured filter should only find non-top nodes when true
7171
#fill_in should fill in a color field
72+
#fill_in should handle carriage returns with line feeds in a textarea correctly
7273
#has_field with valid should be false if field is invalid
7374
#find with spatial filters should find an element above another element
7475
#find with spatial filters should find an element below another element

spec/support/external_browser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Support
55
module ExternalBrowser
66
def with_external_browser
77
url = URI.parse("http://127.0.0.1:32001")
8-
opts = { host: url.host, port: url.port, window_size: [1400, 1400], headless: true }
8+
opts = Ferrum::Browser::Options.new(host: url.host, port: url.port, window_size: [1400, 1400], headless: true)
99
process = Ferrum::Browser::Process.new(opts)
1010

1111
begin

0 commit comments

Comments
 (0)