File: internet_explorer_driver.rb

package info (click to toggle)
ruby-capybara 3.40.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,368 kB
  • sloc: ruby: 23,988; javascript: 752; makefile: 11
file content (26 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'capybara/selenium/nodes/ie_node'

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

    # iedriverserver has an issue if the current frame is removed from within it
    # so we have to move to the default_content and iterate back through the frames
    handles = @frame_handles[current_window_handle]
    browser.switch_to.default_content
    handles.tap(&:pop).each { |fh| browser.switch_to.frame(fh.native) }
  end

private

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

module Capybara::Selenium
  Driver.register_specialization :ie, Driver::InternetExplorerDriver
  Driver.register_specialization :internet_explorer, Driver::InternetExplorerDriver
end