Module: ContentPermissionsPopUp

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

Overview

Objects in the Pop Up dialog for setting viewing permissions for Content

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

#save_and_closeObject

Clicks the “Save and close” button then waits for all ajax calls to finish



623
624
625
626
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 623

def save_and_close
  save_and_close_button
  self.wait_for_ajax
end

#shareObject

Clicks the “Share” button and waits for the ajax calls to finish.



629
630
631
632
633
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 629

def share
  self.button(:id=>"contentpermissions_members_autosuggest_sharebutton").flash
  self.button(:id=>"contentpermissions_members_autosuggest_sharebutton").click
  self.wait_for_ajax
end

#share_with=(name) ⇒ Object

Enters the specified name in the “Who can edit it or who is it associated with?” search field. Then clicks on the first item in the search results menu–which means that this method assumes the search will be successful and the first item listed is the desired item to select.



613
614
615
616
617
618
619
# File 'lib/sakai-oae-test-api/pop_up_dialogs.rb', line 613

def share_with=(name)
  self.text_field(:id=>/contentpermissionscontainer\d+/).set name
  sleep 0.6
  self.wait_for_ajax
  self.div(:class=>"as-results").li(:id=>"as-result-item-0").fire_event "onclick"
  self.wait_for_ajax
end