kuali-sakai-common-lib 0.0.1 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/kuali-sakai-common-lib.gemspec +4 -5
- data/lib/kuali-sakai-common-lib.rb +3 -2
- data/lib/kuali-sakai-common-lib/add_files.rb +260 -0
- data/lib/kuali-sakai-common-lib/announcements.rb +301 -0
- data/lib/kuali-sakai-common-lib/assessments.rb +1183 -0
- data/lib/kuali-sakai-common-lib/assignments.rb +861 -0
- data/lib/kuali-sakai-common-lib/basic_lti.rb +13 -0
- data/lib/kuali-sakai-common-lib/blogs.rb +23 -0
- data/lib/kuali-sakai-common-lib/calendar.rb +466 -0
- data/lib/kuali-sakai-common-lib/calendar_summary.rb +0 -0
- data/lib/kuali-sakai-common-lib/chat_room.rb +0 -0
- data/lib/{core-ext.rb → kuali-sakai-common-lib/core-ext.rb} +0 -0
- data/lib/kuali-sakai-common-lib/drop_box.rb +0 -0
- data/lib/kuali-sakai-common-lib/email_archive.rb +28 -0
- data/lib/kuali-sakai-common-lib/forums.rb +326 -0
- data/lib/kuali-sakai-common-lib/gem_ext.rb +36 -0
- data/lib/kuali-sakai-common-lib/gradebook.rb +23 -0
- data/lib/kuali-sakai-common-lib/gradebook2.rb +24 -0
- data/lib/kuali-sakai-common-lib/messages.rb +639 -0
- data/lib/kuali-sakai-common-lib/news.rb +8 -0
- data/lib/kuali-sakai-common-lib/polls.rb +77 -0
- data/lib/kuali-sakai-common-lib/post_em.rb +0 -0
- data/lib/kuali-sakai-common-lib/profile.rb +46 -0
- data/lib/kuali-sakai-common-lib/profile2.rb +360 -0
- data/lib/kuali-sakai-common-lib/resources_roster.rb +0 -0
- data/lib/kuali-sakai-common-lib/rwiki.rb +0 -0
- data/lib/kuali-sakai-common-lib/sections.rb +237 -0
- data/lib/kuali-sakai-common-lib/single_user.rb +0 -0
- data/lib/kuali-sakai-common-lib/site_statistics.rb +0 -0
- data/lib/kuali-sakai-common-lib/syllabus.rb +182 -0
- data/lib/{utilities.rb → kuali-sakai-common-lib/utilities.rb} +13 -2
- metadata +51 -8
@@ -1,14 +1,13 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
1
|
spec = Gem::Specification.new do |s|
|
4
2
|
s.name = 'kuali-sakai-common-lib'
|
5
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.6'
|
6
4
|
s.summary = %q{Modules and methods common to the rSmart testing gems}
|
7
5
|
s.description = %q{This gem provides a set of modules and methods that are common to the Kuali and Sakai open source project's rSmart functional testing API gems.\n\nThis gem is not useful except in the context of one of the other rSmart Kuali/Sakai testing API gems.}
|
8
6
|
s.files = Dir.glob("**/**/**")
|
9
7
|
s.test_files = Dir.glob("test/*test_rb")
|
10
8
|
s.authors = ["Abraham Heward"]
|
11
|
-
s.email =
|
12
|
-
|
9
|
+
s.email = %w{"aheward@rsmart.com"}
|
10
|
+
s.homepage = 'https://github.com/aheward/Kuali-Sakai-Functional-Test-Automation-Framework/tree/Sakai-CLE/Common'
|
11
|
+
s.add_dependency 'page-object', '>= 0.6.6'
|
13
12
|
s.required_ruby_version = '>= 1.9.2'
|
14
13
|
end
|
@@ -1,2 +1,3 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'watir-webdriver'
|
2
|
+
require 'page-object'
|
3
|
+
Dir["#{File.dirname(__FILE__)}/kuali-sakai-common-lib/*.rb"].each {|f| require f }
|
@@ -0,0 +1,260 @@
|
|
1
|
+
# This class consolidates the code that can be shared among all the
|
2
|
+
# File Upload and Attachment pages.
|
3
|
+
#
|
4
|
+
# Not every method in this class will be appropriate for every attachment page.
|
5
|
+
class AddFiles
|
6
|
+
|
7
|
+
@@classes = { :this=>"Superclassdummy", :parent=>"Superclassdummy" }
|
8
|
+
|
9
|
+
# Use this for debugging purposes only...
|
10
|
+
def what_is_parent?
|
11
|
+
puts @@classes[:parent]
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns an array of the displayed folder names.
|
15
|
+
def folder_names
|
16
|
+
names = []
|
17
|
+
frm.table(:class=>/listHier lines/).rows.each do |row|
|
18
|
+
next if row.td(:class=>"specialLink").exist? == false
|
19
|
+
next if row.td(:class=>"specialLink").link(:title=>"Folder").exist? == false
|
20
|
+
names << row.td(:class=>"specialLink").link(:title=>"Folder").text
|
21
|
+
end
|
22
|
+
return names
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns an array of the file names currently listed
|
26
|
+
# on the page.
|
27
|
+
#
|
28
|
+
# It excludes folder names.
|
29
|
+
def file_names
|
30
|
+
names = []
|
31
|
+
frm.table(:class=>/listHier lines/).rows.each do |row|
|
32
|
+
next if row.td(:class=>"specialLink").exist? == false
|
33
|
+
next if row.td(:class=>"specialLink").link(:title=>"Folder").exist?
|
34
|
+
names << row.td(:class=>"specialLink").link(:href=>/access.content/, :index=>1).text
|
35
|
+
end
|
36
|
+
return names
|
37
|
+
end
|
38
|
+
|
39
|
+
# Clicks the Select button next to the specified file.
|
40
|
+
def select_file(filename)
|
41
|
+
frm.table(:class=>/listHier lines/).row(:text, /#{Regexp.escape(filename)}/).link(:text=>"Select").click
|
42
|
+
end
|
43
|
+
|
44
|
+
# Clicks the Remove button.
|
45
|
+
def remove
|
46
|
+
frm.button(:value=>"Remove").click
|
47
|
+
end
|
48
|
+
|
49
|
+
# Clicks the remove link for the specified item in the attachment list.
|
50
|
+
def remove_item(file_name)
|
51
|
+
frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(file_name)}/).link(:href=>/doRemoveitem/).click
|
52
|
+
end
|
53
|
+
|
54
|
+
# Clicks the Move button.
|
55
|
+
def move
|
56
|
+
frm.button(:value=>"Move").click
|
57
|
+
end
|
58
|
+
|
59
|
+
# Clicks the Show Other Sites link.
|
60
|
+
def show_other_sites
|
61
|
+
frm.link(:text=>"Show other sites").click
|
62
|
+
end
|
63
|
+
|
64
|
+
# Clicks on the specified folder image, which
|
65
|
+
# will open the folder tree and remain on the page.
|
66
|
+
def open_folder(foldername)
|
67
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(foldername)}/).link(:title=>"Open this folder").click
|
68
|
+
end
|
69
|
+
|
70
|
+
# Clicks on the specified folder name, which should open
|
71
|
+
# the folder contents on a refreshed page.
|
72
|
+
def go_to_folder(foldername)
|
73
|
+
frm.link(:text=>foldername).click
|
74
|
+
end
|
75
|
+
|
76
|
+
# Sets the URL field to the specified value.
|
77
|
+
def url=(url_string)
|
78
|
+
frm.text_field(:id=>"url").set(url_string)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Clicks the Add button next to the URL field.
|
82
|
+
def add
|
83
|
+
frm.button(:value=>"Add").click
|
84
|
+
end
|
85
|
+
|
86
|
+
# Gets the value of the access level cell for the specified
|
87
|
+
# file.
|
88
|
+
def access_level(filename)
|
89
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(filename)}/)[6].text
|
90
|
+
end
|
91
|
+
|
92
|
+
def edit_details(name)
|
93
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(name)}/).li(:text=>/Action/, :class=>"menuOpen").fire_event("onclick")
|
94
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(name)}/).link(:text=>"Edit Details").click
|
95
|
+
instantiate_class(:file_details)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Clicks the Create Folders menu item in the
|
99
|
+
# Add menu of the specified folder.
|
100
|
+
def create_subfolders_in(folder_name)
|
101
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Start Add Menu").fire_event("onfocus")
|
102
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create Folders").click
|
103
|
+
instantiate_class(:create_folders)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Enters the specified file into the file field name (assuming it's in the
|
107
|
+
# data/sakai-cle-test-api folder or a subfolder therein)
|
108
|
+
#
|
109
|
+
# Does NOT instantiate any class, so use only when no page refresh occurs.
|
110
|
+
def upload_file(filename, filepath="")
|
111
|
+
frm.file_field(:id=>"upload").set(filepath + filename)
|
112
|
+
if frm.div(:class=>"alertMessage").exist?
|
113
|
+
sleep 2
|
114
|
+
upload_file(filename)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Enters the specified file into the file field name (assuming it's in the
|
119
|
+
# data/sakai-cle-test-api folder or a subfolder therein)
|
120
|
+
#
|
121
|
+
# Use this method ONLY for instances where there's a file field on the page
|
122
|
+
# with an "upload" id.
|
123
|
+
def upload_local_file(filename, filepath="")
|
124
|
+
frm.file_field(:id=>"upload").set(filepath + filename)
|
125
|
+
if frm.div(:class=>"alertMessage").exist?
|
126
|
+
sleep 2
|
127
|
+
upload_local_file(filename)
|
128
|
+
end
|
129
|
+
instantiate_class(:this)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Clicks the Add Menu for the specified
|
133
|
+
# folder, then selects the Upload Files
|
134
|
+
# command in the menu that appears.
|
135
|
+
def upload_file_to_folder(folder_name)
|
136
|
+
upload_files_to_folder(folder_name)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Clicks the Add Menu for the specified
|
140
|
+
# folder, then selects the Upload Files
|
141
|
+
# command in the menu that appears.
|
142
|
+
def upload_files_to_folder(folder_name)
|
143
|
+
if frm.li(:text=>/A/, :class=>"menuOpen").exist?
|
144
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).li(:text=>/A/, :class=>"menuOpen").fire_event("onclick")
|
145
|
+
else
|
146
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Start Add Menu").fire_event("onfocus")
|
147
|
+
end
|
148
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Upload Files").click
|
149
|
+
instantiate_class(:upload_files)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Clicks the "Attach a copy" link for the specified
|
153
|
+
# file, then reinstantiates the Class.
|
154
|
+
# If an alert box appears, the method will call itself again.
|
155
|
+
# Note that this can lead to an infinite loop. Will need to fix later.
|
156
|
+
def attach_a_copy(file_name)
|
157
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(file_name)}/).link(:href=>/doAttachitem/).click
|
158
|
+
if frm.div(:class=>"alertMessage").exist?
|
159
|
+
sleep 1
|
160
|
+
attach_a_copy(file_name) # TODO - This can loop infinitely
|
161
|
+
end
|
162
|
+
instantiate_class(:this)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Clicks the Create Folders menu item in the
|
166
|
+
# Add menu of the specified folder.
|
167
|
+
def create_subfolders_in(folder_name)
|
168
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Start Add Menu").fire_event("onfocus")
|
169
|
+
frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(folder_name)}/).link(:text=>"Create Folders").click
|
170
|
+
instantiate_class(:create_folders)
|
171
|
+
end
|
172
|
+
|
173
|
+
# Takes the specified array object containing pointers
|
174
|
+
# to local file resources, then uploads those files to
|
175
|
+
# the folder specified, checks if they all uploaded properly and
|
176
|
+
# if not, re-tries the ones that failed the first time.
|
177
|
+
#
|
178
|
+
# Finally, it re-instantiates the appropriate page class.
|
179
|
+
# Note that it expects all files to be located in the same folder (can be in subfolders of that folder).
|
180
|
+
def upload_multiple_files_to_folder(folder, file_array, file_path="")
|
181
|
+
|
182
|
+
upload = upload_files_to_folder folder
|
183
|
+
|
184
|
+
file_array.each do |file|
|
185
|
+
upload.file_to_upload(file, file_path)
|
186
|
+
upload.add_another_file
|
187
|
+
end
|
188
|
+
|
189
|
+
resources = upload.upload_files_now
|
190
|
+
|
191
|
+
file_array.each do |file|
|
192
|
+
file =~ /(?<=\/).+/
|
193
|
+
# puts $~.to_s # For debugging purposes
|
194
|
+
unless resources.file_names.include?($~.to_s)
|
195
|
+
upload_files = resources.upload_files_to_folder(folder)
|
196
|
+
upload_files.file_to_upload(file, file_path)
|
197
|
+
resources = upload_files.upload_files_now
|
198
|
+
end
|
199
|
+
end
|
200
|
+
instantiate_class(:this)
|
201
|
+
end
|
202
|
+
|
203
|
+
# Clicks the Continue button then
|
204
|
+
# decides which page class to instantiate
|
205
|
+
# based on the page that appears. This is going to need to be fixed.
|
206
|
+
def continue
|
207
|
+
frm.div(:class=>"highlightPanel").span(:id=>"submitnotifxxx").wait_while_present
|
208
|
+
frm.button(:value=>"Continue").click
|
209
|
+
page_title = @browser.div(:class=>"title").text
|
210
|
+
case(page_title)
|
211
|
+
when "Lessons"
|
212
|
+
instantiate_class(:parent)
|
213
|
+
when "Assignments"
|
214
|
+
if frm.div(:class=>"portletBody").h3.text=~/In progress/ || frm.div(:class=>"portletBody").h3.text == "Select supporting files"
|
215
|
+
instantiate_class(:second)
|
216
|
+
elsif frm.div(:class=>"portletBody").h3.text=~/edit/i || frm.div(:class=>"portletBody").h3.text=~/add/i
|
217
|
+
instantiate_class(:parent)
|
218
|
+
elsif frm.form(:id=>"gradeForm").exist?
|
219
|
+
instantiate_class(:third)
|
220
|
+
end
|
221
|
+
when "Forums"
|
222
|
+
if frm.div(:class=>"portletBody").h3.text == "Forum Settings"
|
223
|
+
instantiate_class(:second)
|
224
|
+
else
|
225
|
+
instantiate_class(:parent)
|
226
|
+
end
|
227
|
+
when "Messages"
|
228
|
+
if frm.div(:class=>/breadCrumb/).text =~ /Reply to Message/
|
229
|
+
instantiate_class(:second)
|
230
|
+
else
|
231
|
+
instantiate_class(:parent)
|
232
|
+
end
|
233
|
+
when "Calendar"
|
234
|
+
frm.frame(:id, "description___Frame").td(:id, "xEditingArea").frame(:index=>0).wait_until_present
|
235
|
+
instantiate_class(:parent)
|
236
|
+
when "Portfolio Templates"
|
237
|
+
if frm.div(:class=>"portletBody").h3.text=="Select supporting files"
|
238
|
+
instantiate_class(:second)
|
239
|
+
else
|
240
|
+
instantiate_class(:parent)
|
241
|
+
end
|
242
|
+
else
|
243
|
+
instantiate_class(:parent)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
private
|
248
|
+
|
249
|
+
# This is a private method that is only used inside this superclass.
|
250
|
+
def instantiate_class(key)
|
251
|
+
eval(@@classes[key]).new(@browser)
|
252
|
+
end
|
253
|
+
|
254
|
+
# This is another private method--a better way to
|
255
|
+
# instantiate the @@classes hash variable.
|
256
|
+
def set_classes_hash(hash_object)
|
257
|
+
@@classes = hash_object
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
@@ -0,0 +1,301 @@
|
|
1
|
+
#================
|
2
|
+
# Announcements Pages
|
3
|
+
#================
|
4
|
+
|
5
|
+
# The Announcements list page for a Site.
|
6
|
+
module AnnouncementsMethods
|
7
|
+
|
8
|
+
# Clicks the add button, instantiates the AddEditAnnouncements class.
|
9
|
+
def add
|
10
|
+
frm.div(:class=>"portletBody").link(:title=>"Add").click
|
11
|
+
frm.frame(:id, "body___Frame").td(:id, "xEditingArea").frame(:index=>0).wait_until_present(60)
|
12
|
+
AddEditAnnouncements.new(@browser)
|
13
|
+
end
|
14
|
+
|
15
|
+
# Edits the specified announcement in the list.
|
16
|
+
# @param subject [String] the text of the announcement listing link.
|
17
|
+
def edit(subject)
|
18
|
+
frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/).link(:text=>"Edit").click
|
19
|
+
AddEditAnnouncements.new(@browser)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns an array of the subject strings of the announcements
|
23
|
+
# listed on the page.
|
24
|
+
def subjects
|
25
|
+
links = frm.table(:class=>"listHier").links.find_all { |link| link.title=~/View announcement/ }
|
26
|
+
subjects = []
|
27
|
+
links.each { |link| subjects << link.text }
|
28
|
+
return subjects
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns true or false depending on whether the specified announcement has an attachment.
|
32
|
+
# @param subject [String] the text of the announcement listing link.
|
33
|
+
def has_attachment?(subject)
|
34
|
+
if frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/).exist?
|
35
|
+
return frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/).image(:alt=>"attachment").exist?
|
36
|
+
else
|
37
|
+
puts "Can't find your target row. Your test is faulty."
|
38
|
+
return false
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Returns the text of the "For" column for
|
43
|
+
# the specified announcement.
|
44
|
+
# @param subject [String] the text of the announcement listing link.
|
45
|
+
def for_column(subject)
|
46
|
+
frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(subject)}/)[4].text
|
47
|
+
end
|
48
|
+
|
49
|
+
# Clicks the specified announcement link and instantiates the PreviewAnnouncements class.
|
50
|
+
# @param subject [String] the text of the announcement listing link.
|
51
|
+
def preview_announcement(subject)
|
52
|
+
frm.link(:text=>subject).click
|
53
|
+
PreviewAnnouncements.new(@browser)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Selects the specified list item from the View selection list.
|
57
|
+
# @param list_item [String] the text of the option in the selection list.
|
58
|
+
def view=(list_item)
|
59
|
+
frm.select(:id=>"view").set(list_item)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Clicks the Merge link and instantiates the AnnouncementsMerge class.
|
63
|
+
def merge
|
64
|
+
frm.link(:text=>"Merge").click
|
65
|
+
AnnouncementsMerge.new(@browser)
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show Announcements from Another Site. On this page you select what announcements
|
71
|
+
# you want to merge into the current Site. This module contains definitions for the
|
72
|
+
# page elements that are common between OAE and CLE.
|
73
|
+
module AnnouncementsMergeMethods
|
74
|
+
|
75
|
+
# Checks the checkbox for the specified site name
|
76
|
+
# @param site_name [String] the name of the relevant site displayed in the table
|
77
|
+
def check(site_name)
|
78
|
+
frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(site_name)}/).checkbox(:id=>/site/).set
|
79
|
+
end
|
80
|
+
|
81
|
+
# Clicks the Save button and returns the Announcements class.
|
82
|
+
def save
|
83
|
+
frm.button(:value=>"Save").click
|
84
|
+
Announcements.new(@browser)
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
# Contains the common page elements for the Announcements Preview page
|
90
|
+
module PreviewAnnouncementsMethods
|
91
|
+
|
92
|
+
# Clicks the Return to list button and returns the Announcements class.
|
93
|
+
def return_to_list
|
94
|
+
frm.button(:value=>"Return to List").click
|
95
|
+
Announcements.new(@browser)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Clicks the Save changes button and returns the Announcements class.
|
99
|
+
def save_changes
|
100
|
+
frm.button(:value=>"Save Changes").click
|
101
|
+
Announcements.new(@browser)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Clicks the Edit button and returns the AddEditAnnouncements class.
|
105
|
+
def edit
|
106
|
+
frm.button(:value=>"Edit").click
|
107
|
+
AddEditAnnouncements.new(@browser)
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
# Contains the common page elements for the Add/Edit Announcements page.
|
113
|
+
module AddEditAnnouncementsMethods
|
114
|
+
|
115
|
+
# Clicks the Add Announcement button and then determines whether to return
|
116
|
+
# AddEditAnnouncements or Announcements class.
|
117
|
+
def add_announcement
|
118
|
+
frm.button(:value=>"Add Announcement").click
|
119
|
+
if frm.div(:class=>"portletBody").h3.text=~/Add Announcement/
|
120
|
+
AddEditAnnouncements.new(@browser)
|
121
|
+
else
|
122
|
+
Announcements.new(@browser)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Clicks the Save changes button and returns the Announcements class.
|
127
|
+
def save_changes
|
128
|
+
frm.button(:value=>"Save Changes").click
|
129
|
+
Announcements.new(@browser)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Clicks the Preview button and returns the PreviewAnnouncements class.
|
133
|
+
def preview
|
134
|
+
frm.button(:value=>"Preview").click
|
135
|
+
PreviewAnnouncements.new(@browser)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Sends the specified text block to the rich text editor
|
139
|
+
# @param text [String] the text that you want to add to the editor.
|
140
|
+
def body=(text)
|
141
|
+
frm.frame(:id, "body___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Clicks the Add attachments button and returns the Announcments Attach class.
|
145
|
+
def add_attachments
|
146
|
+
frm.button(:value=>"Add Attachments").click
|
147
|
+
AnnouncementsAttach.new(@browser)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Clicks the checkbox for the specified group name
|
151
|
+
# when you've set the announcement access to display
|
152
|
+
# to groups.
|
153
|
+
# @param group_name [String] the name of the group in the table that you intend to select.
|
154
|
+
def check_group(group_name)
|
155
|
+
frm.table(:id=>"groupTable").row(:text=>/#{Regexp.escape(group_name)}/).checkbox(:name=>"selectedGroups").set
|
156
|
+
end
|
157
|
+
|
158
|
+
# Sets the Announcement Title field to the specified
|
159
|
+
# string value.
|
160
|
+
# @param string [String] the text you want to put in the title field.
|
161
|
+
def title=(string)
|
162
|
+
frm.text_field(:id=>"subject").set(string)
|
163
|
+
end
|
164
|
+
|
165
|
+
# Clicks the radio button for "Only members of this site can see this announcement"
|
166
|
+
def select_site_members
|
167
|
+
frm.radio(:id=>"site").set
|
168
|
+
end
|
169
|
+
|
170
|
+
# Clicks the radio button for "This announcement is publicly viewable"
|
171
|
+
def select_publicly_viewable
|
172
|
+
frm.radio(:id=>"pubview").set
|
173
|
+
end
|
174
|
+
|
175
|
+
# Clicks the radio button for "Displays this announcement to selected groups only."
|
176
|
+
def select_groups
|
177
|
+
frm.radio(:id=>"groups").set
|
178
|
+
end
|
179
|
+
|
180
|
+
# Clicks the radio button for "Show - (Post and display this announcement immediately)"
|
181
|
+
def select_show
|
182
|
+
frm.radio(:id=>"hidden_false").set
|
183
|
+
end
|
184
|
+
|
185
|
+
# Clicks the radio button for "Hide - (Draft mode - Do not display this announcement at this time)"
|
186
|
+
def select_hide
|
187
|
+
frm.radio(:id=>"hidden_true").set
|
188
|
+
end
|
189
|
+
|
190
|
+
# Clicks the radio button for "Specify Dates - (Choose when this announcement will be displayed)"
|
191
|
+
def select_specify_dates
|
192
|
+
frm.radio(:id=>"hidden_specify").set
|
193
|
+
end
|
194
|
+
|
195
|
+
# Checks the checkbox for "Beginning"
|
196
|
+
def check_beginning
|
197
|
+
frm.checkbox(:id=>"use_start_date").set
|
198
|
+
end
|
199
|
+
|
200
|
+
# Checks the checkbox for "Ending"
|
201
|
+
def check_ending
|
202
|
+
frm.checkbox(:id=>"use_end_date").set
|
203
|
+
end
|
204
|
+
|
205
|
+
# Checks the checkbox for selecting all Groups
|
206
|
+
def check_all
|
207
|
+
frm.checkbox(:id=>"selectall").set
|
208
|
+
end
|
209
|
+
|
210
|
+
# Sets the Beginning Month selection to the
|
211
|
+
# specified string.
|
212
|
+
def beginning_month=(string)
|
213
|
+
frm.select(:id=>"release_month").select(string)
|
214
|
+
end
|
215
|
+
|
216
|
+
# Sets the Beginning Day selection to the
|
217
|
+
# specified string.
|
218
|
+
def beginning_day=(string)
|
219
|
+
frm.select(:id=>"release_day").select(string)
|
220
|
+
end
|
221
|
+
|
222
|
+
# Sets the Beginning Year selection to the
|
223
|
+
# specified string.
|
224
|
+
def beginning_year=(string)
|
225
|
+
frm.select(:id=>"release_year").select(string)
|
226
|
+
end
|
227
|
+
|
228
|
+
# Sets the Beginning Hour selection to the
|
229
|
+
# specified string
|
230
|
+
def beginning_hour=(string)
|
231
|
+
frm.select(:id=>"release_hour").select(string)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Sets the Beginning Minute selection to the
|
235
|
+
# specified string
|
236
|
+
def beginning_minute=(string)
|
237
|
+
frm.select(:id=>"release_minute").select(string)
|
238
|
+
end
|
239
|
+
|
240
|
+
# Sets the AM or PM value to the specified string.
|
241
|
+
# Obviously the string should be either "AM" or "PM".
|
242
|
+
def beginning_meridian=(string)
|
243
|
+
frm.select(:id=>"release_ampm").select(string)
|
244
|
+
end
|
245
|
+
|
246
|
+
# Sets the Ending Month selection to the specified
|
247
|
+
# string.
|
248
|
+
def ending_month=(string)
|
249
|
+
frm.select(:id=>"retract_month").select(string)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Sets the Ending Day selection to the specified
|
253
|
+
# string.
|
254
|
+
def ending_day=(string)
|
255
|
+
frm.select(:id=>"retract_day").select(string)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Sets the Ending Year selection to the specified
|
259
|
+
# string.
|
260
|
+
def ending_year=(string)
|
261
|
+
frm.select(:id=>"retract_year").select(string)
|
262
|
+
end
|
263
|
+
|
264
|
+
# Sets the Ending Hour selection to the specified
|
265
|
+
# string.
|
266
|
+
def ending_hour=(string)
|
267
|
+
frm.select(:id=>"retract_hour").select(string)
|
268
|
+
end
|
269
|
+
|
270
|
+
# Sets the Ending Minute selection to the specified
|
271
|
+
# string.
|
272
|
+
def ending_minute=(string)
|
273
|
+
frm.select(:id=>"retract_minute").select(string)
|
274
|
+
end
|
275
|
+
|
276
|
+
# Sets the Ending AM/PM selection to the specified
|
277
|
+
# value.
|
278
|
+
def ending_meridian=(string)
|
279
|
+
frm.select(:id=>"retract_ampm").select(string)
|
280
|
+
end
|
281
|
+
|
282
|
+
# Gets the text of the alert message when it appears on
|
283
|
+
# the page
|
284
|
+
def alert_message
|
285
|
+
frm.div(:class=>"alertMessage").text
|
286
|
+
end
|
287
|
+
|
288
|
+
end
|
289
|
+
|
290
|
+
module AnnouncementsMergeMethods
|
291
|
+
|
292
|
+
end
|
293
|
+
|
294
|
+
module AnnouncementsOptionsMethods
|
295
|
+
|
296
|
+
|
297
|
+
end
|
298
|
+
|
299
|
+
module AnnouncementsPermissionsMethods
|
300
|
+
|
301
|
+
end
|