sakai-cle-test-api 0.0.75 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/lib/sakai-cle-test-api.rb +4 -5
  2. data/lib/sakai-cle-test-api/base_page.rb +20 -0
  3. data/lib/sakai-cle-test-api/core-ext.rb +90 -0
  4. data/lib/sakai-cle-test-api/data_objects/announcement.rb +81 -0
  5. data/lib/sakai-cle-test-api/data_objects/assessment.rb +32 -0
  6. data/lib/sakai-cle-test-api/data_objects/assignment.rb +90 -0
  7. data/lib/sakai-cle-test-api/data_objects/event.rb +89 -0
  8. data/lib/sakai-cle-test-api/data_objects/lesson.rb +185 -0
  9. data/lib/sakai-cle-test-api/data_objects/resource.rb +209 -0
  10. data/lib/sakai-cle-test-api/data_objects/site.rb +208 -0
  11. data/lib/sakai-cle-test-api/data_objects/syllabus.rb +39 -0
  12. data/lib/sakai-cle-test-api/data_objects/web_content_tool.rb +51 -0
  13. data/lib/sakai-cle-test-api/data_objects/wiki.rb +53 -0
  14. data/lib/sakai-cle-test-api/gem_ext.rb +23 -0
  15. data/lib/sakai-cle-test-api/page_helper.rb +22 -0
  16. data/lib/sakai-cle-test-api/page_maker.rb +48 -0
  17. data/lib/sakai-cle-test-api/page_objects/account.rb +111 -0
  18. data/lib/sakai-cle-test-api/page_objects/aliases.rb +43 -0
  19. data/lib/sakai-cle-test-api/page_objects/announcements.rb +190 -0
  20. data/lib/sakai-cle-test-api/page_objects/assessments.rb +874 -0
  21. data/lib/sakai-cle-test-api/page_objects/assignments.rb +771 -0
  22. data/lib/sakai-cle-test-api/page_objects/basic_lti.rb +6 -0
  23. data/lib/sakai-cle-test-api/page_objects/blogger.rb +205 -0
  24. data/lib/sakai-cle-test-api/page_objects/blogs.rb +60 -0
  25. data/lib/sakai-cle-test-api/page_objects/calendar.rb +431 -0
  26. data/lib/sakai-cle-test-api/page_objects/calendar_summary.rb +1 -0
  27. data/lib/sakai-cle-test-api/page_objects/chat_room.rb +12 -0
  28. data/lib/sakai-cle-test-api/page_objects/drop_box.rb +9 -0
  29. data/lib/sakai-cle-test-api/page_objects/email_archive.rb +22 -0
  30. data/lib/sakai-cle-test-api/page_objects/evaluations.rb +158 -0
  31. data/lib/sakai-cle-test-api/page_objects/feedback.rb +36 -0
  32. data/lib/sakai-cle-test-api/page_objects/forms.rb +120 -0
  33. data/lib/sakai-cle-test-api/page_objects/forums.rb +289 -0
  34. data/lib/sakai-cle-test-api/page_objects/glossary.rb +117 -0
  35. data/lib/sakai-cle-test-api/page_objects/gradebook.rb +29 -0
  36. data/lib/sakai-cle-test-api/page_objects/gradebook2.rb +17 -0
  37. data/lib/sakai-cle-test-api/page_objects/home.rb +36 -0
  38. data/lib/sakai-cle-test-api/page_objects/jforums.rb +444 -0
  39. data/lib/sakai-cle-test-api/page_objects/job_scheduler.rb +121 -0
  40. data/lib/sakai-cle-test-api/page_objects/lessons.rb +360 -0
  41. data/lib/sakai-cle-test-api/page_objects/login.rb +28 -0
  42. data/lib/sakai-cle-test-api/page_objects/matrix.rb +241 -0
  43. data/lib/sakai-cle-test-api/page_objects/media_gallery.rb +13 -0
  44. data/lib/sakai-cle-test-api/page_objects/messages.rb +622 -0
  45. data/lib/sakai-cle-test-api/page_objects/my_workspace.rb +44 -0
  46. data/lib/sakai-cle-test-api/page_objects/news.rb +8 -0
  47. data/lib/sakai-cle-test-api/page_objects/podcasts.rb +27 -0
  48. data/lib/sakai-cle-test-api/page_objects/polls.rb +69 -0
  49. data/lib/sakai-cle-test-api/page_objects/portfolio_templates.rb +161 -0
  50. data/lib/sakai-cle-test-api/page_objects/portfolios.rb +162 -0
  51. data/lib/sakai-cle-test-api/page_objects/post_em.rb +1 -0
  52. data/lib/sakai-cle-test-api/page_objects/profile.rb +51 -0
  53. data/lib/sakai-cle-test-api/page_objects/profile2.rb +344 -0
  54. data/lib/sakai-cle-test-api/page_objects/public_search.rb +61 -0
  55. data/lib/sakai-cle-test-api/page_objects/realms.rb +19 -0
  56. data/lib/sakai-cle-test-api/page_objects/resources.rb +326 -0
  57. data/lib/sakai-cle-test-api/{resources_roster.rb → page_objects/resources_roster.rb} +0 -0
  58. data/lib/sakai-cle-test-api/page_objects/rosters.rb +70 -0
  59. data/lib/sakai-cle-test-api/page_objects/rwiki.rb +34 -0
  60. data/lib/sakai-cle-test-api/page_objects/search.rb +34 -0
  61. data/lib/sakai-cle-test-api/page_objects/sections.rb +295 -0
  62. data/lib/sakai-cle-test-api/page_objects/single_user.rb +1 -0
  63. data/lib/sakai-cle-test-api/page_objects/site_setup.rb +686 -0
  64. data/lib/sakai-cle-test-api/page_objects/site_statistics.rb +1 -0
  65. data/lib/sakai-cle-test-api/page_objects/sites.rb +255 -0
  66. data/lib/sakai-cle-test-api/page_objects/styles.rb +74 -0
  67. data/lib/sakai-cle-test-api/page_objects/syllabus.rb +166 -0
  68. data/lib/sakai-cle-test-api/page_objects/user_membership.rb +57 -0
  69. data/lib/sakai-cle-test-api/page_objects/users.rb +88 -0
  70. data/lib/sakai-cle-test-api/rich_text.rb +27 -0
  71. data/lib/sakai-cle-test-api/utilities.rb +260 -0
  72. data/lib/sakai-cle-test-api/workflows.rb +224 -0
  73. data/sakai-cle-test-api.gemspec +3 -5
  74. metadata +74 -64
  75. data/lib/sakai-cle-test-api/admin_page_elements.rb +0 -1030
  76. data/lib/sakai-cle-test-api/announcements.rb +0 -59
  77. data/lib/sakai-cle-test-api/assessments.rb +0 -194
  78. data/lib/sakai-cle-test-api/assignments.rb +0 -113
  79. data/lib/sakai-cle-test-api/basic_lti.rb +0 -5
  80. data/lib/sakai-cle-test-api/blogs.rb +0 -5
  81. data/lib/sakai-cle-test-api/calendar.rb +0 -65
  82. data/lib/sakai-cle-test-api/calendar_summary.rb +0 -0
  83. data/lib/sakai-cle-test-api/common_page_elements.rb +0 -1228
  84. data/lib/sakai-cle-test-api/drop_box.rb +0 -0
  85. data/lib/sakai-cle-test-api/email_archive.rb +0 -10
  86. data/lib/sakai-cle-test-api/forums.rb +0 -39
  87. data/lib/sakai-cle-test-api/gradebook.rb +0 -10
  88. data/lib/sakai-cle-test-api/gradebook2.rb +0 -6
  89. data/lib/sakai-cle-test-api/messages.rb +0 -119
  90. data/lib/sakai-cle-test-api/news.rb +0 -9
  91. data/lib/sakai-cle-test-api/polls.rb +0 -24
  92. data/lib/sakai-cle-test-api/post_em.rb +0 -0
  93. data/lib/sakai-cle-test-api/profile.rb +0 -17
  94. data/lib/sakai-cle-test-api/profile2.rb +0 -43
  95. data/lib/sakai-cle-test-api/rwiki.rb +0 -0
  96. data/lib/sakai-cle-test-api/sections.rb +0 -47
  97. data/lib/sakai-cle-test-api/single_user.rb +0 -0
  98. data/lib/sakai-cle-test-api/site_page_elements.rb +0 -2350
  99. data/lib/sakai-cle-test-api/site_statistics.rb +0 -0
  100. data/lib/sakai-cle-test-api/syllabus.rb +0 -77
  101. data/lib/sakai-cle-test-api/tools_menu.rb +0 -415
@@ -1,1228 +0,0 @@
1
- # Page classes that are in some way common to both
2
- # the Site context and the My Workspace context.
3
- #
4
- # == Synopsis
5
- #
6
- # This script defines the page classes that are
7
- # common to both page contexts--within a Site or within My Workspace.
8
- #
9
- # Author :: Abe Heward (aheward@rsmart.com)
10
-
11
- #require File.dirname(__FILE__) + '/app_functions.rb'
12
-
13
-
14
-
15
- #================
16
- # Evaluation System Pages
17
- #================
18
-
19
- # The "Evaluations Dashboard"
20
- class EvaluationSystem
21
-
22
- include PageObject
23
- include ToolsMenu
24
-
25
- def my_templates
26
- frm.link(:text=>"My Templates").click
27
- MyTemplates.new(@browser)
28
- end
29
-
30
- def add_template
31
- frm.link(:text=>"Add Template").click
32
- AddTemplateTitle.new(@browser)
33
- end
34
-
35
- def take_evaluation(evaluation_name)
36
- frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/).link.click
37
- TakeEvaluation.new(@browser)
38
- end
39
-
40
- def status_of(evaluation_name)
41
- return frm.div(:class=>"summaryBox").table(:text=>/#{Regexp.escape(evaluation_name)}/)[1][1].text
42
- end
43
-
44
- in_frame(:class=>"portletMainIframe") do |frame|
45
-
46
- end
47
- end
48
-
49
- #
50
- class AddTemplateTitle
51
-
52
- include PageObject
53
- include ToolsMenu
54
-
55
- def save
56
- frm.button(:value=>"Save").click
57
- EditTemplate.new(@browser)
58
- end
59
-
60
- in_frame(:class=>"portletMainIframe") do |frame|
61
- text_field(:title, :id=>"title", :frame=>frame)
62
- text_area(:description, :id=>"description", :frame=>frame)
63
- end
64
- end
65
-
66
- #
67
- class EditTemplate
68
-
69
- include PageObject
70
- include ToolsMenu
71
-
72
- def item_text=(text)
73
- frm.frame(:id, "item-text___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
74
- end
75
-
76
- def new_evaluation
77
- frm.link(:text=>"New evaluation").click
78
- frm.frame(:id, "instructions:1:input___Frame").td(:id, "xEditingArea").wait_until_present
79
- NewEvaluation.new(@browser)
80
- end
81
-
82
- def add
83
- frm.button(:value=>"Add").click
84
- frm.frame(:id, "item-text___Frame").td(:id, "xEditingArea").wait_until_present
85
- end
86
-
87
- def save_item
88
- frm.button(:value=>"Save item").click
89
- frm.link(:text=>"New evaluation").wait_until_present
90
- EditTemplate.new @browser
91
- end
92
-
93
- in_frame(:class=>"portletMainIframe") do |frame|
94
- select_list(:item, :id=>"add-item-control::add-item-classification-selection", :frame=>frame)
95
- end
96
- end
97
-
98
- #
99
- class NewEvaluation
100
-
101
- include PageObject
102
- include ToolsMenu
103
-
104
- def continue_to_settings
105
- frm.button(:value=>"Continue to Settings").click
106
- EvaluationSettings.new(@browser)
107
- end
108
-
109
- def instructions=(text)
110
- frm.frame(:id, "instructions:1:input___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
111
- end
112
-
113
- in_frame(:class=>"portletMainIframe") do |frame|
114
- text_field(:title, :id=>"title", :frame=>frame)
115
- end
116
- end
117
-
118
- #
119
- class EvaluationSettings
120
-
121
- include PageObject
122
- include ToolsMenu
123
-
124
- def continue_to_assign_to_courses
125
- frm.button(:value=>"Continue to Assign to Courses").click
126
- EditEvaluationAssignment.new(@browser)
127
- end
128
-
129
- in_frame(:class=>"portletMainIframe") do |frame|
130
-
131
- end
132
- end
133
-
134
- #
135
- class EditEvaluationAssignment
136
-
137
- include PageObject
138
- include ToolsMenu
139
-
140
- def save_assigned_groups
141
- frm.button(:value=>"Save Assigned Groups").click
142
- ConfirmEvaluation.new(@browser)
143
- end
144
-
145
- def check_group(title)
146
- frm.table(:class=>"listHier lines nolines").row(:text=>/#{Regexp.escape(title)}/).checkbox(:name=>"selectedGroupIDs").set
147
- end
148
-
149
- in_frame(:class=>"portletMainIframe") do |frame|
150
-
151
- end
152
- end
153
-
154
- #
155
- class ConfirmEvaluation
156
-
157
- include PageObject
158
- include ToolsMenu
159
-
160
- def done
161
- frm.button(:value=>"Done").click
162
- MyEvaluations.new(@browser)
163
- end
164
-
165
- end
166
-
167
- #
168
- class MyEvaluations
169
-
170
- include PageObject
171
- include ToolsMenu
172
-
173
- in_frame(:class=>"portletMainIframe") do |frame|
174
-
175
- end
176
- end
177
-
178
- #
179
- class TakeEvaluation
180
-
181
- include PageObject
182
- include ToolsMenu
183
-
184
- def submit_evaluation
185
- frm.button(:value=>"Submit Evaluation").click
186
- EvaluationSystem.new(@browser)
187
- end
188
-
189
- in_frame(:class=>"portletMainIframe") do |frame|
190
-
191
- end
192
- end
193
-
194
-
195
- #================
196
- # Overview-type Pages
197
- #================
198
-
199
- # Topmost page for a Site in Sakai
200
- class Home
201
-
202
- include PageObject
203
- include ToolsMenu
204
-
205
- # Because the links below are contained within iframes
206
- # we need the in_frame method in place so that the
207
- # links can be properly parsed in the PageObject
208
- # methods for them.
209
- # Note that the iframes are being identified by their
210
- # index values on the page. This is a very brittle
211
- # method for identifying them, but for now it's our
212
- # only option because both the <id> and <name>
213
- # tags are unique for every site.
214
- in_frame(:index=>1) do |frame|
215
- # Site Information Display, Options button
216
- link(:site_info_display_options, :text=>"Options", :frame=>frame)
217
-
218
- end
219
-
220
- in_frame(:index=>2) do |frame|
221
- # Recent Announcements Options button
222
- link(:recent_announcements_options, :text=>"Options", :frame=>frame)
223
- # Link for New In Forms
224
- link(:new_in_forums, :text=>"New Messages", :frame=>frame)
225
- text_field(:number_of_announcements, :id=>"itemsEntryField", :frame=>frame)
226
- button(:update_announcements, :name=>"eventSubmit_doUpdate", :frame=>frame)
227
- end
228
-
229
- # The Home class should be instantiated whenever the user
230
- # context is a given Site or the Administration Workspace.
231
- # In that context, the frame index is 1.
232
- $frame_index=1
233
-
234
- # Gets the text of the displayed announcements, for
235
- # test case verification
236
- def announcements_list
237
- list = []
238
- links = @browser.frame(:index=>2).links
239
- links.each { |link| list << link.text }
240
- list.delete_if { |item| item=="Options" } # Deletes the Options link if it's there.
241
- return list
242
- end
243
-
244
- end
245
-
246
- # The Page that appears when you are not in a particular Site
247
- # Note that this page differs depending on what user is logged in.
248
- # The definitions below include all potential objects. We may
249
- # have to split this class out into user-specific classes.
250
- class MyWorkspace
251
-
252
- include PageObject
253
- include ToolsMenu
254
-
255
- # Because the links below are contained within iframes
256
- # we need the in_frame method in place so that the
257
- # links can be properly parsed in the PageObject
258
- # methods for them.
259
- # Note that the iframes are being identified by their
260
- # index values on the page. This is a very brittle
261
- # method for identifying them, but for now it's our
262
- # only option because both the <id> and <name>
263
- # tags are unique for every site.
264
- in_frame(:class=>"portletMainIframe") do |frame|
265
- # Calendar Options button
266
- link(:calendar_options, :text=>"Options", :frame=>frame)
267
- end
268
-
269
- in_frame(:index=>1) do |frame|
270
- # My Workspace Information Options
271
- link(:my_workspace_information_options, :text=>"Options", :frame=>frame)
272
- # Message of the Day, Options button
273
- link(:message_of_the_day_options, :text=>"Options", :frame=>frame)
274
-
275
- end
276
-
277
- in_frame(:index=>0) do |frame|
278
- select_list(:select_page_size, :id=>"selectPageSize", :frame=>frame)
279
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
280
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
281
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
282
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
283
- end
284
-
285
- # Returns an array of strings of the Calendar Events listed below
286
- # the Calendar
287
- def calendar_events
288
- events = []
289
- table = @browser.frame(:class=>"portletMainIframe", :index=>2).table(:id=>"calendarForm:datalist_event_list")
290
- table.wait_until_present
291
- table.rows.each do |row|
292
- events << row.link.text
293
- end
294
- return events
295
- end
296
-
297
- # The MyWorkspace class should ONLY be instantiated when
298
- # the user context is NOT a given site or Administration Workspace.
299
- # Otherwise the frame index will not be 0, and page objects
300
- # will not be found by Webdriver.
301
- $frame_index=0
302
-
303
- end
304
-
305
- #================
306
- # Resources Pages
307
- #================
308
-
309
- # New class template. For quick class creation...
310
- class ResourcesUploadFiles
311
-
312
- include ToolsMenu
313
-
314
- @@filex=0
315
-
316
- # Enters the specified folder/filename value into
317
- # the file field on the page. Note that files are
318
- # assumed to be in the relative path ../../data/sakai-cle-test-api
319
- # The method will throw an error if the specified file
320
- # is not found.
321
- #
322
- # This method is designed to be able to use
323
- # multiple times, but it assumes
324
- # that the add_another_file method is used
325
- # before it, every time except before the first time.
326
- def file_to_upload(file_name, file_path="")
327
- frm.file_field(:id, "content_#{@@filex}").set(file_path + file_name)
328
- @@filex+=1
329
- end
330
-
331
- # Clicks the Upload Files Now button, resets the
332
- # @@filex class variable back to zero, and instantiates
333
- # the Resources page class.
334
- def upload_files_now
335
- frm.button(:value=>"Upload Files Now").click
336
- @@filex=0
337
- Resources.new(@browser)
338
- end
339
-
340
- # Clicks the Add Another File link.
341
- def add_another_file
342
- frm.link(:text=>"Add Another File").click
343
- end
344
-
345
- end
346
-
347
- class EditFileDetails
348
-
349
- include ToolsMenu
350
-
351
- # Clicks the Update button, then instantiates
352
- # the Resources page class.
353
- def update
354
- frm.button(:value=>"Update").click
355
- Resources.new(@browser)
356
- end
357
-
358
- # Enters the specified string into the title field.
359
- def title=(title)
360
- frm.text_field(:id=>"displayName_0").set(title)
361
- end
362
-
363
- # Enters the specified string into the description field.
364
- def description=(description)
365
- frm.text_field(:id=>"description_0").set(description)
366
- end
367
-
368
- # Sets the radio button for publically viewable.
369
- def select_publicly_viewable
370
- frm.radio(:id=>"access_mode_public_0").set
371
- end
372
-
373
- # Checks the checkbox for showing only on the specifed
374
- # condition.
375
- def check_show_only_if_condition
376
- frm.checkbox(:id=>"cbCondition_0")
377
- end
378
-
379
- # Selects the specified Gradebook item value in the
380
- # select list.
381
- def gradebook_item=(item)
382
- frm.select(:id=>"selectResource_0").select(item)
383
- end
384
-
385
- # Selects the specified value in the item condition
386
- # field.
387
- def item_condition=(condition)
388
- frm.select(:id=>"selectCondition_0").select(condition)
389
- end
390
-
391
- # Sets the Grade field to the specified value.
392
- def assignment_grade=(grade)
393
- frm.text_field(:id=>"assignment_grade_0").set(grade)
394
- end
395
- end
396
-
397
- class CreateFolders #FIXME - Need to add functions for adding multiple folders
398
-
399
- include ToolsMenu
400
-
401
- # Clicks the Create Folders Now button, then
402
- # instantiates the Resources page class.
403
- def create_folders_now
404
- frm.button(:value=>"Create Folders Now").click
405
- Resources.new(@browser)
406
- end
407
-
408
- # Enters the specified string in the Folder Name
409
- # text field.
410
- def folder_name=(name)
411
- frm.text_field(:id=>"content_0").set(name)
412
- end
413
-
414
- end
415
-
416
- # Resources page for a given Site, in the Course Tools menu
417
- class Resources < AddFiles
418
-
419
- include ToolsMenu
420
-
421
- def initialize(browser)
422
- @browser = browser
423
-
424
- @@classes = {
425
- :this=> "Resources",
426
- :parent => "Resources",
427
- :file_details => "EditFileDetails",
428
- :create_folders => "CreateFolders",
429
- :upload_files => "ResourcesUploadFiles"
430
- }
431
- end
432
-
433
- end
434
-
435
- #================
436
- # Administrative Search Pages
437
- #================
438
-
439
- # The Search page in the Administration Workspace - "icon-sakai-search"
440
- class Search
441
-
442
- include PageObject
443
- include ToolsMenu
444
-
445
- in_frame(:index=>0) do |frame|
446
- link(:admin, :text=>"Admin", :frame=>frame)
447
- text_field(:search_field, :id=>"search", :frame=>frame)
448
- button(:search_button, :name=>"sb", :frame=>frame)
449
- radio_button(:this_site, :id=>"searchSite", :frame=>frame)
450
- radio_button(:all_my_sites, :id=>"searchMine", :frame=>frame)
451
-
452
- end
453
-
454
- end
455
-
456
- # The Search Admin page within the Search page in the Admin workspace
457
- class SearchAdmin
458
-
459
- include PageObject
460
- include ToolsMenu
461
-
462
- in_frame(:index=>0) do |frame|
463
- link(:search, :text=>"Search", :frame=>frame)
464
- link(:rebuild_site_index, :text=>"Rebuild Site Index", :frame=>frame)
465
- link(:refresh_site_index, :text=>"Refresh Site Index", :frame=>frame)
466
- link(:rebuild_whole_index, :text=>"Rebuild Whole Index", :frame=>frame)
467
- link(:refresh_whole_index, :text=>"Refresh Whole Index", :frame=>frame)
468
- link(:remove_lock, :text=>"Remove Lock", :frame=>frame)
469
- link(:reload_index, :text=>"Reload Index", :frame=>frame)
470
- link(:enable_diagnostics, :text=>"Enable Diagnostics", :frame=>frame)
471
- link(:disable_diagnostics, :text=>"Disable Diagnostics", :frame=>frame)
472
- end
473
-
474
- end
475
-
476
- #================
477
- # Site Setup/Site Editor Pages
478
- #================
479
-
480
- # This module contains the methods referring to the menu items
481
- # across the top of all the Site Editor pages.
482
- module SiteEditorMenu
483
-
484
- # Clicks the Edit Tools link, then
485
- # instantiates the EditSiteTools class.
486
- def edit_tools
487
- frm.link(:text=>"Edit Tools").click
488
- EditSiteTools.new(@browser)
489
- end
490
-
491
- # Clicks the Manage Groups link and
492
- # instantiates the Groups Class.
493
- def manage_groups
494
- frm.link(:text=>"Manage Groups").click
495
- Groups.new(@browser)
496
- end
497
-
498
- # Clicks the Duplicate Site link and instantiates
499
- # the DuplicateSite class.
500
- def duplicate_site
501
- frm.link(:text=>"Duplicate Site").click
502
- DuplicateSite.new(@browser)
503
- end
504
-
505
- def add_participants
506
- frm.link(:text=>"Add Participants").click
507
- SiteSetupAddParticipants.new @browser
508
- end
509
-
510
- end
511
-
512
- # The Site Setup page - a.k.a., link class=>"icon-sakai-sitesetup"
513
- class SiteSetup
514
-
515
- include PageObject
516
- include ToolsMenu
517
-
518
- # Clicks the "New" link on the Site Setup page.
519
- # instantiates the SiteType class.
520
- def new
521
- frm.div(:class=>"portletBody").link(:text=>"New").click
522
- SiteType.new(@browser)
523
- end
524
-
525
- # Searches for the specified site, then
526
- # selects the specified Site's checkbox.
527
- # Then clicks the Edit button and instantiates
528
- # The SiteSetupEdit class.
529
- def edit(site_name)
530
- frm.text_field(:id, "search").value=Regexp.escape(site_name)
531
- frm.button(:value=>"Search").click
532
- frm.div(:class=>"portletBody").checkbox(:name=>"selectedMembers").set
533
- frm.div(:class=>"portletBody").link(:text, "Edit").click
534
- SiteEditor.new(@browser)
535
- end
536
-
537
- # Enters the specified site name string in the search
538
- # field, clicks the Search button, then reinstantiates
539
- # the Class due to the page refresh.
540
- def search(site_name)
541
- frm.text_field(:id, "search").set site_name
542
- frm.button(:value, "Search").click
543
- SiteSetup.new(@browser)
544
- end
545
-
546
- # Searches for the specified site, then
547
- # checks the site, clicks the delete button,
548
- # and instantiates the DeleteSite class.
549
- def delete(site_name)
550
- frm.text_field(:id, "Search").value=site_name
551
- frm.button(:value=>"Search").click
552
- frm.checkbox(:name=>"selectedMembers").set
553
- frm.div(:class=>"portletBody").link(:text, "Delete").click
554
- DeleteSite.new(@browser)
555
- end
556
-
557
- # Returns an Array object containing strings of
558
- # all Site titles displayed on the web page.
559
- def site_titles
560
- titles = []
561
- sites_table = frm.table(:id=>"siteList")
562
- 1.upto(sites_table.rows.size-1) do |x|
563
- titles << sites_table[x][1].text
564
- end
565
- return titles
566
- end
567
-
568
- in_frame(:class=>"portletMainIframe") do |frame| #FIXME!
569
- select_list(:view, :id=>"view", :frame=>frame)
570
- button(:clear_search, :value=>"Clear Search", :frame=>frame)
571
- select_list(:select_page_size, :id=>"selectPageSize", :frame=>frame)
572
- link(:sort_by_title, :text=>"Worksite Title", :frame=>frame)
573
- link(:sort_by_type, :text=>"Type", :frame=>frame)
574
- link(:sort_by_creator, :text=>"Creator", :frame=>frame)
575
- link(:sort_by_status, :text=>"Status", :frame=>frame)
576
- link(:sort_by_creation_date, :text=>"Creation Date", :frame=>frame)
577
- end
578
-
579
- end
580
-
581
- # The topmost "Site Editor" page,
582
- # found in SITE MANAGEMENT
583
- # or else Site Setup after you have
584
- # selected to Edit a particular site.
585
- class SiteEditor
586
-
587
- include PageObject
588
- include ToolsMenu
589
- include SiteEditorMenu
590
-
591
- # Sets the specified role for the specified participant.
592
- #
593
- # Because the participant is selected using a regular expression,
594
- # the "participant" string can be anything that will suffice as a
595
- # unique match--i.e., last name, first name, or user id, or any combination,
596
- # as long as it will match a part of the string that appears in the
597
- # desired row.
598
- def set_role(participant, role)
599
- frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(participant)}/).select(:id=>/role/).select(role)
600
- end
601
-
602
- def update_participants
603
- frm.button(:value=>"Update Participants").click
604
- SiteEditor.new(@browser)
605
- end
606
-
607
- in_frame(:class=>"portletMainIframe") do |frame|
608
- button(:previous, :name=>"previous", :frame=>frame)
609
- button(:return_to_sites_list, :name=>"", :frame=>frame)
610
- button(:next, :name=>"", :frame=>frame)
611
- link(:printable_version, :text=>"Printable Version", :frame=>frame)
612
- select_list(:select_page_size, :name=>"selectPageSize", :frame=>frame)
613
- button(:next, :name=>"eventSubmit_doList_next", :frame=>frame)
614
- button(:last, :name=>"eventSubmit_doList_last", :frame=>frame)
615
- button(:previous, :name=>"eventSubmit_doList_prev", :frame=>frame)
616
- button(:first, :name=>"eventSubmit_doList_first", :frame=>frame)
617
- end
618
-
619
- end
620
-
621
- # Groups page inside the Site Editor
622
- class Groups
623
-
624
- include PageObject
625
- include ToolsMenu
626
- include SiteEditorMenu
627
-
628
- # Clicks the Create New Group link and
629
- # instantiates the CreateNewGroup Class.
630
- def create_new_group
631
- create_new_group_link_element.wait_until_present
632
- create_new_group_link
633
- CreateNewGroup.new(@browser)
634
- end
635
-
636
- in_frame(:class=>"portletMainIframe") do |frame|
637
- link(:create_new_group_link, :text=>"Create New Group", :frame=>frame)
638
- link(:auto_groups, :text=>"Auto Groups", :frame=>frame)
639
- button(:remove_checked, :id=>"delete-groups", :frame=>frame)
640
- button(:cancel, :id=>"cancel", :frame=>frame)
641
- end
642
- end
643
-
644
- # The Create New Group page inside the Site Editor
645
- class CreateNewGroup
646
-
647
- include PageObject
648
- include ToolsMenu
649
-
650
- # Clicks the Add button and instantiates the Groups Class.
651
- def add
652
- frm.button(:id=>"save").click
653
- Groups.new(@browser)
654
- end
655
-
656
- in_frame(:class=>"portletMainIframe") do |frame|
657
- text_field(:title, :id=>"group_title", :frame=>frame)
658
- text_field(:description, :id=>"group_description", :frame=>frame)
659
- select_list(:site_member_list, :name=>"siteMembers-selection", :frame=>frame)
660
- select_list(:group_member_list, :name=>"groupMembers-selection", :frame=>frame)
661
- button(:right, :name=>"right", :index=>0, :frame=>frame)
662
- button(:left, :name=>"left", :index=>0, :frame=>frame)
663
- button(:all_right, :name=>"right", :index=>1, :frame=>frame)
664
- button(:all_left, :name=>"left",:index=>1, :frame=>frame)
665
- button(:cancel, :id=>"cancel", :frame=>frame)
666
- end
667
- end
668
-
669
- # The first page of the Duplicate Site pages in the Site Editor.
670
- class DuplicateSite
671
-
672
- include PageObject
673
- include ToolsMenu
674
-
675
- def duplicate
676
- frm.button(:value=>"Duplicate").click
677
- frm.span(:class=>"submitnotif").wait_while_present(300)
678
- SiteEditor.new(@browser)
679
- end
680
-
681
- # Returns the site name in the header, for verification.
682
- def site_name
683
- frm.div(:class=>"portletBody").h3.span(:class=>"highlight").text
684
- end
685
-
686
- in_frame(:class=>"portletMainIframe") do |frame|
687
- text_field(:site_title, :id=>"title", :frame=>frame)
688
- select_list(:academic_term, :id=>"selectTerm", :frame=>frame)
689
- end
690
- end
691
-
692
-
693
- # Page for Adding Participants to a Site in Site Setup
694
- class SiteSetupAddParticipants
695
-
696
- include PageObject
697
- include ToolsMenu
698
-
699
- def continue
700
- frm.button(:value=>"Continue").click
701
- SiteSetupChooseRole.new @browser
702
- end
703
-
704
- in_frame(:class=>"portletMainIframe") do |frame|
705
- text_area(:official_participants, :id=>"content::officialAccountParticipant", :frame=>frame)
706
- text_area(:non_official_participants, :id=>"content::nonOfficialAccountParticipant", :frame=>frame)
707
- radio_button(:assign_all_to_same_role, :id=>"content::role-row:0:role-select", :frame=>frame)
708
- radio_button(:assign_each_individually, :id=>"content::role-row:1:role-select", :frame=>frame)
709
- radio_button(:active_status, :id=>"content::status-row:0:status-select", :frame=>frame)
710
- radio_button(:inactive_status, :id=>"content::status-row:1:status-select", :frame=>frame)
711
- button(:cancel, :id=>"content::cancel", :frame=>frame)
712
-
713
- end
714
-
715
- end
716
-
717
- # Page for selecting Participant roles individually
718
- class SiteSetupChooseRolesIndiv
719
-
720
- include PageObject
721
- include ToolsMenu
722
-
723
- def continue
724
- frm.button(:value=>"Continue").click
725
- #SiteSetupParticipantEmail.new(@browser)
726
- end
727
-
728
- in_frame(:class=>"portletMainIframe") do |frame|
729
- button(:back, :name=>"command link parameters&Submitting%20control=content%3A%3Aback&Fast%20track%20action=siteAddParticipantHandler.processDifferentRoleBack", :frame=>frame)
730
- button(:cancel, :name=>"command link parameters&Submitting%20control=content%3A%3Acancel&Fast%20track%20action=siteAddParticipantHandler.processCancel", :frame=>frame)
731
- select_list(:user_role, :id=>"content::user-row:0:role-select-selection", :frame=>frame)
732
- end
733
-
734
- end
735
-
736
- # Page for selecting the same role for All. This class is used for
737
- # both Course and Portfolio sites.
738
- class SiteSetupChooseRole
739
-
740
- include PageObject
741
- include ToolsMenu
742
-
743
- def continue
744
- frm.button(:value=>"Continue").click
745
- SiteSetupParticipantEmail.new(@browser)
746
- end
747
-
748
- in_frame(:class=>"portletMainIframe") do |frame|
749
- button(:back, :name=>"command link parameters&Submitting%20control=content%3A%3Aback&Fast%20track%20action=siteAddParticipantHandler.processSameRoleBack", :frame=>frame)
750
- button(:cancel, :name=>"command link parameters&Submitting%20control=content%3A%3Acancel&Fast%20track%20action=siteAddParticipantHandler.processCancel", :frame=>frame)
751
- radio_button(:guest, :value=>"Guest", :frame=>frame)
752
- radio_button(:instructor, :value=>"Instructor", :frame=>frame)
753
- radio_button(:student, :value=>"Student", :frame=>frame)
754
- radio_button(:evaluator, :value=>"Evaluator", :frame=>frame)
755
- radio_button(:organizer, :value=>"Organizer", :frame=>frame)
756
- radio_button(:participant, :value=>"Participant", :frame=>frame)
757
- radio_button(:reviewer, :value=>"Reviewer", :frame=>frame)
758
- radio_button(:teaching_assistant, :id=>"content::role-row:3:role-select", :frame=>frame)
759
- end
760
-
761
- end
762
-
763
- # Page for specifying whether to send an email
764
- # notification to the newly added Site participants
765
- class SiteSetupParticipantEmail
766
-
767
- include PageObject
768
- include ToolsMenu
769
-
770
- def continue
771
- frm.button(:value=>"Continue").click
772
- SiteSetupParticipantConfirmation.new(@browser)
773
- end
774
-
775
- in_frame(:class=>"portletMainIframe") do |frame|
776
- button(:back, :name=>"command link parameters&Submitting%20control=content%3A%3Acontinue&Fast%20track%20action=siteAddParticipantHandler.processEmailNotiBack", :frame=>frame)
777
- button(:cancel, :name=>"command link parameters&Submitting%20control=content%3A%3Acontinue&Fast%20track%20action=siteAddParticipantHandler.processEmailNotiCancel", :frame=>frame)
778
- radio_button(:send_now, :id=>"content::noti-row:0:noti-select", :frame=>frame)
779
- radio_button(:dont_send, :id=>"content::noti-row:1:noti-select", :frame=>frame)
780
-
781
- end
782
-
783
- end
784
-
785
- # The confirmation page showing site participants and their set roles
786
- class SiteSetupParticipantConfirmation
787
-
788
- include PageObject
789
- include ToolsMenu
790
-
791
- def finish
792
- frm.button(:value=>"Finish").click
793
- SiteEditor.new(@browser)
794
- end
795
-
796
- # Returns the value of the id field for the specified name.
797
- def id(name)
798
- frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(name)}/)[1].text
799
- end
800
-
801
- # Returns the value of the Role field for the specified name.
802
- def role(name)
803
- frm.table(:class=>"listHier").row(:text=>/#{Regexp.escape(name)}/)[2].text
804
- end
805
-
806
- in_frame(:class=>"portletMainIframe") do |frame|
807
- button(:back, :name=>"command link parameters&Submitting%20control=content%3A%3Aback&Fast%20track%20action=siteAddParticipantHandler.processConfirmBack", :frame=>frame)
808
- button(:cancel, :name=>"command link parameters&Submitting%20control=content%3A%3Aback&Fast%20track%20action=siteAddParticipantHandler.processConfirmCancel", :frame=>frame)
809
- end
810
- end
811
-
812
- # The Edit Tools page (click on "Edit Tools" when editing a site
813
- # in Site Setup in the Admin Workspace)
814
- class EditSiteTools
815
-
816
- include PageObject
817
- include ToolsMenu
818
-
819
- # Clicks the Continue button, then instantiates
820
- # the appropriate class for the page that apears.
821
- def continue
822
- frm.button(:value=>"Continue").click
823
- # Logic for determining the new page class...
824
- if frm.div(:class=>"portletBody").text =~ /^Add Multiple Tool/
825
- AddMultipleTools.new(@browser)
826
- elsif frm.div(:class=>"portletBody").text =~ /^Confirming site tools edits for/
827
- ConfirmSiteToolsEdits.new(@browser)
828
- else
829
- puts "Something is wrong"
830
- puts frm.div(:class=>"portletBody").text
831
- end
832
- end
833
-
834
- in_frame(:class=>"portletMainIframe") do |frame|
835
- # This is a comprehensive list of all checkboxes and
836
- # radio buttons for this page,
837
- # though not all will appear at one time.
838
- # The list will depend on the type of site being
839
- # created/edited.
840
- checkbox(:all_tools, :id=>"all", :frame=>frame)
841
- checkbox(:home, :id=>"home", :frame=>frame)
842
- checkbox(:announcements, :id=>"sakai.announcements", :frame=>frame)
843
- checkbox(:assignments, :id=>"sakai.assignment.grades", :frame=>frame)
844
- checkbox(:basic_lti, :id=>"sakai.basiclti", :frame=>frame)
845
- checkbox(:calendar, :id=>"sakai.schedule", :frame=>frame)
846
- checkbox(:email_archive, :id=>"sakai.mailbox", :frame=>frame)
847
- checkbox(:evaluations, :id=>"osp.evaluation", :frame=>frame)
848
- checkbox(:forms, :id=>"sakai.metaobj", :frame=>frame)
849
- checkbox(:glossary, :id=>"osp.glossary", :frame=>frame)
850
- checkbox(:matrices, :id=>"osp.matrix", :frame=>frame)
851
- checkbox(:news, :id=>"sakai.news", :frame=>frame)
852
- checkbox(:portfolio_layouts, :id=>"osp.presLayout", :frame=>frame)
853
- checkbox(:portfolio_showcase, :id=>"sakai.rsn.osp.iframe", :frame=>frame)
854
- checkbox(:portfolio_templates, :id=>"osp.presTemplate", :frame=>frame)
855
- checkbox(:portfolios, :id=>"osp.presentation", :frame=>frame)
856
- checkbox(:resources, :id=>"sakai.resources", :frame=>frame)
857
- checkbox(:roster, :id=>"sakai.site.roster", :frame=>frame)
858
- checkbox(:search, :id=>"sakai.search", :frame=>frame)
859
- checkbox(:styles, :id=>"osp.style", :frame=>frame)
860
- checkbox(:web_content, :id=>"sakai.iframe", :frame=>frame)
861
- checkbox(:wizards, :id=>"osp.wizard", :frame=>frame)
862
- checkbox(:blogger, :id=>"blogger", :frame=>frame)
863
- checkbox(:blogs, :id=>"sakai.blogwow", :frame=>frame)
864
- checkbox(:chat_room, :id=>"sakai.chat", :frame=>frame)
865
- checkbox(:discussion_forums, :id=>"sakai.jforum.tool", :frame=>frame)
866
- checkbox(:drop_box, :id=>"sakai.dropbox", :frame=>frame)
867
- checkbox(:email, :id=>"sakai.mailtool", :frame=>frame)
868
- checkbox(:forums, :id=>"sakai.forums", :frame=>frame)
869
- checkbox(:certification, :id=>"com.rsmart.certification", :frame=>frame)
870
- checkbox(:feedback, :id=>"sakai.postem", :frame=>frame)
871
- checkbox(:gradebook, :id=>"sakai.gradebook.tool", :frame=>frame)
872
- checkbox(:gradebook2, :id=>"sakai.gradebook.gwt.rpc", :frame=>frame)
873
- checkbox(:lesson_builder, :id=>"sakai.lessonbuildertool", :frame=>frame)
874
- checkbox(:lessons, :id=>"sakai.melete", :frame=>frame)
875
- checkbox(:live_virtual_classroom, :id=>"rsmart.virtual_classroom.tool", :frame=>frame)
876
- checkbox(:media_gallery, :id=>"sakai.kaltura", :frame=>frame)
877
- checkbox(:messages, :id=>"sakai.messages", :frame=>frame)
878
- checkbox(:news, :id=>"sakai.news", :frame=>frame)
879
- checkbox(:opensyllabus, :id=>"sakai.opensyllabus.tool", :frame=>frame)
880
- checkbox(:podcasts, :id=>"sakai.podcasts", :frame=>frame)
881
- checkbox(:polls, :id=>"sakai.poll", :frame=>frame)
882
- checkbox(:sections, :id=>"sakai.sections", :frame=>frame)
883
- checkbox(:site_editor, :id=>"sakai.siteinfo", :frame=>frame)
884
- checkbox(:site_statistics, :id=>"sakai.sitestats", :frame=>frame)
885
- checkbox(:syllabus, :id=>"sakai.syllabus", :frame=>frame)
886
- checkbox(:tests_and_quizzes_cb, :id=>"sakai.samigo", :frame=>frame)
887
- checkbox(:wiki, :id=>"sakai.rwiki", :frame=>frame)
888
- radio_button(:no_thanks, :id=>"import_no", :frame=>frame)
889
- radio_button(:yes, :id=>"import_yes", :frame=>frame)
890
- select_list(:import_sites, :id=>"importSites", :frame=>frame)
891
- button(:back, :name=>"Back", :frame=>frame)
892
- button(:cancel, :name=>"Cancel", :frame=>frame)
893
- end
894
-
895
- end
896
-
897
- # Confirmation page when editing site tools in Site Setup
898
- class ConfirmSiteToolsEdits
899
-
900
- include PageObject
901
- include ToolsMenu
902
-
903
- # Clicks the Finish button, then instantiates
904
- # the SiteSetupEdit class.
905
- def finish
906
- frm.button(:value=>"Finish").click
907
- SiteEditor.new(@browser)
908
- end
909
-
910
- end
911
-
912
-
913
- # The Delete Confirmation Page for deleting a Site
914
- class DeleteSite
915
-
916
- include PageObject
917
- include ToolsMenu
918
-
919
- # Clicks the Remove button, then instantiates
920
- # the SiteSetup class.
921
- def remove
922
- frm.button(:value=>"Remove").click
923
- SiteSetup.new(@browser)
924
- end
925
-
926
- # Clicks the Cancel button, then instantiates
927
- # the SiteSetup class.
928
- def cancel
929
- frm.button(:value=>"Cancel").click
930
- SiteSetup.new(@browser)
931
- end
932
-
933
- end
934
- #The Site Type page that appears when creating a new site
935
- class SiteType
936
-
937
- include PageObject
938
- include ToolsMenu
939
-
940
- # The page's Continue button. Button gets
941
- # clicked and then the appropriate class
942
- # gets instantiated, based on the page that
943
- # appears.
944
- def continue #FIXME
945
- if frm.button(:id, "submitBuildOwn").enabled?
946
- frm.button(:id, "submitBuildOwn").click
947
- elsif frm.button(:id, "submitFromTemplateCourse").enabled?
948
- frm.button(:id, "submitFromTemplateCourse").click
949
- elsif frm.button(:id, "submitFromTemplate").enabled?
950
- frm.button(:id, "submitFromTemplate").click
951
- =begin
952
- elsif frm.button(:value=>"Continue", :index=>$frame_index).enabled?
953
- frm.button(:value=>"Continue", :index=>$frame_index).fire_event("onclick")
954
- elsif frm.button(:value=>"Continue", :index=>$frame_index).enabled?
955
- frm.button(:value=>"Continue", :index=>$frame_index).fire_event("onclick")
956
- elsif frm.button(:value=>"Continue", :index=>2).enabled?
957
- frm.button(:value=>"Continue", :index=>2).fire_event("onclick")
958
- else
959
- frm.button(:value=>"Continue", :index=>2).fire_event("onclick")
960
- =end
961
- end
962
-
963
- if frm.div(:class=>"portletBody").h3.text=="Course/Section Information"
964
- CourseSectionInfo.new(@browser)
965
- elsif frm.div(:class=>"portletBody").h3.text=="Project Site Information"
966
- ProjectSiteInfo.new(@browser)
967
- elsif frm.div(:class=>"portletBody").h3.text=="Portfolio Site Information"
968
- PortfolioSiteInfo.new(@browser)
969
- else
970
- puts "Something is wrong on Saturn 3"
971
- end
972
- end
973
-
974
- in_frame(:class=>"portletMainIframe") do |frame|
975
- radio_button(:course_site, :id=>"course", :frame=>frame)
976
- radio_button(:project_site, :id=>"project", :frame=>frame)
977
- radio_button(:portfolio_site, :id=>"portfolio", :frame=>frame)
978
- radio_button(:create_site_from_template, :id=>"copy", :frame=>frame)
979
- select_list(:academic_term, :id=>"selectTerm", :frame=>frame)
980
- select_list(:select_template, :id=>"templateSiteId", :frame=>frame)
981
- select_list(:select_term, :id=>"selectTermTemplate", :frame=>frame)
982
- button(:cancel, :id=>"cancelCreate", :frame=>frame)
983
- checkbox(:copy_users, :id=>"copyUsers", :frame=>frame)
984
- checkbox(:copy_content, :id=>"copyContent", :frame=>frame)
985
- end
986
-
987
- end
988
-
989
- # The Add Multiple Tool Instances page that appears during Site creation
990
- # after the Course Site Tools page
991
- class AddMultipleTools
992
-
993
- include PageObject
994
- include ToolsMenu
995
-
996
- # Clicks the Continue button, then instantiates
997
- # the appropriate Class, based on the page that
998
- # appears.
999
- def continue
1000
- frm.button(:value=>"Continue").click
1001
- # Logic to determine the new page class
1002
- if frm.div(:class=>"portletBody").text =~ /Course Site Access/
1003
- SiteAccess.new(@browser)
1004
- elsif frm.div(:class=>"portletBody").text =~ /^Confirming site tools edits/
1005
- ConfirmSiteToolsEdits.new(@browser)
1006
- else
1007
- puts "There's another path to define"
1008
- end
1009
- end
1010
-
1011
- in_frame(:class=>"portletMainIframe") do |frame|
1012
- # Note that the text field definitions included here
1013
- # for the Tools definitions are ONLY for the first
1014
- # instances of each. Since the UI allows for
1015
- # an arbitrary number, if you are writing tests
1016
- # that add more then you're going to have to explicitly
1017
- # reference them or define them in the test case script
1018
- # itself--for now, anyway.
1019
- text_field(:site_email_address, :id=>"emailId", :frame=>frame)
1020
- text_field(:basic_lti_title, :id=>"title_sakai.basiclti", :frame=>frame)
1021
- select_list(:more_basic_lti_tools, :id=>"num_sakai.basiclti", :frame=>frame)
1022
- text_field(:lesson_builder_title, :id=>"title_sakai.lessonbuildertool", :frame=>frame)
1023
- select_list(:more_lesson_builder_tools, :id=>"num_sakai.lessonbuildertool", :frame=>frame)
1024
- text_field(:news_title, :id=>"title_sakai.news", :frame=>frame)
1025
- text_field(:news_url_channel, :name=>"channel-url_sakai.news", :frame=>frame)
1026
- select_list(:more_news_tools, :id=>"num_sakai.news", :frame=>frame)
1027
- text_field(:web_content_title, :id=>"title_sakai.iframe", :frame=>frame)
1028
- text_field(:web_content_source, :id=>"source_sakai.iframe", :frame=>frame)
1029
- select_list(:more_web_content_tools, :id=>"num_sakai.iframe", :frame=>frame)
1030
- button(:back, :name=>"Back", :frame=>frame)
1031
- button(:cancel, :name=>"Cancel", :frame=>frame)
1032
-
1033
- end
1034
-
1035
- end
1036
-
1037
- # The Course/Section Information page that appears when creating a new Site
1038
- class CourseSectionInfo
1039
-
1040
- include PageObject
1041
- include ToolsMenu
1042
-
1043
- # Clicks the Continue button, then instantiates
1044
- # the CourseSiteInfo Class.
1045
- def continue
1046
- frm.button(:value=>"Continue").click
1047
- CourseSiteInfo.new(@browser)
1048
- end
1049
-
1050
- # Clicks the Done button (or the
1051
- # "Done - go to Site" button if it
1052
- # happens to be there), then instantiates
1053
- # the SiteSetup Class.
1054
- def done
1055
- frm.button(:value=>/Done/).click
1056
- SiteSetup.new(@browser)
1057
- end
1058
-
1059
- in_frame(:class=>"portletMainIframe") do |frame|
1060
- # Note that ONLY THE FIRST instances of the
1061
- # subject, course, and section fields
1062
- # are included in the page elements definitions here,
1063
- # because their identifiers are dependent on how
1064
- # many instances exist on the page.
1065
- # This means that if you need to access the second
1066
- # or subsequent of these elements, you'll need to
1067
- # explicitly identify/define them in the test case
1068
- # itself.
1069
- text_field(:subject, :name=>/Subject:/, :frame=>frame)
1070
- text_field(:course, :name=>/Course:/, :frame=>frame)
1071
- text_field(:section, :name=>/Section:/, :frame=>frame)
1072
- text_field(:authorizers_username, :id=>"uniqname", :frame=>frame)
1073
- text_field(:special_instructions, :id=>"additional", :frame=>frame)
1074
- select_list(:add_more_rosters, :id=>"number", :frame=>frame)
1075
- button(:back, :name=>"Back", :frame=>frame)
1076
- button(:cancel, :name=>"Cancel", :frame=>frame)
1077
- end
1078
-
1079
- end
1080
-
1081
- # The Site Access Page that appears during Site creation
1082
- # immediately following the Add Multiple Tools Options page.
1083
- class SiteAccess
1084
-
1085
- include PageObject
1086
- include ToolsMenu
1087
-
1088
- # The page element that displays the joiner role
1089
- # select list. Use this method to validate whether the
1090
- # select list is visible or not.
1091
- #
1092
- # Example: page.joiner_role_div.visible?
1093
- def joiner_role_div
1094
- frm.div(:id=>"joinerrole")
1095
- end
1096
-
1097
- # Clicks the Continue button, then
1098
- # instantiates the ConfirmCourseSiteSetup class.
1099
- def continue
1100
- frm.button(:value=>"Continue").click
1101
- ConfirmSiteSetup.new(@browser)
1102
- end
1103
-
1104
- in_frame(:class=>"portletMainIframe") do |frame|
1105
- radio_button(:publish_site, :id=>"publish", :frame=>frame)
1106
- radio_button(:leave_as_draft, :id=>"unpublish", :frame=>frame)
1107
- radio_button(:limited, :id=>"unjoinable", :frame=>frame)
1108
- radio_button(:allow, :id=>"joinable", :frame=>frame)
1109
- button(:back, :name=>"eventSubmit_doBack", :frame=>frame)
1110
- button(:cancel, :name=>"eventSubmit_doCancel_create", :frame=>frame)
1111
- select_list(:joiner_role, :id=>"joinerRole", :frame=>frame)
1112
- end
1113
-
1114
- end
1115
-
1116
- # The Confirmation page at the end of a Course Site Setup
1117
- class ConfirmSiteSetup
1118
-
1119
- include PageObject
1120
- include ToolsMenu
1121
-
1122
- # Clicks the Request Site button, then
1123
- # instantiates the SiteSetup Class.
1124
- def request_site
1125
- frm.button(:value=>"Request Site").click
1126
- SiteSetup.new(@browser)
1127
- end
1128
-
1129
- # For portfolio sites...
1130
- # Clicks the "Create Site" button and
1131
- # instantiates the SiteSetup class.
1132
- def create_site
1133
- frm.button(:value=>"Create Site").click
1134
- SiteSetup.new(@browser)
1135
- end
1136
-
1137
- end
1138
-
1139
- # The Course Site Information page that appears when creating a new Site
1140
- # immediately after the Course/Section Information page
1141
- class CourseSiteInfo
1142
-
1143
- include PageObject
1144
- include ToolsMenu
1145
-
1146
- # Clicks the Continue button, then
1147
- # instantiates the EditSiteTools Class.
1148
- def continue
1149
- frm.button(:value=>"Continue").click
1150
- EditSiteTools.new(@browser)
1151
- end
1152
-
1153
- # Gets the text contained in the alert box
1154
- # on the web page.
1155
- def alert_box_text
1156
- frm.div(:class=>"portletBody").div(:class=>"alertMessage").text
1157
- end
1158
-
1159
- in_frame(:class=>"portletMainIframe") do |frame|
1160
- text_field(:short_description, :id=>"short_description", :frame=>frame)
1161
- text_field(:special_instructions, :id=>"additional", :frame=>frame)
1162
- text_field(:site_contact_name, :id=>"siteContactName", :frame=>frame)
1163
- text_field(:site_contact_email, :id=>"siteContactEmail", :frame=>frame)
1164
- button(:back, :name=>"Back", :frame=>frame)
1165
- button(:cancel, :name=>"Cancel", :frame=>frame)
1166
- end
1167
-
1168
- end
1169
-
1170
- #
1171
- class PortfolioSiteInfo
1172
-
1173
- include PageObject
1174
- include ToolsMenu
1175
-
1176
- def description=(text)
1177
- frm.frame(:id, "description___Frame").td(:id, "xEditingArea").frame(:index=>0).send_keys(text)
1178
- end
1179
-
1180
- def continue
1181
- frm.button(:value=>"Continue").click
1182
- PortfolioSiteTools.new(@browser)
1183
- end
1184
-
1185
- in_frame(:class=>"portletMainIframe") do |frame|
1186
- text_field(:title, :id=>"title", :frame=>frame)
1187
- text_field(:url_alias, :id=>"alias_0", :frame=>frame)
1188
- text_area(:short_description, :id=>"short_description", :frame=>frame)
1189
- text_field(:icon_url, :id=>"iconUrl", :frame=>frame)
1190
- text_field(:site_contact_name, :id=>"siteContactName", :frame=>frame)
1191
- text_field(:site_contact_email, :id=>"siteContactEmail", :frame=>frame)
1192
- end
1193
- end
1194
-
1195
- #
1196
- class PortfolioSiteTools
1197
-
1198
- include PageObject
1199
- include ToolsMenu
1200
-
1201
- def continue
1202
- frm.button(:value=>"Continue").click
1203
- PortfolioConfigureToolOptions.new(@browser)
1204
- end
1205
-
1206
- in_frame(:class=>"portletMainIframe") do |frame|
1207
- checkbox(:all_tools, :id=>"all", :frame=>frame)
1208
-
1209
- end
1210
- end
1211
-
1212
- #
1213
- class PortfolioConfigureToolOptions
1214
-
1215
- include PageObject
1216
- include ToolsMenu
1217
-
1218
- def continue
1219
- frm.button(:value=>"Continue").click
1220
- SiteAccess.new(@browser)
1221
- end
1222
-
1223
- in_frame(:class=>"portletMainIframe") do |frame|
1224
- text_field(:email, :id=>"emailId", :frame=>frame)
1225
- end
1226
- end
1227
-
1228
-