Module: ListGroups

Includes:
PageObject
Included in:
ExploreAll, ExploreCourses, ExploreGroups, MyMemberships
Defined in:
lib/sakai-oae-test-api/widgets.rb

Overview

Methods related to lists of Groups/Courses

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_group(name) ⇒ Object Also known as: add_course, add_research, join_course, join_group

Clicks on the plus sign image for the specified group in the list.



378
379
380
# File 'lib/sakai-oae-test-api/widgets.rb', line 378

def add_group(name)
  name_li(name).div(:class=>/searchgroups_result_left_filler/).fire_event("onclick")
end

#check_group(name) ⇒ Object Also known as: select_group

Checks the checkbox for the specified group _



403
404
405
# File 'lib/sakai-oae-test-api/widgets.rb', line 403

def check_group(name)
  name_li(name).checkbox(:title=>/Select/).set
end

#content_item_count(name) ⇒ Object

Returns the number of content items (as an Integer, not a String) in the specified course/group.



418
419
420
421
# File 'lib/sakai-oae-test-api/widgets.rb', line 418

def content_item_count(name)
  text = self.span(:class=>"s3d-search-result-name",:text=>name).parent.parent.parent.link(:title=>/\d+.content items/).text
  text[/\d+/].to_i
end

#group_type(name) ⇒ Object Also known as: course_type, research_type

Returns the specified item’s “type”, as shown next to the item name–i.e., “GROUP”, “COURSE”, etc.



410
411
412
# File 'lib/sakai-oae-test-api/widgets.rb', line 410

def group_type(name)
  self.span(:class=>"s3d-search-result-name",:text=>name).parent.parent.span(:class=>"mymemberships_item_grouptype").text
end

#join_button_for(name) ⇒ Object



373
374
375
# File 'lib/sakai-oae-test-api/widgets.rb', line 373

def join_button_for(name)
  name_li(name).div(:class=>/searchgroups_result_left_filler/)
end

#message_button(name) ⇒ Object

Returns the message button element itself.



448
449
450
# File 'lib/sakai-oae-test-api/widgets.rb', line 448

def message_button(name)
  name_li(name).button(:class=>/sakai_sendmessage_overlay/)
end

#message_course(name) ⇒ Object Also known as: send_message_to_course, send_message_to_group, message_group, message_person, message_research

Clicks the Message button for the specified listed item.



436
437
438
439
440
# File 'lib/sakai-oae-test-api/widgets.rb', line 436

def message_course(name)
  message_button(name).click
  self.linger_for_ajax(2)
  self.class.class_eval { include SendMessagePopUp }
end

#participants_count(name) ⇒ Object

Returns the count (as an Integer, not a String) of participants in the specified group/course.



424
425
426
427
# File 'lib/sakai-oae-test-api/widgets.rb', line 424

def participants_count(name)
  text = self.span(:class=>"s3d-search-result-name",:text=>name).parent.parent.parent.link(:title=>/\d+.participant/).text
  text[/\d+/].to_i
end

#remove_membership(name) ⇒ Object Also known as: leave_group



387
388
389
390
391
# File 'lib/sakai-oae-test-api/widgets.rb', line 387

def remove_membership(name)
  remove_membership_button(name).click
  self.linger_for_ajax
  self.class.class_eval { include LeaveWorldPopUp }
end

#remove_membership_button(name) ⇒ Object

This returns the Remove button element itself, for the specified Group/Course/Research listed. This is useful for interacting directly with the element instead of simply clicking on it.



398
399
400
# File 'lib/sakai-oae-test-api/widgets.rb', line 398

def remove_membership_button(name)
  name_li(name).button(:title=>/Remove membership from/)
end

#view_group_participants(name) ⇒ Object



429
430
431
432
433
# File 'lib/sakai-oae-test-api/widgets.rb', line 429

def view_group_participants(name)
  name_li(name).link(:title=>/\d+.participant/i).click
  self.linger_for_ajax(2)
  Participants.new @browser
end