Class: Profile2

Inherits:
Profile2Base show all
Defined in:
lib/sambal-cle/page_objects/profile2.rb

Instance Method Summary collapse

Methods inherited from Profile2Base

profile2_elements

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#birthday(day, month, year) ⇒ Object



78
79
80
81
82
83
84
# File 'lib/sambal-cle/page_objects/profile2.rb', line 78

def birthday(day, month, year)
  frm.text_field(:name=>"birthdayContainer:birthday").click
  frm.select(:class=>"ui-datepicker-new-year").wait_until_present
  frm.select(:class=>"ui-datepicker-new-year").select(year.to_i)
  frm.select(:class=>"ui-datepicker-new-month").select(month)
  frm.link(:text=>day.to_s).click
end

#change_pictureObject



57
58
59
60
# File 'lib/sambal-cle/page_objects/profile2.rb', line 57

def change_picture
  frm.div(:id=>"myPhoto").fire_event("onmouseover")
  frm.div(:id=>"myPhoto").link(:class=>"edit-image-button").click
end

#connection_requestsObject

Returns the number (as a string) displayed next to the “Connections” link in the menu. If there are no connections then returns zero as a string object.



91
92
93
94
95
96
97
# File 'lib/sambal-cle/page_objects/profile2.rb', line 91

def connection_requests
  begin
    frm.link(:class=>/icon connections/).span(:class=>"new-items-count").text
  rescue
    return "0"
  end
end

#edit_basic_infoObject



27
28
29
30
# File 'lib/sambal-cle/page_objects/profile2.rb', line 27

def edit_basic_info
  main_panel.span(:text=>"Basic Information").fire_event("onmouseover")
  main_panel.link(:href=>/myInfo:editButton/).click
end

#edit_contact_infoObject



32
33
34
35
# File 'lib/sambal-cle/page_objects/profile2.rb', line 32

def edit_contact_info
  main_panel.span(:text=>"Contact Information").fire_event("onmouseover")
  main_panel.link(:href=>/myContact:editButton/).click
end

#edit_personal_infoObject



52
53
54
55
# File 'lib/sambal-cle/page_objects/profile2.rb', line 52

def edit_personal_info
  main_panel.span(:text=>"Personal Information").fire_event("onmouseover")
  main_panel.link(:href=>/myInterests:editButton/).click
end

#edit_social_networkingObject



47
48
49
50
# File 'lib/sambal-cle/page_objects/profile2.rb', line 47

def edit_social_networking
  main_panel.span(:text=>"Social Networking").fire_event("onmouseover")
  main_panel.link(:href=>/mySocialNetworking:editButton/).click
end

#edit_staff_infoObject



37
38
39
40
# File 'lib/sambal-cle/page_objects/profile2.rb', line 37

def edit_staff_info
  main_panel.span(:text=>"Staff Information").fire_event("onmouseover")
  main_panel.link(:href=>/myStaff:editButton/).click
end

#edit_student_infoObject



42
43
44
45
# File 'lib/sambal-cle/page_objects/profile2.rb', line 42

def edit_student_info
  main_panel.span(:text=>"Student Information").fire_event("onmouseover")
  main_panel.link(:href=>/myStudent:editButton/).click
end

#image_file=(filename, filepath = "") ⇒ Object

Enters the specified filename in the file field.

Note that the file should be inside the data/sakai-cle-test-api folder. The file or folder name used for the filename variable should not include a preceding slash (“/”) character.



67
68
69
# File 'lib/sambal-cle/page_objects/profile2.rb', line 67

def image_file=(filename, filepath="")
  frm.file_field(:name=>"picture").set(File.expand_path(filepath + filename))
end

#personal_summary=(text) ⇒ Object



73
74
75
76
# File 'lib/sambal-cle/page_objects/profile2.rb', line 73

def personal_summary=(text)
  frm.frame(:id=>"id1a_ifr").send_keys([:command, 'a'], :backspace)
  frm.frame(:id=>"id1a_ifr").send_keys(text)
end