Module: LibraryWidget

Includes:
PageObject
Included in:
Library, MyLibrary
Defined in:
lib/sakai-oae-test-api/widgets.rb

Overview

Methods related to the Library List page.

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_selected_toObject



130
131
132
133
134
# File 'lib/sakai-oae-test-api/widgets.rb', line 130

def add_selected_to
  self.add_selected_to_button
  self.wait_for_ajax
  self.class.class_eval { include AddToGroupsPopUp }
end

#add_to(name) ⇒ Object



136
137
138
139
# File 'lib/sakai-oae-test-api/widgets.rb', line 136

def add_to(name)
  name_li(name)
  # TODO - Finish writing this method
end

#check_content(item) ⇒ Object

Checks the specified Library item.



121
122
123
# File 'lib/sakai-oae-test-api/widgets.rb', line 121

def check_content(item)
  name_li(item).checkbox.set
end

#checkbox(item) ⇒ Object

Returns the checkbox element itself for the specified item in the list. Use this method for checking whether or not the checkbox in question is selected or not--e.g., library.checkbox("textfile.txt").should be_set



116
117
118
# File 'lib/sakai-oae-test-api/widgets.rb', line 116

def checkbox(item)
  name_li(item).checkbox
end

#remove_selectedObject



147
148
149
150
151
# File 'lib/sakai-oae-test-api/widgets.rb', line 147

def remove_selected
  self.remove_selected_button
  self.div(:id=>"deletecontent_dialog").wait_until_present
  self.class.class_eval { include DeleteContentPopUp }
end

#search_library_for=(text) ⇒ Object

Enters the specified string in the search field. Note that it appends a line feed on the string, so the search occurs immediately.



102
103
104
105
# File 'lib/sakai-oae-test-api/widgets.rb', line 102

def search_library_for=(text)
  self.search_library=("#{text}\n")
  self.wait_for_ajax
end

#share_selectedObject



141
142
143
144
145
# File 'lib/sakai-oae-test-api/widgets.rb', line 141

def share_selected
  self.share_selected_button
  self.text_field(:name=>"newsharecontent_sharelist").wait_until_present
  self.class.class_eval { include ShareWithPopUp }
end

#sort_by=(sort_option) ⇒ Object



107
108
109
110
# File 'lib/sakai-oae-test-api/widgets.rb', line 107

def sort_by=(sort_option)
  self.sort_by_list=sort_option
  self.linger_for_ajax(2)
end

#uncheck_content(item) ⇒ Object

Unchecks the specified library item.



126
127
128
# File 'lib/sakai-oae-test-api/widgets.rb', line 126

def uncheck_content(item)
  name_li(item).checkbox.clear
end