Module: AddEditTopicMethods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/forums.rb

Constant Summary collapse

@@table_index =
0

Instance Method Summary collapse

Instance Method Details

#add_attachmentsObject



277
278
279
280
# File 'lib/kuali-sakai-common-lib/forums.rb', line 277

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

#description=(text) ⇒ Object



268
269
270
# File 'lib/kuali-sakai-common-lib/forums.rb', line 268

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

#editorObject



264
265
266
# File 'lib/kuali-sakai-common-lib/forums.rb', line 264

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

#rolesObject



282
283
284
285
286
287
# File 'lib/kuali-sakai-common-lib/forums.rb', line 282

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

#saveObject



272
273
274
275
# File 'lib/kuali-sakai-common-lib/forums.rb', line 272

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

#site_role=(role) ⇒ Object



289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/kuali-sakai-common-lib/forums.rb', line 289

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