Module: AddEditTopicMethods

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

Constant Summary collapse

@@table_index =
0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.page_elements(identifier) ⇒ Object



305
306
307
308
309
310
# File 'lib/kuali-sakai-common-lib/forums.rb', line 305

def self.page_elements(identifier)
  in_frame(identifier) do |frame|
    text_field(:title, :id=>"revise:topic_title", :frame=>frame)
    text_area(:short_description, :id=>"revise:topic_shortDescription", :frame=>frame)
  end
end

Instance Method Details

#add_attachmentsObject



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

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

#description=(text) ⇒ Object



270
271
272
# File 'lib/kuali-sakai-common-lib/forums.rb', line 270

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

#editorObject



266
267
268
# File 'lib/kuali-sakai-common-lib/forums.rb', line 266

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

#rolesObject



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

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

#saveObject



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

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

#site_role=(role) ⇒ Object



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

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