Module: AddEditAnnouncementsMethods

Defined in:
lib/kuali-sakai-common-lib/announcements.rb

Overview

Contains the common page elements for the Add/Edit Announcements page.

Instance Method Summary collapse

Instance Method Details

#add_announcementObject

Clicks the Add Announcement button and then determines whether to return AddEditAnnouncements or Announcements class.



117
118
119
120
121
122
123
124
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 117

def add_announcement
  frm.button(:value=>"Add Announcement").click
  if frm.div(:class=>"portletBody").h3.text=~/Add Announcement/
    AddEditAnnouncements.new(@browser)
  else
    Announcements.new(@browser)
  end
end

#add_attachmentsObject

Clicks the Add attachments button and returns the Announcments Attach class.



145
146
147
148
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 145

def add_attachments
  frm.button(:value=>"Add Attachments").click
  AnnouncementsAttach.new(@browser)
end

#alert_messageObject

Gets the text of the alert message when it appears on the page



284
285
286
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 284

def alert_message
  frm.div(:class=>"alertMessage").text
end

#beginning_day=(string) ⇒ Object

Sets the Beginning Day selection to the specified string.



218
219
220
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 218

def beginning_day=(string)
  frm.select(:id=>"release_day").select(string)
end

#beginning_hour=(string) ⇒ Object

Sets the Beginning Hour selection to the specified string



230
231
232
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 230

def beginning_hour=(string)
  frm.select(:id=>"release_hour").select(string)
end

#beginning_meridian=(string) ⇒ Object

Sets the AM or PM value to the specified string. Obviously the string should be either “AM” or “PM”.



242
243
244
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 242

def beginning_meridian=(string)
  frm.select(:id=>"release_ampm").select(string)
end

#beginning_minute=(string) ⇒ Object

Sets the Beginning Minute selection to the specified string



236
237
238
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 236

def beginning_minute=(string)
  frm.select(:id=>"release_minute").select(string)
end

#beginning_month=(string) ⇒ Object

Sets the Beginning Month selection to the specified string.



212
213
214
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 212

def beginning_month=(string)
  frm.select(:id=>"release_month").select(string)
end

#beginning_year=(string) ⇒ Object

Sets the Beginning Year selection to the specified string.



224
225
226
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 224

def beginning_year=(string)
  frm.select(:id=>"release_year").select(string)
end

#body=(text) ⇒ Object

Sends the specified text block to the rich text editor

Parameters:

  • text (String)

    the text that you want to add to the editor.



140
141
142
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 140

def body=(text)
  frm.frame(:id, "body___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
end

#check_allObject

Checks the checkbox for selecting all Groups



206
207
208
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 206

def check_all
  frm.checkbox(:id=>"selectall").set
end

#check_beginningObject

Checks the checkbox for “Beginning”



196
197
198
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 196

def check_beginning
  frm.checkbox(:id=>"use_start_date").set
end

#check_endingObject

Checks the checkbox for “Ending”



201
202
203
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 201

def check_ending
  frm.checkbox(:id=>"use_end_date").set
end

#check_group(group_name) ⇒ Object

Clicks the checkbox for the specified group name when you’ve set the announcement access to display to groups.

Parameters:

  • group_name (String)

    the name of the group in the table that you intend to select.



154
155
156
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 154

def check_group(group_name)
  frm.table(:id=>"groupTable").row(:text=>/#{Regexp.escape(group_name)}/).checkbox(:name=>"selectedGroups").set
end

#ending_day=(string) ⇒ Object

Sets the Ending Day selection to the specified string.



254
255
256
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 254

def ending_day=(string)
  frm.select(:id=>"retract_day").select(string)
end

#ending_hour=(string) ⇒ Object

Sets the Ending Hour selection to the specified string.



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

def ending_hour=(string)
  frm.select(:id=>"retract_hour").select(string)
end

#ending_meridian=(string) ⇒ Object

Sets the Ending AM/PM selection to the specified value.



278
279
280
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 278

def ending_meridian=(string)
  frm.select(:id=>"retract_ampm").select(string)
end

#ending_minute=(string) ⇒ Object

Sets the Ending Minute selection to the specified string.



272
273
274
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 272

def ending_minute=(string)
  frm.select(:id=>"retract_minute").select(string)
end

#ending_month=(string) ⇒ Object

Sets the Ending Month selection to the specified string.



248
249
250
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 248

def ending_month=(string)
  frm.select(:id=>"retract_month").select(string)
end

#ending_year=(string) ⇒ Object

Sets the Ending Year selection to the specified string.



260
261
262
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 260

def ending_year=(string)
  frm.select(:id=>"retract_year").select(string)
end

#previewObject

Clicks the Preview button and returns the PreviewAnnouncements class.



133
134
135
136
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 133

def preview
  frm.button(:value=>"Preview").click
  PreviewAnnouncements.new(@browser)
end

#save_changesObject

Clicks the Save changes button and returns the Announcements class.



127
128
129
130
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 127

def save_changes
  frm.button(:value=>"Save Changes").click
  Announcements.new(@browser)
end

#select_groupsObject

Clicks the radio button for “Displays this announcement to selected groups only.”



176
177
178
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 176

def select_groups
  frm.radio(:id=>"groups").set
end

#select_hideObject

Clicks the radio button for “Hide - (Draft mode - Do not display this announcement at this time)”



186
187
188
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 186

def select_hide
  frm.radio(:id=>"hidden_true").set
end

#select_publicly_viewableObject

Clicks the radio button for “This announcement is publicly viewable”



171
172
173
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 171

def select_publicly_viewable
  frm.radio(:id=>"pubview").set
end

#select_showObject

Clicks the radio button for “Show - (Post and display this announcement immediately)”



181
182
183
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 181

def select_show
  frm.radio(:id=>"hidden_false").set
end

#select_site_membersObject

Clicks the radio button for “Only members of this site can see this announcement”



166
167
168
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 166

def select_site_members
  frm.radio(:id=>"site").set
end

#select_specify_datesObject

Clicks the radio button for “Specify Dates - (Choose when this announcement will be displayed)”



191
192
193
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 191

def select_specify_dates
  frm.radio(:id=>"hidden_specify").set
end

#title=(string) ⇒ Object

Sets the Announcement Title field to the specified string value.

Parameters:

  • string (String)

    the text you want to put in the title field.



161
162
163
# File 'lib/kuali-sakai-common-lib/announcements.rb', line 161

def title=(string)
  frm.text_field(:id=>"subject").set(string)
end