sambal-cle 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. data/README.md +4 -0
  2. data/lib/sambal-cle/base_page.rb +20 -0
  3. data/lib/sambal-cle/core-ext.rb +90 -0
  4. data/lib/sambal-cle/data_objects/announcement.rb +82 -0
  5. data/lib/sambal-cle/data_objects/assessment.rb +32 -0
  6. data/lib/sambal-cle/data_objects/assignment.rb +205 -0
  7. data/lib/sambal-cle/data_objects/blog.rb +46 -0
  8. data/lib/sambal-cle/data_objects/blogger.rb +49 -0
  9. data/lib/sambal-cle/data_objects/chat_room.rb +54 -0
  10. data/lib/sambal-cle/data_objects/event.rb +89 -0
  11. data/lib/sambal-cle/data_objects/forum.rb +212 -0
  12. data/lib/sambal-cle/data_objects/lesson.rb +185 -0
  13. data/lib/sambal-cle/data_objects/message.rb +57 -0
  14. data/lib/sambal-cle/data_objects/poll.rb +74 -0
  15. data/lib/sambal-cle/data_objects/resource.rb +209 -0
  16. data/lib/sambal-cle/data_objects/site.rb +295 -0
  17. data/lib/sambal-cle/data_objects/syllabus.rb +73 -0
  18. data/lib/sambal-cle/data_objects/web_content_tool.rb +51 -0
  19. data/lib/sambal-cle/data_objects/wiki.rb +63 -0
  20. data/lib/sambal-cle/date_makers.rb +118 -0
  21. data/lib/sambal-cle/gem_ext.rb +23 -0
  22. data/lib/sambal-cle/page_helper.rb +22 -0
  23. data/lib/sambal-cle/page_maker.rb +48 -0
  24. data/lib/sambal-cle/page_objects/account.rb +111 -0
  25. data/lib/sambal-cle/page_objects/aliases.rb +43 -0
  26. data/lib/sambal-cle/page_objects/announcements.rb +190 -0
  27. data/lib/sambal-cle/page_objects/assessments.rb +874 -0
  28. data/lib/sambal-cle/page_objects/assignments.rb +770 -0
  29. data/lib/sambal-cle/page_objects/basic_lti.rb +6 -0
  30. data/lib/sambal-cle/page_objects/blogger.rb +205 -0
  31. data/lib/sambal-cle/page_objects/blogs.rb +60 -0
  32. data/lib/sambal-cle/page_objects/calendar.rb +330 -0
  33. data/lib/sambal-cle/page_objects/calendar_summary.rb +1 -0
  34. data/lib/sambal-cle/page_objects/chat_room.rb +22 -0
  35. data/lib/sambal-cle/page_objects/drop_box.rb +9 -0
  36. data/lib/sambal-cle/page_objects/email_archive.rb +22 -0
  37. data/lib/sambal-cle/page_objects/entity_picker.rb +62 -0
  38. data/lib/sambal-cle/page_objects/evaluations.rb +158 -0
  39. data/lib/sambal-cle/page_objects/feedback.rb +36 -0
  40. data/lib/sambal-cle/page_objects/forms.rb +120 -0
  41. data/lib/sambal-cle/page_objects/forums.rb +254 -0
  42. data/lib/sambal-cle/page_objects/glossary.rb +117 -0
  43. data/lib/sambal-cle/page_objects/gradebook.rb +29 -0
  44. data/lib/sambal-cle/page_objects/gradebook2.rb +17 -0
  45. data/lib/sambal-cle/page_objects/home.rb +36 -0
  46. data/lib/sambal-cle/page_objects/jforums.rb +444 -0
  47. data/lib/sambal-cle/page_objects/job_scheduler.rb +121 -0
  48. data/lib/sambal-cle/page_objects/lessons.rb +361 -0
  49. data/lib/sambal-cle/page_objects/login.rb +28 -0
  50. data/lib/sambal-cle/page_objects/matrix.rb +241 -0
  51. data/lib/sambal-cle/page_objects/media_gallery.rb +13 -0
  52. data/lib/sambal-cle/page_objects/messages.rb +622 -0
  53. data/lib/sambal-cle/page_objects/my_workspace.rb +44 -0
  54. data/lib/sambal-cle/page_objects/news.rb +8 -0
  55. data/lib/sambal-cle/page_objects/podcasts.rb +27 -0
  56. data/lib/sambal-cle/page_objects/polls.rb +69 -0
  57. data/lib/sambal-cle/page_objects/portfolio_templates.rb +161 -0
  58. data/lib/sambal-cle/page_objects/portfolios.rb +162 -0
  59. data/lib/sambal-cle/page_objects/post_em.rb +1 -0
  60. data/lib/sambal-cle/page_objects/profile.rb +51 -0
  61. data/lib/sambal-cle/page_objects/profile2.rb +344 -0
  62. data/lib/sambal-cle/page_objects/public_search.rb +61 -0
  63. data/lib/sambal-cle/page_objects/realms.rb +19 -0
  64. data/lib/sambal-cle/page_objects/resources.rb +326 -0
  65. data/lib/sambal-cle/page_objects/resources_roster.rb +0 -0
  66. data/lib/sambal-cle/page_objects/rosters.rb +70 -0
  67. data/lib/sambal-cle/page_objects/rwiki.rb +34 -0
  68. data/lib/sambal-cle/page_objects/search.rb +34 -0
  69. data/lib/sambal-cle/page_objects/sections.rb +295 -0
  70. data/lib/sambal-cle/page_objects/single_user.rb +1 -0
  71. data/lib/sambal-cle/page_objects/site_setup.rb +621 -0
  72. data/lib/sambal-cle/page_objects/site_statistics.rb +1 -0
  73. data/lib/sambal-cle/page_objects/sites.rb +255 -0
  74. data/lib/sambal-cle/page_objects/styles.rb +74 -0
  75. data/lib/sambal-cle/page_objects/syllabus.rb +166 -0
  76. data/lib/sambal-cle/page_objects/user_membership.rb +57 -0
  77. data/lib/sambal-cle/page_objects/users.rb +88 -0
  78. data/lib/sambal-cle/randomizers.rb +117 -0
  79. data/lib/sambal-cle/rich_text.rb +38 -0
  80. data/lib/sambal-cle/utilities.rb +31 -0
  81. data/lib/sambal-cle/workflows.rb +223 -0
  82. data/lib/sambal-cle.rb +31 -0
  83. data/sambal-cle.gemspec +14 -0
  84. data/test/add_assignment_to_calendar_spec.rb +86 -0
  85. data/test/assignment_announcements_spec.rb +71 -0
  86. data/test/assignment_gradebook_spec.rb +98 -0
  87. data/test/config.yml.template +4 -0
  88. data/test/directory.yml.template +123 -0
  89. data/test/duplicate_site_spec.rb +244 -0
  90. metadata +167 -0
@@ -0,0 +1,121 @@
1
+ #================
2
+ # Job Scheduler pages in Admin Workspace
3
+ #================
4
+
5
+ # The topmost page in the Job Scheduler in Admin Workspace
6
+ class JobScheduler < BasePage
7
+
8
+ frame_element
9
+
10
+ # Clicks the Jobs link, then instantiates
11
+ # the JobList Class.
12
+ def jobs
13
+ frm.link(:text=>"Jobs").click
14
+ JobList.new(@browser)
15
+ end
16
+
17
+ end
18
+
19
+ # The list of Jobs (click the Jobs button on Job Scheduler)
20
+ class JobList < BasePage
21
+
22
+ frame_element
23
+
24
+ # Clicks the New Job link, then
25
+ # instantiates the CreateNewJob Class.
26
+ def new_job
27
+ frm.link(:text=>"New Job").click
28
+ CreateNewJob.new(@browser)
29
+ end
30
+
31
+ # Clicks the link with the text "Triggers" associated with the
32
+ # specified job name,
33
+ # then instantiates the EditTriggers Class.
34
+ def triggers(job_name)
35
+ frm.div(:class=>"portletBody").table(:class=>"listHier lines").row(:text=>/#{Regexp.escape(job_name)}/).link(:text=>/Triggers/).click
36
+ sleep 1
37
+ EditTriggers.new(@browser)
38
+ end
39
+
40
+ def event_log
41
+ frm.link(:text=>"Event Log").click
42
+ EventLog.new(@browser)
43
+ end
44
+
45
+ end
46
+
47
+ # The Create New Job page
48
+ class CreateNewJob < BasePage
49
+
50
+ frame_element
51
+
52
+ # Clicks the Post button, then
53
+ # instantiates the JobList Class.
54
+ def post
55
+ frm.button(:value=>"Post").click
56
+ JobList.new(@browser)
57
+ end
58
+
59
+ element(:job_name) { |b| b.frm.text_field(:id=>"_id2:job_name") }
60
+ element(:type) { |b| b.frm.select_list(:name=>"_id2:_id10") }
61
+ end
62
+
63
+ # The page for Editing Triggers
64
+ class EditTriggers < BasePage
65
+
66
+ frame_element
67
+
68
+ # Clicks the "Run Job Now" link, then
69
+ # instantiates the RunJobConfirmation Class.
70
+ def run_job_now
71
+ frm.div(:class=>"portletBody").link(:text=>"Run Job Now").click
72
+ RunJobConfirmation.new(@browser)
73
+ end
74
+
75
+ def return_to_jobs
76
+ frm.link(:text=>"Return_to_Jobs").click
77
+ JobList.new(@browser)
78
+ end
79
+
80
+ def new_trigger
81
+ frm.link(:text=>"New Trigger").click
82
+ CreateTrigger.new(@browser)
83
+ end
84
+
85
+ end
86
+
87
+ # The Create Trigger page
88
+ class CreateTrigger < BasePage
89
+
90
+ frame_element
91
+
92
+ def post
93
+ frm.button(:value=>"Post").click
94
+ EditTriggers.new(@browser)
95
+ end
96
+
97
+ element(:name) { |b| b.frm.text_field(:id=>"_id2:trigger_name") }
98
+ element(:cron_expression) { |b| b.frm.text_field(:id=>"_id2:trigger_expression") }
99
+ end
100
+
101
+
102
+ # The page for confirming you want to run a job
103
+ class RunJobConfirmation < BasePage
104
+
105
+ frame_element
106
+
107
+ # Clicks the "Run Now" button, then
108
+ # instantiates the JobList Class.
109
+ def run_now
110
+ frm.button(:value=>"Run Now").click
111
+ JobList.new(@browser)
112
+ end
113
+
114
+ end
115
+
116
+ # The page containing the Event Log
117
+ class EventLog < BasePage
118
+
119
+ frame_element
120
+
121
+ end
@@ -0,0 +1,361 @@
1
+
2
+ #================
3
+ # Lesson Pages
4
+ #================
5
+
6
+ # Contains items common to most Lessons pages.
7
+ class LessonsBase < BasePage
8
+
9
+ frame_element
10
+
11
+ class << self
12
+ def menu_elements
13
+ # Clicks on the Preferences link on the Lessons page,
14
+ # next is the LessonPreferences class.
15
+ action(:preferences) { |b| b.frm.link(:text=>"Preferences").click }
16
+
17
+ action(:view) { |b| b.frm.link(:text=>"View").click }
18
+
19
+ action(:manage) { |b| b.frm.link(:text=>"Manage").click }
20
+ end
21
+ end
22
+ end
23
+
24
+ # The Lessons page in a site ("icon-sakai-melete")
25
+ #
26
+ # Note that this class is inclusive of both the
27
+ # Instructor/Admin and the Student views of this page
28
+ # many methods will error out if used when in the
29
+ # Student view.
30
+ class Lessons < LessonsBase
31
+
32
+ menu_elements
33
+
34
+ expected_element :lessons_table
35
+
36
+ element(:lessons_table) { |b| b.frm.table(:id=>/lis.+module.+form:table/) }
37
+
38
+ # Clicks the Add Module link, then
39
+ # next is the AddModule class.
40
+ action(:add_module) { |b| b.frm.link(:text=>"Add Module").click }
41
+ action(:add_content) { |b| b.frm.link(text: "Add Content").click }
42
+ action(:edit) { |b| b.frm.link(text: "Edit").click }
43
+ action(:left) { |b| b.frm.link(text: "Left").click }
44
+ action(:right) { |b| b.frm.link(text: "Right").click }
45
+ action(:delete) { |b| b.frm.link(text: "Delete").click }
46
+ action(:archive) { |b| b.frm.link(text: "Archive").click }
47
+ action(:move_sections) { |b| b.frm.link(text: "Move Section(s)").click }
48
+
49
+ # Clicks on the link that matches the supplied
50
+ # name value, next is the
51
+ # AddEditLesson, or ViewLesson class, depending
52
+ # on which page loads.
53
+ #
54
+ # Will error out if there is no
55
+ # matching link in the list.
56
+ def open_lesson(name)
57
+ frm.link(:text=>name).click
58
+ end
59
+ alias open_section open_lesson
60
+
61
+ def href(name)
62
+ frm.link(:text=>name).href
63
+ end
64
+
65
+ def check_lesson(name)
66
+ frm.tr(text: /#{Regexp.escape(name)}/).td(class: "ModCheckClass").checkbox.set
67
+ end
68
+
69
+ def check_section(name)
70
+ frm.td(class: "SectionClass", text: /#{Regexp.escape(name)}/).checkbox.set
71
+ end
72
+
73
+ # Returns an array of the Module titles displayed on the page.
74
+ def lessons_list
75
+ list = []
76
+ lessons_table.links.each do |link|
77
+ if link.id=~/lis.+module.+form:table:.+:(edit|view)Mod/
78
+ list << link.text
79
+ end
80
+ end
81
+ return list
82
+ end
83
+
84
+ # Returns and array containing the list of section titles for the
85
+ # specified module.
86
+ def sections_list(module_name)
87
+ list = []
88
+ if lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).exist?
89
+ lessons_table.row(:text=>/#{Regexp.escape(module_name)}/).table(:id=>/tablesec/).links.each do |link|
90
+ if link.id=~/Sec/
91
+ list << link.text
92
+ end
93
+ end
94
+ end
95
+ return list
96
+ end
97
+
98
+ end
99
+
100
+ # The student user's view of a Lesson Module or Section.
101
+ class ViewModule < LessonsBase
102
+
103
+ menu_elements
104
+
105
+ def sections_list
106
+ list = []
107
+ frm.table(:id=>"viewmoduleStudentform:tablesec").links.each { |link| list << link.text }
108
+ return list
109
+ end
110
+
111
+ action(:next) { |b| b.frm.link(:text=>"Next").click }
112
+
113
+ # Returns the text of the Module title row
114
+ value(:module_title) { |b| b.frm.span(:id=>/modtitle/).text }
115
+
116
+ # Returns the text of the Section title row
117
+ value(:section_title) { |b| b.frm.span(:id=>/form:title/).text }
118
+
119
+ def content_include?(content)
120
+ frm.form(:id=>"viewsectionStudentform").text.include?(content)
121
+ end
122
+
123
+ end
124
+
125
+ # This is the Instructor's preview of the Student's view
126
+ # of the list of Lesson Modules.
127
+ class ViewModuleList < LessonsBase
128
+
129
+ menu_elements
130
+
131
+ # LessonStudentSide
132
+ def open_lesson(name)
133
+ frm.link(:text=>name).click
134
+ end
135
+
136
+ # SectionStudentSide
137
+ def open_section(name)
138
+ frm.link(:text=>name).click
139
+ end
140
+
141
+ end
142
+
143
+ # The instructor's preview of the student view of the lesson.
144
+ class LessonStudentSide < LessonsBase
145
+
146
+ menu_elements
147
+
148
+ end
149
+
150
+ # The instructor's preview of the student's view of the section.
151
+ class SectionStudentSide < LessonsBase
152
+
153
+ menu_elements
154
+
155
+ end
156
+
157
+ # The Managing Options page for Lessons
158
+ class LessonManage < LessonsBase
159
+
160
+ menu_elements
161
+
162
+ action(:manage_content) {|b| b.frm.link(:text=>"Manage Content").click }
163
+
164
+ action(:sort) {|b| b.frm.link(:text=>"Sort").click }
165
+
166
+ # Clicks the Import/Export button and
167
+ # next is the LessonImportExport class.
168
+ action(:import_export) {|b| b.frm.link(:text=>"Import/Export").click }
169
+
170
+ end
171
+
172
+ class LessonManageContent < LessonsBase
173
+
174
+ menu_elements
175
+
176
+ end
177
+
178
+
179
+ # The Sorting Modules and Sections page in Lessons
180
+ class LessonManageSort < LessonsBase
181
+
182
+ menu_elements
183
+
184
+ action(:sort_modules) { |b| b.frm.link(:id=>"SortSectionForm:sortmod").click }
185
+ action(:sort_sections) { |b| b.frm.link(:id=>"SortModuleForm:sortsec").click }
186
+
187
+ end
188
+
189
+ # The Import/Export page in Manage Lessons for a Site
190
+ class LessonImportExport < LessonsBase
191
+
192
+ menu_elements
193
+
194
+ # Uploads the file specified - meaning that it enters
195
+ # the target file information, then clicks the import
196
+ # button.
197
+ #
198
+ # The file path is an optional parameter.
199
+ def upload_IMS(file_name, file_path="")
200
+ frm.file_field(:name, "impfile").set(file_path + file_name)
201
+ frm.link(:id=>"importexportform:importModule").click
202
+ frm.table(:id=>"AutoNumber1").div(:text=>"Processing...").wait_while_present
203
+ end
204
+
205
+ # Returns the text of the alert box.
206
+ value(:alert_text) { |b| b.frm.span(:class=>"BlueClass").text }
207
+
208
+ end
209
+
210
+ # The User preference options page for Lessons.
211
+ #
212
+ # Note that this class is inclusive of Student
213
+ # and Instructor views of the page. Thus,
214
+ # not all methods in the class will work
215
+ # at all times.
216
+ class LessonPreferences < LessonsBase
217
+
218
+ menu_elements
219
+
220
+ element(:expanded) { |b| b.frm.radio(:name=>"UserPreferenceForm:_id5", :index=>0) }
221
+ element(:collapsed) { |b| b.frm.radio(:name=>"UserPreferenceForm:_id5", :index=>1) }
222
+ action(:set) { |b| b.frm.link(:id=>"UserPreferenceForm:SetButton").click }
223
+
224
+ end
225
+
226
+ # This Class encompasses methods for both the Add and the Edit pages for Lesson Modules.
227
+ class AddEditModule < LessonsBase
228
+
229
+ menu_elements
230
+
231
+ expected_element :title
232
+
233
+ # Clicks the Add button for the Lesson Module
234
+ # next is the ConfirmModule class.
235
+ action(:add) { |b| b.frm.link(:id=>/ModuleForm:submitsave/).click }
236
+
237
+ # AddEditContentSection
238
+ action(:add_content_sections) { |b| b.frm.link(:id=>/ModuleForm:sectionButton/).click }
239
+
240
+ element(:title) { |b| b.frm.text_field(:name=>/ModuleForm:title/) }
241
+ element(:description) { |b| b.frm.text_field(:id=>/ModuleForm:description/) }
242
+ element(:keywords) { |b| b.frm.text_field(:id=>/ModuleForm:keywords/) }
243
+ element(:start_date) { |b| b.frm.text_field(:id=>/ModuleForm:startDate/) }
244
+ element(:end_date) { |b| b.frm.text_field( :id=>/ModuleForm:endDate/) }
245
+
246
+ end
247
+
248
+ # The confirmation page when you are saving a Lesson Module.
249
+ class ConfirmModule < LessonsBase
250
+
251
+ menu_elements
252
+
253
+ # Clicks the Add Content Sections button and
254
+ # next is the AddEditSection class.
255
+ action(:add_content_sections) { |b| b.frm.link(:id=>/ModuleConfirmForm:sectionButton/).click }
256
+
257
+ # Clicks the Return to Modules button, then
258
+ # instantiates the AddEditModule class.
259
+ action(:return_to_modules) { |b| b.frm.link(:id=>/ModuleConfirmForm:returnButton/).click }
260
+
261
+ end
262
+
263
+ # Page for adding a section to a Lesson.
264
+ class AddEditContentSection < LessonsBase
265
+
266
+ menu_elements
267
+ include FCKEditor
268
+
269
+ #expected_element :instructions
270
+
271
+ # Clicks the Add button on the page
272
+ # next is the ConfirmSectionAdd class.
273
+ action(:add) { |b| b.frm.link(:id=>/SectionForm:submitsave/).click }
274
+
275
+ # Pointer to the frame of the FCKEditor
276
+ # on the page.
277
+ element(:content_editor) { |b| b.frm.frame(:id, /SectionForm:fckEditorView:otherMeletecontentEditor_inputRichText___Frame/) }
278
+
279
+ def add_content=(text)
280
+ content_editor.td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
281
+ end
282
+
283
+ def clear_content # FIXME - This is an extra method now that we have the FCKEditor module
284
+ content_editor.div(:title=>"Select All").fire_event("onclick")
285
+ content_editor.send_keys :backspace
286
+ end
287
+
288
+ # SelectingContent
289
+ action(:select_url) { |b| b.frm.link(:id=>"AddSectionForm:ContentLinkView:serverViewButton").click }
290
+
291
+ # This method clicks the Select button that appears on the page
292
+ # then call the LessonAddAttachment class.
293
+ action(:select_or_upload_file) { |b| b.frm.link(:id=>"AddSectionForm:ResourceHelperLinkView:serverViewButton").click }
294
+
295
+ # Clicks the select button for "Upload or link to a file"
296
+ # NOT for "Upload or link to a file in Resources"!
297
+ action(:select_a_file) { |b| b.frm.link(:id=>"AddSectionForm:ContentUploadView:serverViewButton").click }
298
+
299
+ element(:title) { |b| b.frm.text_field(:id=>/SectionForm:title/) }
300
+ element(:instructions) { |b| b.frm.text_field(:id=>/SectionForm:instr/) }
301
+ element(:content_type) { |b| b.frm.select(:id=>/SectionForm:contentType/) }
302
+ element(:copyright_status) { |b| b.frm.select(:id=>/SectionForm:ResourcePropertiesPanel:licenseCodes/) }
303
+
304
+ action(:check_auditory) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).set }
305
+ action(:check_textual) { |b| b.frm.checkbox(:id=>/SectionForm:contentext/).set }
306
+ action(:check_visual) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).set }
307
+ action(:uncheck_auditory) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).clear }
308
+ action(:uncheck_textual) { |b| b.frm.checkbox(:id=>/SectionForm:contentext/).clear }
309
+ action(:uncheck_visual) { |b| b.frm.checkbox(:id=>/SectionForm:contentaudio/).clear }
310
+
311
+ element(:url_title) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_name/) }
312
+ element(:url_description) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_desc/) }
313
+ element(:file_description) { |b| b.frm.text_field(:id=>/SectionForm:ResourcePropertiesPanel:res_desc/) }
314
+
315
+ action(:add_another_section) { |b| frm.link(:id=>/:saveAddAnotherButton/).click }
316
+ action(:finish) { |b| b.frm.link(id: /FinishButton/).click }
317
+ action(:save) { |b| b.frm.link(id: /saveButton/).click }
318
+
319
+ end
320
+
321
+ # Confirmation page for Adding (or Editing)
322
+ # a Section to a Module in Lessons.
323
+ class ConfirmSectionAdd < LessonsBase
324
+
325
+ menu_elements
326
+
327
+ # Clicks the Add Another Section button
328
+ # next is the AddEditContentSection class.
329
+ action(:add_another_section) { |b| b.frm.link(:id=>/SectionConfirmForm:saveAddAnotherbutton/).click }
330
+
331
+ # Clicks the Finish button
332
+ # next is the Lessons class.
333
+ action(:finish) { |b| b.frm.link(:id=>/Form:FinishButton/).click }
334
+
335
+ end
336
+
337
+ #
338
+ class SelectingContent < LessonsBase
339
+
340
+ menu_elements
341
+
342
+ # AddEditContentSection
343
+ action(:continue) { |b| b.frm.link(:id=>"ServerViewForm:addButton").click }
344
+
345
+ element(:new_url) { |b| b.frm.text_field(:id=>"ServerViewForm:link") }
346
+ element(:url_title) { |b| b.frm.text_field(:id=>"ServerViewForm:link_title") }
347
+
348
+ end
349
+
350
+ #
351
+ class LessonAddAttachment < LessonsBase # TODO: DRY up this class
352
+
353
+ menu_elements
354
+
355
+ action(:continue) { |b| b.frm.link(:id=>"UploadServerViewForm:addButton").click }
356
+
357
+ def upload_local_file(filename, filepath="")
358
+ frm.file_field(:id=>"file1").set(filepath + filename)
359
+ end
360
+
361
+ end
@@ -0,0 +1,28 @@
1
+ #================
2
+ # Login Page
3
+ #================
4
+
5
+ # This is the page where users log in to the site.
6
+ class Login < BasePage
7
+
8
+ frame_element
9
+
10
+ def search_public_courses_and_projects
11
+ @browser.frame(:index=>0).link(:text=>"Search Public Courses and Projects").click
12
+ SearchPublic.new(@browser)
13
+ end
14
+
15
+ # Logs in to Sakai using the
16
+ # specified credentials. Then it
17
+ # instantiates the MyWorkspace class.
18
+ def login(username, password)
19
+ frame = @browser.frame(:id, "ifrm")
20
+ frame.text_field(:id, "eid").set username
21
+ frame.text_field(:id, "pw").set password
22
+ frame.form(:method, "post").submit
23
+ return MyWorkspace.new(@browser)
24
+ end
25
+ alias log_in login
26
+ alias sign_in login
27
+
28
+ end