Class: AddEditTopic

Inherits:
BasePage
  • Object
show all
Includes:
FCKEditor
Defined in:
lib/sambal-cle/page_objects/forums.rb

Constant Summary collapse

@@table_index =

TODO: Seriously think about a better way to do this

0

Instance Method Summary collapse

Methods included from FCKEditor

#enter_source_text, #entity_picker, #get_source_text, #prepend, #select_all, #source, #source_field

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#description=(text) ⇒ Object



199
200
201
# File 'lib/sambal-cle/page_objects/forums.rb', line 199

def description=(text)
  editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
end

#editorObject



195
196
197
# File 'lib/sambal-cle/page_objects/forums.rb', line 195

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

#rolesObject



205
206
207
208
209
210
# File 'lib/sambal-cle/page_objects/forums.rb', line 205

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

#site_role=(role) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/sambal-cle/page_objects/forums.rb', line 212

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