Module: ShareWithPopUp

Includes:
PageObject
Defined in:
lib/sakai-oae-test-api/pop_up_dialogs.rb

Overview

Methods related to the Pop Up for Sharing Content with others.

Instance Method Summary collapse

Methods included from PageObject

#method_missing, #name_li, #name_link

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PageObject

Instance Method Details

#add_a_messageObject

Clicks the arrow for adding a custom message to the share.



1246
1247
1248
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 1246

def add_a_message
  self.span(:id=>"newsharecontent_message_arrow").fire_event('onclick')
end

#share_with=(name) ⇒ Object

Enters the specified name value into the “Share with” field, a character at a time, then waits for the search results to return the expected name. When the name is found in the results list, it gets clicked on.



1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 1258

def share_with=(name)

  name.split("", 5).each do |letter|
    self.share_with_field_element.focus
    self.share_with_field_element.send_keys(letter)
    self.wait_until { self.ul(:class=>"as-list").present? }
    if self.li(:text=>/#{Regexp.escape(name)}/, :id=>/as-result-item-\d+/).present?
      @browser.li(:text=>/#{Regexp.escape(name)}/, :id=>/as-result-item-\d+/).click
      break
    end
  end

end