Module: ListPeople

Includes:
PageObject
Included in:
ExploreAll, ExplorePeople, MyContacts
Defined in:
lib/sakai-oae-test-api/widgets.rb

Overview

Methods related to lists of People/Participants

Instance Method Summary collapse

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_contact(name) ⇒ Object Also known as: request_contact, request_connection

Clicks the plus sign next to the specified Contact name. Obviously the name must exist in the list.



329
330
331
332
333
# File 'lib/sakai-oae-test-api/widgets.rb', line 329

def add_contact(name)
  self.button(:title=>"Request connection with #{name}").click
  self.wait_until { @browser.button(:text=>"Invite").visible? }
  self.class.class_eval { include AddToContactsPopUp }
end

#addable?(name) ⇒ Boolean

This method checks whether or not the listed person has the “Add contact” button available. To ensure the test case will be valid, it first makes sure the specified person is in the list. Returns true if the button is available.

Returns:

  • (Boolean)


357
358
359
360
361
362
363
364
# File 'lib/sakai-oae-test-api/widgets.rb', line 357

def addable?(name)
  if name_li(name).exists?
    self.button(:title=>"Request connection with #{name}").present?
  else
    puts "\n#{name} isn't in the results list. Check your script.\nThis may be a false negative.\n"
    return false
  end
end

#remove(name) ⇒ Object Also known as: remove_contact

Clicks the X to remove the selected person from the Contacts list (in My Contacts).



339
340
341
342
343
# File 'lib/sakai-oae-test-api/widgets.rb', line 339

def remove(name)
  self.button(:title=>"Remove contact #{name}").click
  self.wait_for_ajax
  self.class.class_eval { include RemoveContactsPopUp }
end

#send_message_to(name) ⇒ Object



346
347
348
349
350
# File 'lib/sakai-oae-test-api/widgets.rb', line 346

def send_message_to(name)
  name_li(name).button(:class=>"s3d-link-button s3d-action-icon s3d-actions-message searchpeople_result_message_icon sakai_sendmessage_overlay").click
  self.wait_for_ajax
  self.class.class_eval { include SendMessagePopUp }
end