Class: JQueryUIWidgets::BasicDialog

Inherits:
PageObject::Elements::Div
  • Object
show all
Defined in:
lib/jqueryui_widgets/basic_dialog.rb

Overview

Basic Dialog allows JQuery UI Widgets to interact with the basic dialogs that JQueryUI pops up.

NOTE: JQueryUI Widgets are very customizable, so we’ve kept the functionality for the dialogs class as rudimentary as possible, to allow the end user to build up any functionality they require, and customize the class to suit their particular needs.

Class Method Summary collapse

Class Method Details

.accessor_methods(accessor, name) ⇒ Object

Generates three methods

The NAMEtitle method grabs the span element of the title bar in the UI dialog and returns the text.

NAME_content method will return the entire text of the JQuery UI dialog box.

close_NAME method will, of course, click the button labeled close.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jqueryui_widgets/basic_dialog.rb', line 28

def self.accessor_methods(accessor, name)
  accessor.send :define_method, "#{name}_title" do
    dialog = self.send "#{name}_element"
    dialog.div_element(:class => 'ui-dialog-titlebar').span_element.text
  end

  accessor.send :define_method, "#{name}_content" do
    dialog = self.send "#{name}_element"
    dialog.div_element(:class => 'ui-dialog-content').text
  end

  accessor.send :define_method, "close_#{name}" do
    dialog = self.send "#{name}_element"
    dialog.button_element(:class => 'ui-dialog-titlebar-close').click
  end
end