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
458 459 460 461 462 463 464 465 466 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 458 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
480 481 482 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 480 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.
451 452 453 454 455 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 451 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
469 470 471 472 473 474 475 476 477 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 469 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.
485 486 487 |
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 485 def (name) self.div(:id=>"add_goodies_body").li(:text=>/#{Regexp.escape(name)}/, :id=>/_remove_/)..click end |