Module: LeftMenuBarYou

Overview

The Left Menu Bar when in the context of the “You” pages

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

#change_pictureObject

Opens the Pop Up dialog for changing the Avatar image for the current page.



549
550
551
552
553
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 549

def change_picture
  profile_pic_arrow_element.fire_event("onclick")
  self.link(:id=>"changepic_container_trigger").click
  self.class.class_eval { include ChangePicturePopUp }
end

#inboxObject

Clicks the Inbox link in the left-hand menu. Waits for the new page to load.



507
508
509
510
511
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 507

def inbox
  self.inbox_link
  sleep 1
  self.wait_for_ajax
end

#invitationsObject

Clicks the Invitations link in the left-hand menu. Waits for the new page to load.



515
516
517
518
519
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 515

def invitations
  self.invitations_link
  sleep 1
  self.wait_for_ajax
end

#my_contacts_countObject



599
600
601
602
603
604
605
606
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 599

def my_contacts_count
  count_div = self.div()
  if count_div.present?
    count_div.text.to_i
  else
    0
  end
end

#my_library_countObject



594
595
596
597
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 594

def my_library_count
  count_div = name_link("My library").parent.div(:class=>"lhnavigation_levelcount")
  count_div.present? ? count_div.text.to_i : 0
end

#my_messages_lock_iconObject

The div for the “Lock icon” next to the My messages menu



538
539
540
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 538

def my_messages_lock_icon
  self.div(:text=>"My Messages").div(:class=>"lhnavigation_private")
end

#sentObject

Clicks the Sent link in the left-hand menu. Waits for the new page to load.



523
524
525
526
527
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 523

def sent
  self.sent_link
  sleep 1
  self.wait_for_ajax
end

#show_hide_my_messages_treeObject

Expands/Collapses the My Messages Tree



543
544
545
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 543

def show_hide_my_messages_tree
  self.div(:id=>"lhnavigation_container").link(:text=>"My Messages").click
end

#trashObject

Clicks the Trash link in the left-hand menu. Waits for the new page to load.



531
532
533
534
535
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 531

def trash
  self.trash_link
  sleep 1
  self.wait_for_ajax
end

#unread_inbox_countObject

Returns the number displayed in the left menu for the Inbox’s unread messages. If there is no number displayed there, this method will return a zero. Note that the number returned is an Integer and not a String.



572
573
574
575
576
577
578
579
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 572

def unread_inbox_count
  count_div = self.div(:text=>/Inbox/, :class=>"lhnavigation_subnav_item_content").div(:class=>"lhnavigation_sublevelcount")
  if count_div.present?
    count_div.text.to_i
  else
    0
  end
end

#unread_invitations_countObject

Returns the number displayed in the left menu for the Invitation’s unread messages. If there is no number displayed there, this method will return a zero. Note that the number returned is an Integer and not a String.



585
586
587
588
589
590
591
592
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 585

def unread_invitations_count
  count_div = self.div(:text=>/Invitations/, :class=>"lhnavigation_subnav_item_content").div(:class=>"lhnavigation_sublevelcount")
  if count_div.present?
    count_div.text.to_i
  else
    0
  end
end

#unread_message_countObject

Returns the number displayed in the left menu for the total unread messages. If there is no number displayed there, this method will return a zero. Note that the number returned is an Integer and not a String.



559
560
561
562
563
564
565
566
# File 'lib/sakai-oae-test-api/toolbars_and_menus.rb', line 559

def unread_message_count
  count_div = self.div(:text=>/My Messages/, :class=>"lhnavigation_item_content").div(:class=>"lhnavigation_levelcount")
  if count_div.present?
    count_div.text.to_i
  else
    0
  end
end