Module: Fluent::Enclosers
- Included in:
- Fluent
- Defined in:
- lib/fluent/enclosers.rb
Instance Method Summary collapse
-
#will_alert(&block) ⇒ String
Provides a context for an action that will generate a JavaScript alert message box.
-
#will_confirm(response, &block) ⇒ String
Provides a context for an action that will generate a JavaScript confirmation message box.
-
#will_prompt(response, &block) ⇒ Hash
Provides a context for an action that will generate a JavaScript prompt message box.
-
#within_modal(&block) ⇒ Object
Used to identify a web element as existing within an enclosing object like a modal dialog box.
-
#within_window(locator, &block) ⇒ Object
(also: #select_window, #attach_to)
Used to identify a web element or action on a web element as existing within an enclosing window object.
Instance Method Details
#will_alert(&block) ⇒ String
Provides a context for an action that will generate a JavaScript alert message box. The alert invocation will be overridden by the platform.
9 10 11 |
# File 'lib/fluent/enclosers.rb', line 9 def will_alert(&block) platform.will_alert(&block) end |
#will_confirm(response, &block) ⇒ String
Provides a context for an action that will generate a JavaScript confirmation message box. The confirmation invocation will be overridden by the platform.
20 21 22 |
# File 'lib/fluent/enclosers.rb', line 20 def will_confirm(response, &block) platform.will_confirm(response, &block) end |
#will_prompt(response, &block) ⇒ Hash
Provides a context for an action that will generate a JavaScript prompt message box. The prompt invocation will be overridden by the platform.
the value that the prompt had before the response was applied
31 32 33 |
# File 'lib/fluent/enclosers.rb', line 31 def will_prompt(response, &block) platform.will_prompt(response, &block) end |
#within_modal(&block) ⇒ Object
Used to identify a web element as existing within an enclosing object like a modal dialog box. What this does is override the normal call to showModalDialog and opens a window instead. In order to use this new window, you have to attach to it.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fluent/enclosers.rb', line 54 def within_modal(&block) convert_modal_to_window = %Q{ window.showModalDialog = function(sURL, vArguments, sFeatures) { window.dialogArguments = vArguments; modalWin = window.open(sURL, 'modal', sFeatures); return modalWin; } } driver.execute_script(convert_modal_to_window) yield if block_given? end |
#within_window(locator, &block) ⇒ Object Also known as: select_window, attach_to
Used to identify a web element or action on a web element as existing within an enclosing window object. The window can be referenced using either the title attribute of the window or a direct URL. The URL does not have to be the entire URL; it can just be a page name.
action on or within the window
43 44 45 |
# File 'lib/fluent/enclosers.rb', line 43 def within_window(locator, &block) platform.within_window(locator, &block) end |