Class: AePageObjects::MultipleWindows::WindowList

Inherits:
Object
  • Object
show all
Defined in:
lib/ae_page_objects/multiple_windows/window_list.rb

Instance Method Summary collapse

Constructor Details

#initializeWindowList

Returns a new instance of WindowList.



4
5
6
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 4

def initialize
  @windows = {}
end

Instance Method Details

#add(window) ⇒ Object



8
9
10
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 8

def add(window)
  @windows[window.handle] = window
end

#close_allObject



28
29
30
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 28

def close_all
  opened.each(&:close)
end

#current_windowObject



22
23
24
25
26
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 22

def current_window
  current_handle = WindowHandleManager.current

  find(current_handle) if current_handle
end

#openedObject



16
17
18
19
20
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 16

def opened
  WindowHandleManager.all.map do |handle|
    find(handle)
  end
end

#remove(window) ⇒ Object



12
13
14
# File 'lib/ae_page_objects/multiple_windows/window_list.rb', line 12

def remove(window)
  @windows.delete(window.handle)
end