Module: Vapir::ModalDialog

Defined in:
lib/vapir-common/modal_dialog.rb

Constant Summary collapse

DEFAULT_TIMEOUT =
4

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



18
19
20
# File 'lib/vapir-common/modal_dialog.rb', line 18

def browser
  @browser
end

Returns the value of attribute modal_window.



19
20
21
# File 'lib/vapir-common/modal_dialog.rb', line 19

def modal_window
  @modal_window
end

Instance Method Details

#default_initialize(browser, options = {}) ⇒ Object Also known as: initialize



4
5
6
7
8
9
10
# File 'lib/vapir-common/modal_dialog.rb', line 4

def default_initialize(browser, options={})
  options=handle_options(options, :timeout => ModalDialog::DEFAULT_TIMEOUT, :error => true)
  @browser=browser
  ::Waiter.try_for(options[:timeout], :exception => (options[:error] && Vapir::Exception::NoMatchingWindowFoundException.new("No popup was found on the browser"))) do
    locate
  end
end

#locate!(options = {}) ⇒ Object Also known as: assert_exists



13
14
15
# File 'lib/vapir-common/modal_dialog.rb', line 13

def locate!(options={})
  exists? || raise(Vapir::Exception::WindowGoneException, "The modal dialog seems to have stopped existing.")
end