Module: ManageParticipants

Includes:
PageObject
Defined in:
lib/sakai-oae-test-api/pop_up_dialogs.rb

Overview

Page Objects and Methods related to the Pop Up that allows modifying a Group’s/Course’s 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_by_search(name) ⇒ Object Also known as: add_contact_by_search, add_participant_by_search, search_and_add_participant, add_by_search=

Adds the specified contact to the members list (does not save, though). This method assumes the specified name will be found in the search. It makes no allowances for failing to find the target user/member.



850
851
852
853
854
855
856
857
858
859
860
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 850

def add_by_search(name)
  name.split("", 2).each do |letter|
    self.text_field(:id=>/addpeople/, :class=>"as-input").focus
    self.text_field(:id=>/addpeople/, :class=>"as-input").send_keys(letter)
    self.wait_until { self.div(:id=>/^as-results-/).visible? }
    if self.li(:text=>/#{Regexp.escape(name)}/, :id=>/as-result-item-\d+/).present?
      self.li(:text=>/#{Regexp.escape(name)}/, :id=>/as-result-item-\d+/).click
      break
    end
  end
end

#add_contact(contact) ⇒ Object Also known as: check_contact, add_participant

Checks the specified contact for adding.



840
841
842
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 840

def add_contact(contact)
  self.li(:text=>contact).checkbox(:class=>"addpeople_checkbox").set
end

#check_remove_contact(contact) ⇒ Object

Checks to remove the specified contact.



872
873
874
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 872

def check_remove_contact(contact)
  self.div(:id=>"addpeople_selected_contacts_container").link(:text=>contact).parent.checkbox.set
end

#set_role_for(contact, role) ⇒ Object

For the specified contact, updates to the specified role.fd



882
883
884
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 882

def set_role_for(contact, role)
  self.div(:id=>"addpeople_selected_contacts_container").link(:text=>contact).parent.select(:class=>"addpeople_selected_permissions").select(role)
end

#uncheck_remove_contact(contact) ⇒ Object

Unchecks the remove checkbox for the specified contact



877
878
879
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 877

def uncheck_remove_contact(contact)
  self.div(:id=>"addpeople_selected_contacts_container").link(:text=>contact).parent.checkbox.clear
end