Sha256: aedd82d010e230157861759c7c667769fe91a00c8330e136b964f1db6df89691

Contents?: true

Size: 845 Bytes

Versions: 4

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

require 'capybara/selenium/nodes/safari_node'

module Capybara::Selenium::Driver::SafariDriver
  def switch_to_frame(frame)
    return super unless frame == :parent

    # safaridriver/safari has an issue where switch_to_frame(:parent)
    # behaves like switch_to_frame(:top)
    handles = @frame_handles[current_window_handle]
    browser.switch_to.default_content
    handles.tap(&:pop).each { |fh| browser.switch_to.frame(fh) }
  end

private

  def build_node(native_node, initial_cache = {})
    ::Capybara::Selenium::SafariNode.new(self, native_node, initial_cache)
  end

  def bridge
    browser.send(:bridge)
  end
end

Capybara::Selenium::Driver.register_specialization(/^(safari|Safari_Technology_Preview)$/,
                                                   Capybara::Selenium::Driver::SafariDriver)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capybara-3.19.1 lib/capybara/selenium/driver_specializations/safari_driver.rb
capybara-3.19.0 lib/capybara/selenium/driver_specializations/safari_driver.rb
capybara-3.18.0 lib/capybara/selenium/driver_specializations/safari_driver.rb
capybara-3.17.0 lib/capybara/selenium/driver_specializations/safari_driver.rb