Class: AePageObjects::MultipleWindows::Window

Inherits:
SingleWindow::Window show all
Defined in:
lib/ae_page_objects/multiple_windows/window.rb

Instance Attribute Summary collapse

Attributes inherited from SingleWindow::Window

#current_document

Instance Method Summary collapse

Methods inherited from SingleWindow::Window

#change_to

Constructor Details

#initialize(registry, handle) ⇒ Window

Returns a new instance of Window.



10
11
12
13
14
15
16
17
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 10

def initialize(registry, handle)
  @registry = registry
  @handle   = handle

  @registry.add(self)

  super()
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



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

def handle
  @handle
end

Instance Method Details

#closeObject



24
25
26
27
28
29
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 24

def close
  if WindowHandleManager.close(@handle)
    self.current_document = nil
    @registry.remove(self)
  end
end

#switch_toObject



19
20
21
22
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 19

def switch_to
  WindowHandleManager.switch_to(handle)
  current_document
end