Class: Profile2Search
Instance Method Summary
collapse
#connections, #messages, #my_profile, #pictures, #preferences, #privacy, #search_for_connections
Methods inherited from BasePage
basic_page_elements, frame_element
Instance Method Details
#add_as_connection(name) ⇒ Object
209
210
211
212
213
214
215
216
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 209
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_results ⇒ Object
235
236
237
238
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 235
def clear_results
frm.button(:value=>"Clear results").click
Profile2Search.new(@browser)
end
|
#results ⇒ Object
Returns an array containing strings of the names of the users returned in the search.
225
226
227
228
229
230
231
232
233
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 225
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_interest ⇒ Object
203
204
205
206
207
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 203
def search_by_common_interest
frm.button(:value=>"Search by common interest").click
sleep 0.5
Profile2Search.new(@browser)
end
|
#search_by_name_or_email ⇒ Object
197
198
199
200
201
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 197
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
218
219
220
221
|
# File 'lib/sambal-cle/page_objects/profile2.rb', line 218
def view(name)
frm.link(:text=>name).click
Profile2View.new(@browser)
end
|