Class: MyContacts
- Inherits:
-
Object
- Object
- MyContacts
- Includes:
- GlobalMethods, HeaderFooterBar, LeftMenuBarYou, ListPeople, ListWidget, PageObject
- Defined in:
- lib/sakai-oae-test-api/page_classes.rb
Overview
Page Objects and Custom Methods for the My Contacts page.
Instance Method Summary collapse
-
#accept_connection(name) ⇒ Object
Clicks the “accept connection” plus sign for the specified person in the Pending contacts list.
-
#find_more_people ⇒ Object
Clicks the “Find more people” link, then returns the ExplorePeople class object.
-
#page_title ⇒ Object
The text of the Page Title.
-
#pending_contacts ⇒ Object
This returns the the “contacts_invited” page div (as a Watir page object).
-
#pending_invites ⇒ Object
Returns the list of names of people requesting contact.
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 ListPeople
#add_contact, #addable?, #remove, #send_message_to
Methods included from ListWidget
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
#accept_connection(name) ⇒ Object
Clicks the “accept connection” plus sign for the specified person in the Pending contacts list
1328 1329 1330 1331 1332 |
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1328 def accept_connection(name) self.li(:text=>/#{Regexp.escape(name)}/).(:title=>"Accept connection").click sleep 0.8 self.wait_for_ajax(2) end |
#find_more_people ⇒ Object
Clicks the “Find more people” link, then returns the ExplorePeople class object.
1336 1337 1338 1339 1340 |
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1336 def find_more_people active_div.link(:text=>"Find more people").click self.wait_for_ajax ExplorePeople.new @browser end |
#page_title ⇒ Object
The text of the Page Title. It should usually return “My contacts”.
1303 1304 1305 |
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1303 def page_title active_div.div(:class=>"s3d-contentpage-title").text end |
#pending_contacts ⇒ Object
This returns the the “contacts_invited” page div (as a Watir page object). This can be used to validate that there are pending invites on the page. Primarily, however, it’s used by other methods in this class–to differentiate the pending list from the contacts list.
1312 1313 1314 |
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1312 def pending_contacts active_div.div(:id=>"contacts_invited") end |
#pending_invites ⇒ Object
Returns the list of names of people requesting contact
1320 1321 1322 1323 1324 |
# File 'lib/sakai-oae-test-api/page_classes.rb', line 1320 def pending_invites list = [] pending_contacts.links(:class=>"s3d-bold s3d-regular-light-links", :title=>/View/).each { |link| list << link.text } return list end |