Module: Profile2SearchMethods

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

Instance Method Summary collapse

Instance Method Details

#add_as_connection(name) ⇒ Object



218
219
220
221
222
223
224
225
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 218

def add_as_connection(name)
  frm.div(:class=>"search-result", :text=>/#{Regexp.escape(name)}/).link(:class=>"icon connection-add").click
  frm.div(:class=>"modalWindowButtons").wait_until_present
  frm.div(:class=>"modalWindowButtons").button(:value=>"Add connection").click
  frm.div(:class=>"modalWindowButtons").wait_while_present
  sleep 0.5
  Profile2Search.new @browser
end

#clear_resultsObject



244
245
246
247
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 244

def clear_results
  frm.button(:value=>"Clear results").click
  Profile2Search.new(@browser)
end

#resultsObject

Returns an array containing strings of the names of the users returned in the search.



234
235
236
237
238
239
240
241
242
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 234

def results
  results = []
  frm.div(:class=>"portletBody").spans.each do |span|
    if span.class_name == "search-result-info-name"
      results << span.text
    end
  end
  return results
end

#search_by_common_interestObject



212
213
214
215
216
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 212

def search_by_common_interest
  frm.button(:value=>"Search by common interest").click
  sleep 0.5
  Profile2Search.new(@browser)
end

#search_by_name_or_emailObject



206
207
208
209
210
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 206

def search_by_name_or_email
  frm.button(:value=>"Search by name or email").click
  sleep 0.5
  Profile2Search.new(@browser)
end

#view(name) ⇒ Object



227
228
229
230
# File 'lib/kuali-sakai-common-lib/profile2.rb', line 227

def view(name)
  frm.link(:text=>name).click
  Profile2View.new(@browser)
end