Module: Profile2Methods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/profile2.rb

Instance Method Summary collapse

Instance Method Details

#birthday(day, month, year) ⇒ Object



115
116
117
118
119
120
121
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 115

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



88
89
90
91
92
93
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 88

def change_picture
  frm.div(:id=>"myPhoto").fire_event("onmouseover")
  frm.div(:id=>"myPhoto").link(:class=>"edit-image-button").click
  sleep 0.5
  Profile2.new @browser
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.



131
132
133
134
135
136
137
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 131

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

#edit_basic_infoObject



46
47
48
49
50
51
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 46

def edit_basic_info
  frm.div(:id=>"mainPanel").span(:text=>"Basic Information").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/myInfo:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#edit_contact_infoObject



53
54
55
56
57
58
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 53

def edit_contact_info
  frm.div(:id=>"mainPanel").span(:text=>"Contact Information").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/myContact:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#edit_personal_infoObject



81
82
83
84
85
86
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 81

def edit_personal_info
  frm.div(:id=>"mainPanel").span(:text=>"Personal Information").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/myInterests:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#edit_social_networkingObject



74
75
76
77
78
79
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 74

def edit_social_networking
  frm.div(:id=>"mainPanel").span(:text=>"Social Networking").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/mySocialNetworking:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#edit_staff_infoObject



60
61
62
63
64
65
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 60

def edit_staff_info
  frm.div(:id=>"mainPanel").span(:text=>"Staff Information").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/myStaff:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#edit_student_infoObject



67
68
69
70
71
72
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 67

def edit_student_info
  frm.div(:id=>"mainPanel").span(:text=>"Student Information").fire_event("onmouseover")
  frm.div(:id=>"mainPanel").link(:href=>/myStudent:editButton/).click
  sleep 0.5
  Profile2.new @browser
end

#image_file=(filename) ⇒ 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.



100
101
102
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 100

def image_file=(filename)
  frm.file_field(:name=>"picture").set(File.expand_path(File.dirname(__FILE__)) + "/../../data/sakai-cle-test-api/" + filename)
end

#personal_summary=(text) ⇒ Object



110
111
112
113
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 110

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

#save_changesObject



123
124
125
126
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 123

def save_changes
  frm.button(:value=>"Save changes").click
  Profile2.new @browser
end

#uploadObject



104
105
106
107
108
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 104

def upload
  frm.button(:value=>"Upload").click
  sleep 0.5
  Profile2.new @browser
end