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
- #add_attachments ⇒ Object
- #description=(text) ⇒ Object
- #editor ⇒ Object
- #roles ⇒ Object
- #save ⇒ Object
- #site_role=(role) ⇒ Object
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_attachments ⇒ Object
279 280 281 282 |
# File 'lib/kuali-sakai-common-lib/forums.rb', line 279 def frm.(: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 |
#editor ⇒ Object
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 |
#roles ⇒ Object
284 285 286 287 288 289 |
# File 'lib/kuali-sakai-common-lib/forums.rb', line 284 def roles roles=[] = frm.select(:id=>"revise:role")..to_a .each { |option| roles << option.text } return roles end |
#save ⇒ Object
274 275 276 277 |
# File 'lib/kuali-sakai-common-lib/forums.rb', line 274 def save frm.(: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 (value) frm.select(:id=>"revise:perm:#{@@table_index}:level").select(value) end end end end |