Class: MyDashboard

Inherits:
Object
  • Object
show all
Includes:
ChangePicturePopUp, GlobalMethods, HeaderFooterBar, LeftMenuBarYou, PageObject
Defined in:
lib/sakai-oae-test-api/page_classes.rb

Overview

Methods related to objects found on the Dashboard

Instance Method Summary collapse

Methods included from ChangePicturePopUp

#save_new_selection, #thumbnail_source, #upload_a_new_picture

Methods included from PageObject

#method_missing, #name_li, #name_link

Methods included from LeftMenuBarYou

#change_picture, #inbox, #invitations, #my_contacts_count, #my_library_count, #my_messages_lock_icon, #sent, #show_hide_my_messages_tree, #trash, #unread_inbox_count, #unread_invitations_count, #unread_message_count

Methods included from HeaderFooterBar

#acknowledgements, #add_collection, #add_content, #browse_footer, #browse_footer_link, #change_language, #change_location, #click_link, #explore_footer, #explore_footer_link, #login, #messages_container, #my_account, #sign_out, #sign_up, #toggle_collector, #user_agreement

Methods included from GlobalMethods

#close_notification, #menu_item, #open_page, #view_person

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageObject

Instance Method Details

#add_widgetsObject

Clicks the ‘Add widget’ button, waits for the page to load, then includes the AddRemoveWidgets module in the class. Note that this method is specifically “add_widgets” because otherwise there would be a method collision with the “add widget” method in the AddRemoveWidgets module.



624
625
626
627
628
# File 'lib/sakai-oae-test-api/page_classes.rb', line 624

def add_widgets
  self.add_widgets_button
  self.wait_until { self.text.include? "Add widgets" }
  self.class.class_eval { include AddRemoveWidgets }
end

#displayed_widgetsObject

Returns an array object containing a list of all selected widgets.



631
632
633
634
635
636
637
# File 'lib/sakai-oae-test-api/page_classes.rb', line 631

def displayed_widgets
  list = []
  self.div(:class=>"fl-container-flex widget-content").divs(:class=>"s3d-contentpage-title").each do |div|
    list << div.text
  end
  return list
end

#go_to_most_recent_membershipObject

Clicks on the membership item displayed in the Recent Memberships widget. Then returns the Library class object.



646
647
648
649
650
651
# File 'lib/sakai-oae-test-api/page_classes.rb', line 646

def go_to_most_recent_membership
  self.link(:class=>"recentmemberships_item_link s3d-widget-links s3d-bold").click
  sleep 2 # The next line sometimes throws an "unknown javascript error" without this line.
  self.wait_for_ajax(2)
  Library.new @browser
end

#my_memberships_listObject

Returns an array containing all the items listed in the “My memberships” dashboard widget.



654
655
656
657
658
# File 'lib/sakai-oae-test-api/page_classes.rb', line 654

def my_memberships_list
  list = []
  self.ul(:class=>"mygroup_items_list").spans(:class=>"mygroups_ellipsis_text").each { |span| list << span.text }
  return list
end

#page_titleObject

Returns the text contents of the page title div



615
616
617
# File 'lib/sakai-oae-test-api/page_classes.rb', line 615

def page_title
  self.div(:id=>"s3d-page-container").div(:class=>"s3d-contentpage-title").text
end

#recent_membership_itemObject

Returns the name of the recent membership item displayed.



640
641
642
# File 'lib/sakai-oae-test-api/page_classes.rb', line 640

def recent_membership_item
  self.div(:class=>"recentmemberships_widget").link(:class=>/recentmemberships_item_link/).text
end