Class: AddEditTopic

Inherits:
BasePage show all
Defined in:
lib/sakai-cle-test-api/page_objects/forums.rb

Constant Summary collapse

@@table_index =
0

Instance Method Summary collapse

Methods inherited from BasePage

basic_page_elements, frame_element

Methods inherited from PageMaker

element, expected_element, expected_title, #initialize, #method_missing, page_url

Constructor Details

This class inherits a constructor from PageMaker

Dynamic Method Handling

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

Instance Method Details

#add_attachmentsObject



260
261
262
263
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 260

def add_attachments
  frm.button(:value=>/Add.+ttachment/).click
  ForumsAddAttachments.new(@browser)
end

#description=(text) ⇒ Object



251
252
253
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 251

def description=(text)
  editor.send_keys(text)
end

#editorObject



247
248
249
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 247

def editor
  frm.div(:class=>"portletBody").frame(:id, "revise:topic_description_inputRichText___Frame").td(:id, "xEditingArea").frame(:index=>0)
end

#rolesObject



265
266
267
268
269
270
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 265

def roles
  roles=[]
  options = frm.select(:id=>"revise:role").options.to_a
  options.each { |option| roles << option.text }
  return roles
end

#saveObject



255
256
257
258
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 255

def save
  frm.button(:value=>"Save").click
  Forums.new(@browser)
end

#site_role=(role) ⇒ Object



272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/sakai-cle-test-api/page_objects/forums.rb', line 272

def site_role=(role)
  frm.select(:id=>"revise:role").select(role)
  0.upto(frm.select(:id=>"revise:role").length - 1) do |x|
    if frm.div(:class=>"portletBody").table(:class=>"permissionPanel jsfFormTable lines nolines", :index=>x).visible?
      @@table_index = x

      def permission_level=(value)
        frm.select(:id=>"revise:perm:#{@@table_index}:level").select(value)
      end

    end
  end
end