Class: Announcements
- Defined in:
- lib/sambal-cle/page_objects/announcements.rb
Overview
The Announcements list page for a Site.
Instance Method Summary collapse
-
#has_attachment?(subject) ⇒ Boolean
Returns true or false depending on whether the specified announcement has an attachment.
-
#subjects ⇒ Object
Returns an array of the subject strings of the announcements listed on the page.
-
#view=(list_item) ⇒ Object
Selects the specified list item from the View selection list.
Methods inherited from BasePage
basic_page_elements, button, damballa, frame_element, link
Instance Method Details
#has_attachment?(subject) ⇒ Boolean
Returns true or false depending on whether the specified announcement has an attachment.
28 29 30 31 32 33 34 35 |
# File 'lib/sambal-cle/page_objects/announcements.rb', line 28 def (subject) if frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/).exist? return frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/).image(:alt=>"attachment").exist? else puts "Can't find your target row. Your test is faulty." return false end end |
#subjects ⇒ Object
Returns an array of the subject strings of the announcements listed on the page.
17 18 19 20 21 22 |
# File 'lib/sambal-cle/page_objects/announcements.rb', line 17 def subjects links = frm.table(:class=>"listHier").links.find_all { |link| link.title=~/View announcement/ } subjects = [] links.each { |link| subjects << link.text } return subjects end |
#view=(list_item) ⇒ Object
Selects the specified list item from the View selection list.
48 49 50 |
# File 'lib/sambal-cle/page_objects/announcements.rb', line 48 def view=(list_item) frm.select(:id=>"view").set(list_item) end |