Skip to content

Commit

Permalink
Use Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Nov 16, 2021
1 parent 298d290 commit eeb58cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/capybara/cuprite/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def dismiss_prompt
end

def find_modal(options)
start = Ferrum.monotonic_time
start = Ferrum::Utils::ElapsedTime.monotonic_time
timeout = options.fetch(:wait, browser.timeout)
expect_text = options[:text]
expect_regexp = expect_text.is_a?(Regexp) ? expect_text : Regexp.escape(expect_text.to_s)
Expand All @@ -80,7 +80,7 @@ def find_modal(options)
modal_text = @modal_messages.shift
raise Capybara::ModalNotFound if modal_text.nil? || (expect_text && !modal_text.match(expect_regexp))
rescue Capybara::ModalNotFound => e
raise e, not_found_msg if Ferrum.timeout?(start, timeout)
raise e, not_found_msg if Ferrum::Utils::ElapsedTime.timeout?(start, timeout)

sleep(MODAL_WAIT)
retry
Expand Down
6 changes: 3 additions & 3 deletions spec/features/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def create_screenshot(file, *args)
expect(@driver.evaluate_script("window.result")).to eq(3)
end

it "supports stopping the session", skip: Ferrum.windows? do
it "supports stopping the session", skip: Ferrum::Utils::Platform.windows? do
driver = Capybara::Cuprite::Driver.new(nil)
pid = driver.browser.process.pid

Expand Down Expand Up @@ -1328,7 +1328,7 @@ def create_screenshot(file, *args)
it "sends sequences with modifiers and symbols" do
input = @session.find(:css, "#empty_input")

keys = Ferrum.mac? ? %i[Alt Left] : %i[Ctrl Left]
keys = Ferrum::Utils::Platform.mac? ? %i[Alt Left] : %i[Ctrl Left]

input.native.send_keys("t", "r", "i", "n", "g", keys, "s")

Expand All @@ -1338,7 +1338,7 @@ def create_screenshot(file, *args)
it "sends sequences with multiple modifiers and symbols" do
input = @session.find(:css, "#empty_input")

keys = Ferrum.mac? ? %i[Alt Shift Left] : %i[Ctrl Shift Left]
keys = Ferrum::Utils::Platform.mac? ? %i[Alt Shift Left] : %i[Ctrl Shift Left]

input.native.send_keys("t", "r", "i", "n", "g", keys, "s")

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 @@ -1035,7 +1035,7 @@
end
end

if Ferrum.mri? && !Ferrum.windows?
if Ferrum::Utils::Platform.mri? && !Ferrum::Utils::Platform.windows?
require "pty"
require "timeout"

Expand Down

0 comments on commit eeb58cd

Please sign in to comment.