Module: Profile2Methods
- Includes:
- PageObject
- Defined in:
- lib/kuali-sakai-common-lib/profile2.rb
Instance Method Summary collapse
- #birthday(day, month, year) ⇒ Object
- #change_picture ⇒ Object
-
#connection_requests ⇒ Object
Returns the number (as a string) displayed next to the “Connections” link in the menu.
- #edit_basic_info ⇒ Object
- #edit_contact_info ⇒ Object
- #edit_personal_info ⇒ Object
- #edit_social_networking ⇒ Object
- #edit_staff_info ⇒ Object
- #edit_student_info ⇒ Object
-
#image_file=(filename) ⇒ Object
Enters the specified filename in the file field.
- #personal_summary=(text) ⇒ Object
- #save_changes ⇒ Object
- #upload ⇒ Object
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_picture ⇒ Object
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_requests ⇒ Object
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_info ⇒ Object
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_info ⇒ Object
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_info ⇒ Object
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_networking ⇒ Object
74 75 76 77 78 79 |
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 74 def 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_info ⇒ Object
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_info ⇒ Object
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.(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_changes ⇒ Object
123 124 125 126 |
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 123 def save_changes frm.(:value=>"Save changes").click Profile2.new @browser end |
#upload ⇒ Object
104 105 106 107 108 |
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 104 def upload frm.(:value=>"Upload").click sleep 0.5 Profile2.new @browser end |