Module: AddRemoveWidgets
- Includes:
- PageObject
- Defined in:
- lib/sakai-oae-test-api/pop_up_dialogs.rb
Overview
Page Objects and Methods related to the “Add widgets” pop-up on the Dashboard
Instance Method Summary collapse
-
#add_all_widgets ⇒ Object
Adds all widgets to the dashboard.
-
#add_widget(name) ⇒ Object
Clicks the “Add” button for the specified widget.
-
#close_add_widget ⇒ Object
Clicks the Close button on the dialog for adding/removing widgets to/from the Dashboard.
-
#remove_all_widgets ⇒ Object
Removes all widgets from the dashboard.
-
#remove_widget(name) ⇒ Object
Unchecks the checkbox for the specified widget.
Methods included from PageObject
#method_missing, #name_li, #name_link
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PageObject
Instance Method Details
#add_all_widgets ⇒ Object
Adds all widgets to the dashboard
459 460 461 462 463 464 465 466 467 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 459 def array = self.div(:id=>"add_goodies_body").lis.select { |li| li.class_name == "add" } sub_array = array.select { |li| li.visible? } sub_array.each do |li| li.(:text=>"Add").click self.wait_for_ajax end end |
#add_widget(name) ⇒ Object
Clicks the “Add” button for the specified widget
481 482 483 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 481 def (name) self.div(:id=>"add_goodies_body").li(:text=>/#{Regexp.escape(name)}/)..click end |
#close_add_widget ⇒ Object
Clicks the Close button on the dialog for adding/removing widgets to/from the Dashboard. Returns the MyDashboard class object.
452 453 454 455 456 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 452 def self.div(:class=>"s3d-dialog-close jqmClose").fire_event("onclick") self.wait_for_ajax MyDashboard.new @browser end |
#remove_all_widgets ⇒ Object
Removes all widgets from the dashboard
470 471 472 473 474 475 476 477 478 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 470 def array = self.div(:id=>"add_goodies_body").lis.select { |li| li.class_name == "remove" } sub_array = array.select { |li| li.visible? } sub_array.each do |li| li.(:text=>"Remove").click self.wait_for_ajax end end |
#remove_widget(name) ⇒ Object
Unchecks the checkbox for the specified widget.
486 487 488 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 486 def (name) self.div(:id=>"add_goodies_body").li(:text=>/#{Regexp.escape(name)}/, :id=>/_remove_/)..click end |