Class: MyProfileBasicInfo

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

Overview

Methods related to the Basic Info page in My Profile

Instance Method Summary collapse

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 PageObject

#method_missing, #name_li, #name_link

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

#categoriesObject

Returns an array consisting of the contents of the Tags and Categories field. Returns the categories split up among children and parents. In other words, for example, “Engineering & Technology » Computer Engineering” becomes “Engineering & Technology”, “Computer Engineering”



933
934
935
936
937
938
939
940
941
942
943
944
# File 'lib/sakai-oae-test-api/page_classes.rb', line 933

def categories
  list = []
  self.form(:id=>"displayprofilesection_form_basic").ul(:class=>"as-selections").lis.each do |li|
    next if li.text == ""
    string = li.text[/(?<=\n).+/]
    split = string.split(" » ")
    list << split
  end
  list.flatten!
  list.uniq!
  return list
end

#list_categoriesObject

Clicks the “List categories” button and waits for the pop-up dialog to load. Includes the AddRemoveCategories module in the class object.



923
924
925
926
927
# File 'lib/sakai-oae-test-api/page_classes.rb', line 923

def list_categories
  self.form(:id=>"displayprofilesection_form_basic").button(:text=>"List categories").click
  self.wait_for_ajax(3)
  self.class.class_eval { include AddRemoveCategories }
end

#remove_category(name) ⇒ Object

Removes the specified category from the list



947
948
949
950
# File 'lib/sakai-oae-test-api/page_classes.rb', line 947

def remove_category(name)
  self.form(:id=>"displayprofilesection_form_basic").li(:text=>/#{Regexp.escape(name)}/).link(:class=>"as-close").click
  self.wait_for_ajax
end

#updateObject

Clicks the “Update” button and waits for any Ajax calls to complete.



954
955
956
957
# File 'lib/sakai-oae-test-api/page_classes.rb', line 954

def update
  self.form(:id=>"displayprofilesection_form_basic").button(:text=>"Update").click
  self.wait_for_ajax(2)
end