Module: Vapir::ModalDialog
- Defined in:
- lib/vapir-common/modal_dialog.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
4
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#modal_window ⇒ Object
readonly
Returns the value of attribute modal_window.
Instance Method Summary collapse
- #default_initialize(browser, options = {}) ⇒ Object (also: #initialize)
- #locate!(options = {}) ⇒ Object (also: #assert_exists)
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
18 19 20 |
# File 'lib/vapir-common/modal_dialog.rb', line 18 def browser @browser end |
#modal_window ⇒ Object (readonly)
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, ={}) =(, :timeout => ModalDialog::DEFAULT_TIMEOUT, :error => true) @browser=browser ::Waiter.try_for([:timeout], :exception => ([: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!(={}) exists? || raise(Vapir::Exception::WindowGoneException, "The modal dialog seems to have stopped existing.") end |