Class: Forums

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

Instance Method Summary collapse

Methods inherited from BasePage

basic_page_elements, button, damballa, frame_element, link

Instance Method Details

#delete_forum(name) ⇒ Object

EditForum



55
56
57
58
# File 'lib/sambal-cle/page_objects/forums.rb', line 55

def delete_forum(name)
  index = forum_titles.index(name)
  frm.link(:id=>/msgForum:forums:\d+:delete/,:text=>"Delete", :index=>index).click
end

#delete_topic(name) ⇒ Object

AddEditTopic



61
62
63
64
# File 'lib/sambal-cle/page_objects/forums.rb', line 61

def delete_topic(name)
  index = topic_titles.index(name)
  frm.link(:id=>/topics:\d+:delete_confirm/, :text=>"Delete", :index=>index).click
end

#draft?(title) ⇒ Boolean

Pass this method a string that matches the title of a Forum on the page, it returns True if the specified forum row has “DRAFT” in it.

Returns:

  • (Boolean)


8
9
10
# File 'lib/sambal-cle/page_objects/forums.rb', line 8

def draft?(title)
  frm.table(:id=>"msgForum:forums").row(:text=>/#{Regexp.escape(title)}/).span(:text=>"DRAFT").exist?
end

#forum_settings(name) ⇒ Object

EditForum



43
44
45
46
# File 'lib/sambal-cle/page_objects/forums.rb', line 43

def forum_settings(name)
  index = forum_titles.index(name)
  frm.link(:text=>"Forum Settings", :index=>index).click
end

#forum_titlesObject



28
29
30
31
32
33
# File 'lib/sambal-cle/page_objects/forums.rb', line 28

def forum_titles
  titles = []
  title_links = frm.div(:class=>"portletBody").links.find_all { |link| link.class_name=="title" && link.id=="" }
  title_links.each { |link| titles << link.text }
  return titles
end

#new_topic_for_forum(name) ⇒ Object

AddEditTopic



15
16
17
18
# File 'lib/sambal-cle/page_objects/forums.rb', line 15

def new_topic_for_forum(name)
  index = forum_titles.index(name)
  frm.link(:text=>"New Topic", :index=>index).click
end

#open_forum(title) ⇒ Object Also known as: open_topic



66
67
68
69
# File 'lib/sambal-cle/page_objects/forums.rb', line 66

def open_forum(title)
  frm.link(:text=>/#{title}/).wait_until_present(7)
  frm.link(:text=>/#{title}/).click
end

#topic_settings(name) ⇒ Object

AddEditTopic



49
50
51
52
# File 'lib/sambal-cle/page_objects/forums.rb', line 49

def topic_settings(name)
  index = topic_titles.index(name)
  frm.link(:text=>"Topic Settings", :index=>index).click
end

#topic_titlesObject



35
36
37
38
39
40
# File 'lib/sambal-cle/page_objects/forums.rb', line 35

def topic_titles
  titles = []
  title_links = frm.div(:class=>"portletBody").links.find_all { |link| link.class_name == "title" && link.id != "" }
  title_links.each { |link| titles << link.text }
  return titles
end