sakai-cle-test-api 0.0.9 → 0.0.75

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/lib/sakai-cle-test-api.rb +2 -7
  2. data/lib/sakai-cle-test-api/admin_page_elements.rb +2 -6
  3. data/lib/sakai-cle-test-api/announcements.rb +7 -274
  4. data/lib/sakai-cle-test-api/assessments.rb +27 -930
  5. data/lib/sakai-cle-test-api/assignments.rb +13 -769
  6. data/lib/sakai-cle-test-api/basic_lti.rb +1 -5
  7. data/lib/sakai-cle-test-api/blogs.rb +2 -54
  8. data/lib/sakai-cle-test-api/calendar.rb +8 -423
  9. data/lib/sakai-cle-test-api/common_page_elements.rb +172 -69
  10. data/lib/sakai-cle-test-api/drop_box.rb +0 -21
  11. data/lib/sakai-cle-test-api/email_archive.rb +1 -15
  12. data/lib/sakai-cle-test-api/forums.rb +8 -282
  13. data/lib/sakai-cle-test-api/gradebook.rb +1 -19
  14. data/lib/sakai-cle-test-api/gradebook2.rb +1 -15
  15. data/lib/sakai-cle-test-api/messages.rb +15 -551
  16. data/lib/sakai-cle-test-api/news.rb +1 -3
  17. data/lib/sakai-cle-test-api/polls.rb +3 -65
  18. data/lib/sakai-cle-test-api/profile.rb +2 -36
  19. data/lib/sakai-cle-test-api/profile2.rb +6 -315
  20. data/lib/sakai-cle-test-api/sections.rb +8 -198
  21. data/lib/sakai-cle-test-api/site_page_elements.rb +441 -4
  22. data/lib/sakai-cle-test-api/syllabus.rb +7 -149
  23. data/lib/sakai-cle-test-api/tools_menu.rb +20 -3
  24. data/lib/sakai-cle-test-api/utilities.rb +0 -260
  25. data/sakai-cle-test-api.gemspec +3 -2
  26. metadata +19 -21
  27. data/lib/sakai-cle-test-api/add_files.rb +0 -198
  28. data/lib/sakai-cle-test-api/chat_room.rb +0 -0
  29. data/lib/sakai-cle-test-api/core-ext.rb +0 -90
  30. data/lib/sakai-cle-test-api/data_objects/announcement.rb +0 -38
  31. data/lib/sakai-cle-test-api/data_objects/assessment.rb +0 -32
  32. data/lib/sakai-cle-test-api/data_objects/assignment.rb +0 -62
  33. data/lib/sakai-cle-test-api/data_objects/event.rb +0 -86
  34. data/lib/sakai-cle-test-api/data_objects/lesson.rb +0 -137
  35. data/lib/sakai-cle-test-api/data_objects/resource.rb +0 -174
  36. data/lib/sakai-cle-test-api/data_objects/site.rb +0 -213
  37. data/lib/sakai-cle-test-api/data_objects/syllabus.rb +0 -7
  38. data/lib/sakai-cle-test-api/data_objects/topic.rb +0 -0
  39. data/lib/sakai-cle-test-api/data_objects/web_content_tool.rb +0 -52
  40. data/lib/sakai-cle-test-api/data_objects/wiki.rb +0 -7
  41. data/lib/sakai-cle-test-api/gem_ext.rb +0 -45
  42. data/lib/sakai-cle-test-api/lessons.rb +0 -440
  43. data/lib/sakai-cle-test-api/resources.rb +0 -138
  44. data/lib/sakai-cle-test-api/rich_text.rb +0 -13
@@ -1,110 +1,9 @@
1
-
2
- module SectionsMenu
3
- include PageObject
4
- # Clicks the Add Sections button/link and instantiates
5
- # the AddEditSections Class.
6
- def add_sections
7
- frm.link(:text=>"Add Sections").click
8
- AddEditSections.new(@browser)
9
- end
10
-
11
- def overview
12
- frm.link(:text=>"Overview").click
13
- Sections.new(@browser)
14
- end
15
-
16
- def student_memberships
17
- frm.link(:text=>"Student Memberships").click
18
- StudentMemberships.new(@browser)
19
- end
20
-
21
- def options
22
- frm.link(:text=>"Options").click
23
- SectionsOptions.new(@browser)
24
- end
25
-
26
- end
27
-
28
1
  # Topmost page for Sections in Site Management
29
2
  class Sections
30
3
  include PageObject
31
4
  include ToolsMenu
32
5
  include SectionsMenu
33
- # Clicks the Edit link for the specified section.
34
- # Then instantiates the AddEditSections class.
35
- def edit(title)
36
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Edit/).click
37
- AddEditSections.new(@browser)
38
- end
39
-
40
- def assign_tas(title)
41
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign TAs/).click
42
- AssignTeachingAssistants.new(@browser)
43
- end
44
-
45
- def assign_students(title)
46
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).link(:text=>/Assign Students/).click
47
- AssignStudents.new(@browser)
48
- end
49
-
50
- def check(title)
51
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>/remove/).set
52
- end
53
-
54
- def section_names
55
- names = []
56
- frm.table(:class=>/listHier/).rows.each do |row|
57
- if row.td(:class=>"leftIndent").exist?
58
- names << row.td(:class=>"leftIndent").div(:index=>0).text
59
- end
60
- end
61
- return names
62
- end
63
-
64
- def remove_sections
65
- frm.button(:value=>"Remove Sections").click
66
- Sections.new(@browser)
67
- end
68
-
69
- # Returns the text of the Teach Assistant cell for the specified
70
- # Section.
71
- def tas_for(title)
72
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[1].text
73
- end
74
-
75
- #
76
- def days_for(title)
77
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[2].text
78
- end
79
-
80
- #
81
- def time_for(title)
82
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[3].text
83
- end
84
-
85
- #
86
- def location_for(title)
87
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[4].text
88
- end
89
-
90
- #
91
- def current_size_for(title)
92
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[5].text
93
- end
94
-
95
- #
96
- def availability_for(title)
97
- frm.table(:class=>/listHier/).row(:text=>/#{Regexp.escape(title)}/)[6].text
98
- end
99
-
100
- def alert_text
101
- frm.div(:class=>"validation").text
102
- end
103
-
104
- def success_text
105
- frm.div(:class=>"success").text
106
- end
107
-
6
+ include SectionsMethods
108
7
  end
109
8
 
110
9
  # Methods in this class currently do not support
@@ -114,70 +13,13 @@ end
114
13
  # be supported in the future.
115
14
  class AddEditSections
116
15
 
16
+ identifier = {:class=>"portletMainIframe"}
17
+
117
18
  include PageObject
118
19
  include ToolsMenu
119
20
  include SectionsMenu
120
- # Clicks the Add Sections button then instantiates the Sections Class,
121
- # unless there's an Alert message, in which case it will reinstantiate
122
- # the class.
123
- def add_sections
124
- frm.button(:value=>"Add Sections").click
125
- if frm.div(:class=>"validation").exist?
126
- AddEditSections.new(@browser)
127
- else
128
- Sections.new(@browser)
129
- end
130
- end
131
-
132
- def alert_text
133
- frm.div(:class=>"validation").text
134
- end
135
-
136
- # The Update button is only available when editing an existing Sections record.
137
- def update
138
- frm.button(:value=>"Update").click
139
- if frm.div(:class=>"validation").exist?
140
- AddEditSections.new(@browser)
141
- else
142
- Sections.new(@browser)
143
- end
144
- end
145
-
146
- # This method takes an array object containing strings of the
147
- # days of the week and then clicks the appropriate checkboxes, based
148
- # on those strings.
149
- def check_days(array)
150
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/).set if array.include?(/mon/i)
151
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/).set if array.include?(/tue/i)
152
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/).set if array.include?(/wed/i)
153
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/).set if array.include?(/thu/i)
154
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/).set if array.include?(/fri/i)
155
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/).set if array.include?(/sat/i)
156
- frm.checkbox(:id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/).set if array.include?(/sun/i)
157
- end
158
-
159
- in_frame(:class=>"portletMainIframe") do |frame|
160
- select_list(:category, :id=>/SectionsForm:category/, :frame=>frame)
161
- text_field(:name, :id=>/SectionsForm:sectionTable:0:titleInput/, :frame=>frame)
162
- checkbox(:monday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:monday/, :frame=>frame)
163
- checkbox(:tuesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:tuesday/, :frame=>frame)
164
- checkbox(:wednesday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:wednesday/, :frame=>frame)
165
- checkbox(:thursday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:thursday/, :frame=>frame)
166
- checkbox(:friday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:friday/, :frame=>frame)
167
- checkbox(:saturday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:saturday/, :frame=>frame)
168
- checkbox(:sunday, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:sunday/, :frame=>frame)
169
- text_field(:start_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:startTime/, :frame=>frame)
170
- text_field(:end_time, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:endTime/, :frame=>frame)
171
- text_field(:location, :id=>/SectionsForm:sectionTable:0:meetingsTable:0:location/, :frame=>frame)
172
- radio_button(:startAM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>0, :frame=>frame) }
173
- radio_button(:startPM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:startTimeAm/, :index=>1, :frame=>frame) }
174
- radio_button(:endAM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>0, :frame=>frame) }
175
- radio_button(:endPM) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:meetingsTable:0:endTimeAm/, :index=>1, :frame=>frame) }
176
- radio_button(:unlimited_students) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:limit/, :index=>0, :frame=>frame) }
177
- radio_button(:limited_students) { |page| page.radio_button_element(:name=>/SectionsForm:sectionTable:0:limit/, :index=>1, :frame=>frame) }
178
- text_field(:max_students, :id=>/SectionsForm:sectionTable:0:maxEnrollmentInput/, :frame=>frame)
179
- end
180
-
21
+ include AddEditSectionsMethods
22
+ #include AddEditSectionsMethods
181
23
  end
182
24
 
183
25
  #
@@ -185,19 +27,7 @@ class AssignTeachingAssistants
185
27
  include PageObject
186
28
  include ToolsMenu
187
29
  include SectionsMenu
188
- def assign_TAs
189
- frm.button(:value=>"Assign TAs").click
190
- Sections.new(@browser)
191
- end
192
-
193
- in_frame(:class=>"portletMainIframe") do |frame|
194
- select_list(:available_tas, :id=>"memberForm:availableUsers", :frame=>frame)
195
- select_list(:assigned_tas, :id=>"memberForm:selectedUsers", :frame=>frame)
196
- button(:assign, :value=>">", :frame=>frame)
197
- button(:unassign, :value=>"<", :frame=>frame)
198
- button(:assign_all, :value=>">>", :frame=>frame)
199
- button(:unassign_all, :value=>"<<", :frame=>frame)
200
- end
30
+ include AssignTeachingAssistantsMethods
201
31
  end
202
32
 
203
33
  #
@@ -205,19 +35,7 @@ class AssignStudents
205
35
  include PageObject
206
36
  include ToolsMenu
207
37
  include SectionsMenu
208
- def assign_students
209
- frm.button(:value=>"Assign students").click
210
- Sections.new(@browser)
211
- end
212
-
213
- in_frame(:class=>"portletMainIframe") do |frame|
214
- select_list(:available_students, :id=>"memberForm:availableUsers", :frame=>frame)
215
- select_list(:assigned_students, :id=>"memberForm:selectedUsers", :frame=>frame)
216
- button(:assign, :value=>">", :frame=>frame)
217
- button(:unassign, :value=>"<", :frame=>frame)
218
- button(:assign_all, :value=>">>", :frame=>frame)
219
- button(:unassign_all, :value=>"<<", :frame=>frame)
220
- end
38
+ include AssignStudentsMethods
221
39
  end
222
40
 
223
41
  # The Options page for Sections.
@@ -225,13 +43,5 @@ class SectionsOptions
225
43
  include PageObject
226
44
  include ToolsMenu
227
45
  include SectionsMenu
228
- def update
229
- frm().button(:value=>"Update").click
230
- Sections.new(@browser)
231
- end
232
-
233
- in_frame(:class=>"portletMainIframe") do |frame|
234
- checkbox(:students_can_sign_up, :id=>"optionsForm:selfRegister", :frame=>frame)
235
- checkbox(:students_can_switch, :id=>"optionsForm:selfSwitch", :frame=>frame)
236
- end
46
+ include AssignStudentsMethods
237
47
  end
@@ -724,7 +724,27 @@ class Information
724
724
  end
725
725
 
726
726
 
727
+ #================
728
+ # Drop Box pages
729
+ #================
727
730
 
731
+ #
732
+ class DropBox < AddFiles
733
+
734
+ include ToolsMenu
735
+
736
+ def initialize(browser)
737
+ @browser = browser
738
+
739
+ @@classes = {
740
+ :this => "DropBox",
741
+ :parent => "DropBox",
742
+ :second => "",
743
+ :third => ""
744
+ }
745
+ end
746
+
747
+ end
728
748
 
729
749
 
730
750
 
@@ -1059,6 +1079,426 @@ end
1059
1079
 
1060
1080
 
1061
1081
 
1082
+ #================
1083
+ # Lesson Pages
1084
+ #================
1085
+
1086
+ # Contains items common to most Lessons pages.
1087
+ module LessonsMenu
1088
+
1089
+ # Clicks on the Preferences link on the Lessons page,
1090
+ # then instantiates the LessonPreferences class.
1091
+ def preferences
1092
+ frm.link(:text=>"Preferences").click
1093
+ LessonPreferences.new(@browser)
1094
+ end
1095
+
1096
+ def view
1097
+ frm.link(:text=>"View").click
1098
+ if frm.div(:class=>"meletePortletToolBarMessage").text=="Viewing student side..."
1099
+ ViewModuleList.new(@browser)
1100
+ else
1101
+ #FIXME
1102
+ end
1103
+ end
1104
+
1105
+ def manage
1106
+ frm.link(:text=>"Manage").click
1107
+ LessonManage.new(@browser)
1108
+ end
1109
+
1110
+ def author
1111
+ #FIXME
1112
+ end
1113
+
1114
+ end
1115
+
1116
+ # The Lessons page in a site ("icon-sakai-melete")
1117
+ #
1118
+ # Note that this class is inclusive of both the
1119
+ # Instructor/Admin and the Student views of this page
1120
+ # many methods will error out if used when in the
1121
+ # Student view.
1122
+ class Lessons
1123
+
1124
+ include PageObject
1125
+ include ToolsMenu
1126
+ include LessonsMenu
1127
+
1128
+ # Clicks the Add Module link, then
1129
+ # instantiates the AddModule class.
1130
+ #
1131
+ # Assumes the Add Module link is present
1132
+ # and will error out if it is not.
1133
+ def add_module
1134
+ frm.link(:text=>"Add Module").click
1135
+ AddEditModule.new(@browser)
1136
+ end
1137
+
1138
+ # Clicks on the link that matches the supplied
1139
+ # name value, then instantiates the
1140
+ # AddEditLesson, or ViewLesson class, depending
1141
+ # on which page loads.
1142
+ #
1143
+ # Will error out if there is no
1144
+ # matching link in the list.
1145
+ def open_lesson(name)
1146
+ frm.link(:text=>name).click
1147
+ if frm.div(:class=>"meletePortletToolBarMessage").exist? && frm.div(:class=>"meletePortletToolBarMessage").text=="Editing module..."
1148
+ AddEditModule.new(@browser)
1149
+ else
1150
+ ViewModule.new(@browser)
1151
+ end
1152
+ end
1153
+
1154
+ # Returns an array of the Module titles displayed on the page.
1155
+ def lessons_list
1156
+ list = []
1157
+ frm.table(:id=>/lis.+module.+form:table/).links.each do |link|
1158
+ if link.id=~/lis.+module.+form:table:.+:(edit|view)Mod/
1159
+ list << link.text
1160
+ end
1161
+ end
1162
+ return list
1163
+ end
1164
+
1165
+ # Returns and array containing the list of section titles for the
1166
+ # specified module.
1167
+ def sections_list(module_name)
1168
+ list = []
1169
+ if frm.table(:id=>/lis.+module.+form:table/).row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).exist?
1170
+ frm.table(:id=>/lis.+module.+form:table/).row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).links.each do |link|
1171
+ if link.id=~/Sec/
1172
+ list << link.text
1173
+ end
1174
+ end
1175
+ end
1176
+ return list
1177
+ end
1178
+
1179
+ end
1180
+
1181
+ # The student user's view of a Lesson Module or Section.
1182
+ class ViewModule
1183
+
1184
+ include PageObject
1185
+ include ToolsMenu
1186
+
1187
+ def sections_list
1188
+ list = []
1189
+ frm.table(:id=>"viewmoduleStudentform:tablesec").links.each { |link| list << link.text }
1190
+ return list
1191
+ end
1192
+
1193
+ def next
1194
+ frm.link(:text=>"Next").click
1195
+ ViewModule.new(@browser)
1196
+ end
1197
+
1198
+ # Returns the text of the Module title row
1199
+ def module_title
1200
+ frm.span(:id=>/modtitle/).text
1201
+ end
1202
+
1203
+ # Returns the text of the Section title row
1204
+ def section_title
1205
+ frm.span(:id=>/form:title/).text
1206
+ end
1207
+
1208
+ def content_include?(content)
1209
+ frm.form(:id=>"viewsectionStudentform").text.include?(content)
1210
+ end
1211
+
1212
+ end
1213
+
1214
+ # This is the Instructor's preview of the Student's view
1215
+ # of the list of Lesson Modules.
1216
+ class ViewModuleList
1217
+
1218
+ include PageObject
1219
+ include ToolsMenu
1220
+
1221
+ def open_lesson(name)
1222
+ frm.link(:text=>name).click
1223
+ LessonStudentSide.new(@browser)
1224
+ end
1225
+
1226
+ def open_section(name)
1227
+ frm.link(:text=>name).click
1228
+ SectionStudentSide.new(@browser)
1229
+ end
1230
+
1231
+ end
1232
+
1233
+ # The instructor's preview of the student view of the lesson.
1234
+ class LessonStudentSide
1235
+
1236
+ include PageObject
1237
+ include ToolsMenu
1238
+ include LessonsMenu
1239
+
1240
+ end
1241
+
1242
+ # The instructor's preview of the student's view of the section.
1243
+ class SectionStudentSide
1244
+
1245
+ include PageObject
1246
+ include ToolsMenu
1247
+ include LessonsMenu
1248
+
1249
+ end
1250
+
1251
+ # The Managing Options page for Lessons
1252
+ class LessonManage
1253
+
1254
+ include PageObject
1255
+ include ToolsMenu
1256
+ include LessonsMenu
1257
+
1258
+ def manage_content
1259
+ frm.link(:text=>"Manage Content").click
1260
+ LessonManageContent.new(@browser)
1261
+ end
1262
+
1263
+ def sort
1264
+ frm.link(:text=>"Sort").click
1265
+ LessonManageSort.new(@browser)
1266
+ end
1267
+
1268
+ # Clicks the Import/Export button and
1269
+ # instantiates the LessonImportExport class.
1270
+ def import_export
1271
+ frm.link(:text=>"Import/Export").click
1272
+ LessonImportExport.new(@browser)
1273
+ end
1274
+
1275
+ end
1276
+
1277
+ # The Sorting Modules and Sections page in Lessons
1278
+ class LessonManageSort
1279
+
1280
+ include PageObject
1281
+ include ToolsMenu
1282
+
1283
+ def view
1284
+ frm.link(:text=>"View").click
1285
+ if frm.div(:class=>"meletePortletToolBarMessage").text=="Viewing student side..."
1286
+ ViewModuleList.new(@browser)
1287
+ else
1288
+ #FIXME
1289
+ end
1290
+ end
1291
+
1292
+ in_frame(:index=>1) do |frame|
1293
+ link(:sort_modules, :id=>"SortSectionForm:sortmod", :frame=>frame)
1294
+ link(:sort_sections, :id=>"SortModuleForm:sortsec", :frame=>frame)
1295
+
1296
+ end
1297
+ end
1298
+
1299
+ # The Import/Export page in Manage Lessons for a Site
1300
+ class LessonImportExport
1301
+
1302
+ include PageObject
1303
+ include ToolsMenu
1304
+ include LessonsMenu
1305
+
1306
+ # Uploads the file specified - meaning that it enters
1307
+ # the target file information, then clicks the import
1308
+ # button.
1309
+ #
1310
+ # The file path is an optional parameter.
1311
+ def upload_IMS(file_name, file_path="")
1312
+ frm.file_field(:name, "impfile").set(file_path + file_name)
1313
+ frm.link(:id=>"importexportform:importModule").click
1314
+ frm.table(:id=>"AutoNumber1").div(:text=>"Processing...").wait_while_present
1315
+ end
1316
+
1317
+ # Returns the text of the alert box.
1318
+ def alert_text
1319
+ frm.span(:class=>"BlueClass").text
1320
+ end
1321
+
1322
+ end
1323
+
1324
+ # The User preference options page for Lessons.
1325
+ #
1326
+ # Note that this class is inclusive of Student
1327
+ # and Instructor views of the page. Thus,
1328
+ # not all methods in the class will work
1329
+ # at all times.
1330
+ class LessonPreferences
1331
+
1332
+ include PageObject
1333
+ include ToolsMenu
1334
+
1335
+ # Clicks the View button
1336
+ # then instantiates the Lessons class.
1337
+ def view
1338
+ frm.link(:text=>"View").click
1339
+ Lessons.new(@browser)
1340
+ end
1341
+
1342
+ in_frame(:index=>1) do |frame|
1343
+ radio_button(:expanded) { |page| page.radio_button_element(:name=>"UserPreferenceForm:_id5", :index=>0, :frame=>frame) }
1344
+ radio_button(:collapsed) { |page| page.radio_button_element(:name=>"UserPreferenceForm:_id5", :index=>1, :frame=>frame) }
1345
+ link(:set, :id=>"UserPreferenceForm:SetButton", :frame=>frame)
1346
+ end
1347
+ end
1348
+
1349
+ # This Class encompasses methods for both the Add and the Edit pages for Lesson Modules.
1350
+ class AddEditModule
1351
+
1352
+ include PageObject
1353
+ include ToolsMenu
1354
+
1355
+ # Clicks the Add button for the Lesson Module
1356
+ # then instantiates the ConfirmModule class.
1357
+ def add
1358
+ frm.link(:id=>/ModuleForm:submitsave/).click
1359
+ ConfirmModule.new(@browser)
1360
+ end
1361
+
1362
+ def add_content_sections
1363
+ frm.link(:id=>/ModuleForm:sectionButton/).click
1364
+ AddEditSection.new(@browser)
1365
+ end
1366
+
1367
+ in_frame(:index=>1) do |frame|
1368
+ text_field(:title, :id=>/ModuleForm:title/, :frame=>frame)
1369
+ text_area(:description, :id=>/ModuleForm:description/, :frame=>frame)
1370
+ text_area(:keywords, :id=>/ModuleForm:keywords/, :frame=>frame)
1371
+ text_field(:start_date, :id=>/ModuleForm:startDate/, :frame=>frame)
1372
+ text_field(:end_date, :id=>/ModuleForm:endDate/, :frame=>frame)
1373
+ end
1374
+ end
1375
+
1376
+ # The confirmation page when you are saving a Lesson Module.
1377
+ class ConfirmModule
1378
+
1379
+ include PageObject
1380
+ include ToolsMenu
1381
+
1382
+ # Clicks the Add Content Sections button and
1383
+ # instantiates the AddEditSection class.
1384
+ def add_content_sections
1385
+ frm.link(:id=>/ModuleConfirmForm:sectionButton/).click
1386
+ AddEditSection.new(@browser)
1387
+ end
1388
+
1389
+ # Clicks the Return to Modules button, then
1390
+ # instantiates the AddEditModule class.
1391
+ def return_to_modules
1392
+ frm.link(:id=>"AddModuleConfirmForm:returnModImg").click
1393
+ AddEditModule.new(@browser)
1394
+ end
1395
+
1396
+ end
1397
+
1398
+ # Page for adding a section to a Lesson.
1399
+ class AddEditSection
1400
+
1401
+ include PageObject
1402
+ include ToolsMenu
1403
+
1404
+ # Clicks the Add button on the page
1405
+ # then instantiates the ConfirmSectionAdd class.
1406
+ def add
1407
+ frm.link(:id=>/SectionForm:submitsave/).click
1408
+ ConfirmSectionAdd.new(@browser)
1409
+ end
1410
+
1411
+ # Pointer to the Edit Text box of the FCKEditor
1412
+ # on the page.
1413
+ def content_editor
1414
+ frm.frame(:id, "AddSectionForm:fckEditorView:otherMeletecontentEditor_inputRichText___Frame").td(:id, "xEditingArea").frame(:index=>0)
1415
+ end
1416
+
1417
+ def add_content=(text)
1418
+ content_editor.send_keys(text)
1419
+ end
1420
+
1421
+ def clear_content
1422
+ frm.frame(:id, "AddSectionForm:fckEditorView:otherMeletecontentEditor_inputRichText___Frame").div(:title=>"Select All").fire_event("onclick")
1423
+ content_editor.send_keys :backspace
1424
+ end
1425
+
1426
+ def select_url
1427
+ frm.link(:id=>"AddSectionForm:ContentLinkView:serverViewButton").click
1428
+ SelectingContent.new(@browser)
1429
+ end
1430
+
1431
+ # This method clicks the Select button that appears on the page
1432
+ # then calls the LessonAddAttachment class.
1433
+ #
1434
+ # It assumes that the Content Type selection box has
1435
+ # already been updated to "Upload or link to a file in Resources".
1436
+ def select_or_upload_file
1437
+ frm.link(:id=>"AddSectionForm:ResourceHelperLinkView:serverViewButton").click
1438
+ LessonAddAttachment.new(@browser)
1439
+ end
1440
+
1441
+ in_frame(:index=>1) do |frame|
1442
+ text_field(:title, :id=>"AddSectionForm:title", :frame=>frame)
1443
+ select_list(:content_type, :id=>"AddSectionForm:contentType", :frame=>frame)
1444
+ checkbox(:auditory_content, :id=>"AddSectionForm:contentaudio", :frame=>frame)
1445
+ end
1446
+ end
1447
+
1448
+ # Confirmation page for Adding (or Editing)
1449
+ # a Section to a Module in Lessons.
1450
+ class ConfirmSectionAdd
1451
+
1452
+ include PageObject
1453
+ include ToolsMenu
1454
+
1455
+ # Clicks the Add Another Section button
1456
+ # then instantiates the AddSection class.
1457
+ def add_another_section
1458
+ frm.link(:id=>/SectionConfirmForm:saveAddAnotherbutton/).click
1459
+ AddEditSection.new(@browser)
1460
+ end
1461
+
1462
+ # Clicks the Finish button
1463
+ # then instantiates the Lessons class.
1464
+ def finish
1465
+ frm.link(:id=>/Form:FinishButton/).click
1466
+ Lessons.new(@browser)
1467
+ end
1468
+
1469
+ end
1470
+
1471
+ #
1472
+ class SelectingContent
1473
+
1474
+ include PageObject
1475
+ include ToolsMenu
1476
+
1477
+ def continue
1478
+ frm.link(:id=>"ServerViewForm:addButton").click
1479
+ AddEditSection.new(@browser)
1480
+ end
1481
+
1482
+ in_frame(:index=>1) do |frame|
1483
+ text_field(:new_url, :id=>"ServerViewForm:link", :frame=>frame)
1484
+ text_field(:url_title, :id=>"ServerViewForm:link_title", :frame=>frame)
1485
+ end
1486
+ end
1487
+
1488
+ #
1489
+ class LessonAddAttachment < AddFiles
1490
+
1491
+ include ToolsMenu
1492
+
1493
+ def initialize(browser)
1494
+ @browser = browser
1495
+ @@classes = {
1496
+ :this => "LessonAddAttachment",
1497
+ :parent => "AddEditSection"
1498
+ }
1499
+ end
1500
+
1501
+ end
1062
1502
 
1063
1503
  #================
1064
1504
  # Matrix Pages for a Portfolio Site
@@ -1244,13 +1684,10 @@ class EditCell
1244
1684
  include PageObject
1245
1685
  include ToolsMenu
1246
1686
 
1247
- thing(:select_evaluators_link) { |b| b.frm.link(:text=>"Select Evaluators") }
1248
-
1249
1687
  # Clicks the "Select Evaluators" link
1250
1688
  # and instantiates the SelectEvaluators Class.
1251
1689
  def select_evaluators
1252
- select_evaluators_link.wait_until_present
1253
- select_evaluators_link.click
1690
+ frm.link(:text=>"Select Evaluators").click
1254
1691
  SelectEvaluators.new(@browser)
1255
1692
  end
1256
1693