sambal-kuali 0.0.1

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 (65) hide show
  1. data/Gemfile +6 -0
  2. data/Gemfile.lock +34 -0
  3. data/README.md +40 -0
  4. data/lib/sambal-kuali/base_page_classes.rb +418 -0
  5. data/lib/sambal-kuali/data_objects/academic_calendar.rb +90 -0
  6. data/lib/sambal-kuali/data_objects/activity_offering.rb +438 -0
  7. data/lib/sambal-kuali/data_objects/activity_offering_cluster.rb +52 -0
  8. data/lib/sambal-kuali/data_objects/course_offering.rb +42 -0
  9. data/lib/sambal-kuali/data_objects/holiday_calendar.rb +120 -0
  10. data/lib/sambal-kuali/data_objects/population.rb +257 -0
  11. data/lib/sambal-kuali/data_objects/rollover.rb +67 -0
  12. data/lib/sambal-kuali/data_objects/schedule_of_classes.rb +130 -0
  13. data/lib/sambal-kuali/kuali_base_page.rb +49 -0
  14. data/lib/sambal-kuali/pages/active_population_lookup.rb +22 -0
  15. data/lib/sambal-kuali/pages/activity_offering_inquiry.rb +23 -0
  16. data/lib/sambal-kuali/pages/activity_offering_lookup.rb +11 -0
  17. data/lib/sambal-kuali/pages/activity_offering_maintenance.rb +93 -0
  18. data/lib/sambal-kuali/pages/activity_offering_maintenance_view.rb +44 -0
  19. data/lib/sambal-kuali/pages/add_hold.rb +11 -0
  20. data/lib/sambal-kuali/pages/appointment_window_lookup.rb +12 -0
  21. data/lib/sambal-kuali/pages/calendar_search.rb +82 -0
  22. data/lib/sambal-kuali/pages/copy_holiday_calendar.rb +20 -0
  23. data/lib/sambal-kuali/pages/course_offering_edit.rb +122 -0
  24. data/lib/sambal-kuali/pages/course_offering_info_lookup.rb +12 -0
  25. data/lib/sambal-kuali/pages/create_acad_calendar.rb +22 -0
  26. data/lib/sambal-kuali/pages/create_course_offering.rb +20 -0
  27. data/lib/sambal-kuali/pages/create_holiday_calendar.rb +16 -0
  28. data/lib/sambal-kuali/pages/create_population.rb +19 -0
  29. data/lib/sambal-kuali/pages/create_process.rb +17 -0
  30. data/lib/sambal-kuali/pages/delete_term.rb +17 -0
  31. data/lib/sambal-kuali/pages/delivery_logistics_edit.rb +37 -0
  32. data/lib/sambal-kuali/pages/department_lookup.rb +37 -0
  33. data/lib/sambal-kuali/pages/display_schedule_of_classes.rb +132 -0
  34. data/lib/sambal-kuali/pages/document_search.rb +37 -0
  35. data/lib/sambal-kuali/pages/edit_academic_calendar.rb +57 -0
  36. data/lib/sambal-kuali/pages/edit_population.rb +18 -0
  37. data/lib/sambal-kuali/pages/enrollment.rb +23 -0
  38. data/lib/sambal-kuali/pages/enrollment_fee_lookup.rb +11 -0
  39. data/lib/sambal-kuali/pages/format_offering_info_lookup.rb +9 -0
  40. data/lib/sambal-kuali/pages/header.rb +5 -0
  41. data/lib/sambal-kuali/pages/hold_lookup.rb +34 -0
  42. data/lib/sambal-kuali/pages/holiday_calendar_information.rb +25 -0
  43. data/lib/sambal-kuali/pages/login_page.rb +15 -0
  44. data/lib/sambal-kuali/pages/main_menu.rb +73 -0
  45. data/lib/sambal-kuali/pages/manage_course_offerings.rb +72 -0
  46. data/lib/sambal-kuali/pages/manage_populations.rb +11 -0
  47. data/lib/sambal-kuali/pages/manage_process.rb +20 -0
  48. data/lib/sambal-kuali/pages/manage_registration_groups.rb +89 -0
  49. data/lib/sambal-kuali/pages/manage_registration_windows.rb +12 -0
  50. data/lib/sambal-kuali/pages/organization_lookup.rb +39 -0
  51. data/lib/sambal-kuali/pages/perform_rollover.rb +68 -0
  52. data/lib/sambal-kuali/pages/personnel_lookup.rb +44 -0
  53. data/lib/sambal-kuali/pages/rollover_confirm_release_to_depts.rb +14 -0
  54. data/lib/sambal-kuali/pages/rollover_details.rb +40 -0
  55. data/lib/sambal-kuali/pages/term_info_lookup.rb +10 -0
  56. data/lib/sambal-kuali/pages/term_information.rb +8 -0
  57. data/lib/sambal-kuali/pages/term_lookup.rb +15 -0
  58. data/lib/sambal-kuali/pages/unknown_term_course_offerings.rb +10 -0
  59. data/lib/sambal-kuali/pages/view_population.rb +18 -0
  60. data/lib/sambal-kuali/pages/workflow_preferences.rb +34 -0
  61. data/lib/sambal-kuali/workflows.rb +121 -0
  62. data/lib/sambal-kuali.rb +8 -0
  63. data/linux_headless_setup.sh +107 -0
  64. data/sambal-kuali.gemspec +12 -0
  65. metadata +129 -0
@@ -0,0 +1,438 @@
1
+ class ActivityOffering
2
+ include Foundry
3
+ include DataFactory
4
+ include DateFactory
5
+ include StringFactory
6
+ include Workflows
7
+
8
+ attr_accessor :code,
9
+ :format,
10
+ :activity_type,
11
+ :max_enrollment,
12
+ :actual_delivery_logistics_list,
13
+ :requested_delivery_logistics_list,
14
+ :personnel_list,
15
+ :seat_pool_list,
16
+ :seat_remaining_percent,
17
+ :course_url,
18
+ :evaluation,
19
+ :honors_course
20
+
21
+ def initialize(browser, code)
22
+ @browser = browser
23
+ @seat_pool_list = {}
24
+ @actual_delivery_logistics_list = {}
25
+ @requested_delivery_logistics_list = {}
26
+
27
+ end
28
+
29
+ def create(opts = {})
30
+
31
+ default_seat_pool_hash = {"random"=> (make SeatPool)}
32
+ default_rdl_hash = {"default"=> (make DeliveryLogistics)}
33
+
34
+ defaults = {
35
+ :format => "Lecture",
36
+ :activity_type => "Lecture",
37
+ :max_enrollment => 100,
38
+ :actual_delivery_logistics_list => {},
39
+ :requested_delivery_logistics_list => default_rdl_hash,
40
+ :personnel_list => Array.new(1){make Personnel} ,
41
+ :seat_pool_list => default_seat_pool_hash,
42
+ #:seat_pool_list => Array.new(1){make SeatPool},
43
+ :course_url => "www.test_course.com",
44
+ :evaluation => true,
45
+ :honors_course => true
46
+ }
47
+ options = defaults.merge(opts)
48
+
49
+ @format = options[:format]
50
+ @activity_type = options[:activity_type]
51
+
52
+ on ManageCourseOfferings do |page|
53
+ #if page.codes_list.length == 0
54
+ sleep 2
55
+ page.format.select @format
56
+ page.loading.wait_while_present
57
+ sleep 2
58
+ page.activity_type.select @activity_type
59
+ page.quantity.set "1"
60
+ page.add
61
+ #end
62
+ @code = page.codes_list[0]
63
+ end
64
+
65
+ on ManageCourseOfferings do |page|
66
+ page.edit @code
67
+ end
68
+
69
+ edit(options)
70
+ end
71
+
72
+
73
+ def edit opts={}
74
+
75
+ defaults = {
76
+ :max_enrollment => @max_enrollment,
77
+ :actual_delivery_logistics_list => @actual_delivery_logistics_list,
78
+ :requested_delivery_logistics_list => @requested_delivery_logistics_list,
79
+ :personnel_list => @personnel_list ,
80
+ :seat_pool_list => @seat_pool_list,
81
+ :course_url => @course_url,
82
+ :evaluation => @evaluation,
83
+ :honors_course => @honors_course
84
+ }
85
+
86
+ options=defaults.merge(opts)
87
+
88
+ if options[:max_enrollment] != @max_enrollment
89
+ on ActivityOfferingMaintenance do |page|
90
+ page.total_maximum_enrollment.set options[:max_enrollment]
91
+ page.total_maximum_enrollment.fire_event "onchange"
92
+ @max_enrollment = options[:max_enrollment]
93
+ end
94
+ end
95
+
96
+ #TODO: comparison could be more robust
97
+ if options[:requested_delivery_logistics_list].keys != @requested_delivery_logistics_list.keys
98
+ if options[:requested_delivery_logistics_list].length > 0
99
+ on ActivityOfferingMaintenance do |page|
100
+ page.revise_logistics
101
+ end
102
+ #'save' vs 'save and process' determined by first rdl
103
+ first_rdl = options[:requested_delivery_logistics_list].values[0]
104
+ #list of requests added with updated keys
105
+ requests_added = {}
106
+
107
+ options[:requested_delivery_logistics_list].values.each do |request|
108
+ request.add_logistics_request()
109
+ requests_added["#{request.days}#{request.start_time}#{request.start_time_ampm.upcase}".delete(' ')] = request
110
+ end
111
+
112
+ if first_rdl.process
113
+ @actual_delivery_logistics_list.merge!(requests_added)
114
+ first_rdl.save_and_process()
115
+ else
116
+ @requested_delivery_logistics_list.merge(requests_added)
117
+ first_rdl.save()
118
+ end
119
+ end
120
+ end
121
+
122
+ on ActivityOfferingMaintenance do |page|
123
+ if options[:course_url] != @course_url
124
+ page.course_url.set options[:course_url]
125
+ @course_url = options[:course_url]
126
+ end
127
+
128
+ if options[:evaluation] != @evaluation
129
+ if options[:evaluation]
130
+ page.requires_evaluation.set
131
+ else
132
+ page.requires_evaluation.clear
133
+ end
134
+ @evaluation = options[:evaluation]
135
+ end
136
+
137
+ if options[:honors_course] != @honors_course
138
+ if options[:honors_course]
139
+ page.honors_flag.set
140
+ else
141
+ page.honors_flag.clear
142
+ end
143
+ @honors_course = options[:honors_course]
144
+ end
145
+ end
146
+ if options[:personnel_list] != @personnel_list
147
+ options[:personnel_list].each do |person|
148
+ person.add_personnel
149
+ end
150
+ @personnel_list = options[:personnel_list]
151
+ end
152
+
153
+ #TODO: comparison could be more robust
154
+ if options[:seat_pool_list].keys != @seat_pool_list.keys
155
+ options[:seat_pool_list].each do |key,seat_pool|
156
+ seat_pool.add_seatpool
157
+ @seat_pool_list[key] = seat_pool unless !seat_pool.exp_add_succeed?
158
+ end
159
+ end
160
+ end
161
+
162
+ def update()
163
+ on ActivityOfferingMaintenance do |page|
164
+ page.submit
165
+ end
166
+ end
167
+
168
+ def save()
169
+ on ActivityOfferingMaintenance do |page|
170
+ page.submit
171
+ end
172
+ end
173
+
174
+ def seats_remaining
175
+ seats_used = 0
176
+ @seat_pool_list.each do |key,seat_pool|
177
+ seats_used += seat_pool.seats.to_i
178
+ end
179
+ [@max_enrollment - seats_used , 0].max
180
+ end
181
+
182
+ def remove_seatpool(seatpool_key)
183
+ on ActivityOfferingMaintenance do |page|
184
+ page.remove_seatpool(@seat_pool_list[seatpool_key].population_name)
185
+ end
186
+ @seat_pool_list.delete(seatpool_key)
187
+ end
188
+
189
+ def remove_seatpools()
190
+ @seat_pool_list.each do |seatpool_key|
191
+ if @seat_pool_list[seatpool_key].remove
192
+ on ActivityOfferingMaintenance do |page|
193
+ page.remove_seatpool(@seat_pool_list[seatpool_key].population_name)
194
+ end
195
+ @seat_pool_list.delete(seatpool_key)
196
+ end
197
+ end
198
+ end
199
+
200
+ def resequence_seatpools()
201
+ @seat_pool_list.values.each do |seatpool|
202
+ seatpool.priority = seatpool.priority_after_reseq
203
+ end
204
+ end
205
+
206
+ def edit_seatpool opts = {}
207
+
208
+ sp_key = opts[:seatpool_key]
209
+ sp_key = @seat_pool_list.keys[0] unless sp_key != nil
210
+
211
+ defaults = {
212
+ :priority => @seat_pool_list[sp_key].priority,
213
+ :seats => @seat_pool_list[sp_key].seats,
214
+ :expiration_milestone => @seat_pool_list[sp_key].expiration_milestone,
215
+ :remove => false,
216
+ :priority_after_reseq => @seat_pool_list[sp_key].priority_after_reseq
217
+ }
218
+ options=defaults.merge(opts)
219
+ update_pop_name = @seat_pool_list[sp_key].population_name
220
+
221
+ on ActivityOfferingMaintenance do |page|
222
+ page.update_seats(update_pop_name, options[:seats])
223
+ @seat_pool_list[sp_key].seats = options[:seats]
224
+ end
225
+
226
+
227
+ if options[:priority] != @seat_pool_list[sp_key].priority
228
+ on ActivityOfferingMaintenance do |page|
229
+ page.update_priority(update_pop_name,options[:priority])
230
+ @seat_pool_list[sp_key].priority = options[:priority]
231
+ end
232
+ end
233
+
234
+ if options[:expiration_milestone] != @seat_pool_list[sp_key].expiration_milestone
235
+ on ActivityOfferingMaintenance do |page|
236
+ page.update_expiration_milestone(update_pop_name,options[:expiration_milestone])
237
+ @seat_pool_list[sp_key].expiration_milestone = options[:expiration_milestone]
238
+ end
239
+ end
240
+
241
+ if options[:priority_after_reseq] != @seat_pool_list[sp_key].priority_after_reseq
242
+ @seat_pool_list[sp_key].priority_after_reseq = options[:priority_after_reseq]
243
+ end
244
+
245
+ #remove has to be last...
246
+ if options[:remove]
247
+ on ActivityOfferingMaintenance do |page|
248
+ page.remove_seatpool(update_pop_name)
249
+ @seat_pool_list.delete(sp_key)
250
+ end
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+
257
+
258
+ class SeatPool
259
+
260
+ include Foundry
261
+ include DataFactory
262
+ include DateFactory
263
+ include StringFactory
264
+ include Workflows
265
+
266
+ attr_accessor :priority,
267
+ :seats,
268
+ :population_name,
269
+ :expiration_milestone,
270
+ :remove,
271
+ :priority_after_reseq,
272
+ :exp_add_succeed
273
+
274
+ alias_method :remove?, :remove
275
+ alias_method :exp_add_succeed?, :exp_add_succeed
276
+
277
+ def initialize(browser, opts={})
278
+ @browser = browser
279
+
280
+ defaults = {
281
+ :priority => 1,
282
+ :seats => 10,
283
+ :population_name => "random",
284
+ :expiration_milestone => "First Day of Classes",
285
+ :remove => false,
286
+ :priority_after_reseq => 0,
287
+ :exp_add_succeed => true
288
+ }
289
+ options = defaults.merge(opts)
290
+ options[:priority_after_reseq] = options[:priority] unless options[:priority_after_reseq] != 0
291
+ set_options(options)
292
+
293
+ end
294
+
295
+ def percent_of_total(max_enrollment)
296
+ "#{(@seats.to_i*100/max_enrollment.to_i).round(0)}%"
297
+ end
298
+
299
+ def add_seatpool
300
+ on ActivityOfferingMaintenance do |page|
301
+ page.add_pool_priority.set @priority
302
+ page.add_pool_seats.set @seats
303
+ if @population_name != ""
304
+ page.lookup_population_name
305
+
306
+ #TODO should really call Population.search_for_pop
307
+ on ActivePopulationLookup do |page|
308
+ if @population_name == "random"
309
+ page.keyword.wait_until_present
310
+ #page.keyword.set random_letters(1)
311
+ page.search
312
+ page.change_results_page(1+rand(3))
313
+ names = page.results_list
314
+ @population_name = names[1+rand(9)]
315
+ page.return_value @population_name
316
+ else
317
+ page.keyword.set @population_name
318
+ page.search
319
+ page.return_value @population_name
320
+ end
321
+ end
322
+
323
+ end
324
+ on ActivityOfferingMaintenance do |page|
325
+ page.add_seat_pool
326
+ end
327
+ end
328
+ end
329
+ end
330
+
331
+ class Personnel
332
+ include Foundry
333
+ include DataFactory
334
+ include DateFactory
335
+ include StringFactory
336
+ include Workflows
337
+
338
+ attr_accessor :id,
339
+ :affiliation,
340
+ :inst_effort
341
+
342
+ def initialize(browser, opts={})
343
+ @browser = browser
344
+
345
+ defaults = {
346
+ :id => "admin",
347
+ :affiliation => "Instructor",
348
+ :inst_effort => 50
349
+ }
350
+ options = defaults.merge(opts)
351
+ set_options(options)
352
+ end
353
+
354
+ def add_personnel
355
+ on ActivityOfferingMaintenance do |page|
356
+ page.add_person_id.set @id
357
+ page.add_affiliation.select @affiliation
358
+ page.add_inst_effort.set @inst_effort
359
+ page.add_personnel
360
+ end
361
+ end
362
+ end
363
+
364
+ class DeliveryLogistics
365
+ include Foundry
366
+ include DataFactory
367
+ include DateFactory
368
+ include StringFactory
369
+ include Workflows
370
+
371
+ attr_accessor :tba, #boolean
372
+ :days,
373
+ :start_time,
374
+ :start_time_ampm,
375
+ :end_time,
376
+ :end_time_ampm,
377
+ :facility,
378
+ :facility_long_name,
379
+ :room,
380
+ :features_list,
381
+ :process
382
+
383
+ alias_method :tba?, :tba
384
+ alias_method :process?, :process
385
+
386
+ def initialize(browser, opts={})
387
+ @browser = browser
388
+
389
+ defaults = {
390
+ :tba => false,
391
+ :days => "MWF",
392
+ :start_time => "01:00",
393
+ :start_time_ampm => "pm",
394
+ :end_time => "02:00",
395
+ :end_time_ampm => "pm",
396
+ :facility => "ARM",
397
+ :facility_long_name => "Reckord Armory",
398
+ :room => "126",
399
+ :features_list => [],
400
+ :process => true
401
+ }
402
+ options = defaults.merge(opts)
403
+ set_options(options)
404
+ end
405
+
406
+ def add_logistics_request
407
+ on DeliveryLogisticsEdit do |page|
408
+ if @tba
409
+ page.add_tba.set
410
+ else
411
+ page.add_tba.clear
412
+ end
413
+
414
+ page.add_days.set @days
415
+ page.add_start_time.set @start_time
416
+ page.add_start_time_ampm.select @start_time_ampm
417
+ page.add_end_time.set @end_time
418
+ page.add_end_time_ampm.select @end_time_ampm
419
+ page.add_facility.set @facility
420
+ page.add_room.set @room
421
+ #page.facility_features TODO: later, facility features persistence not implemented yet
422
+ page.add
423
+ end
424
+
425
+ end
426
+
427
+ def save_and_process
428
+ on DeliveryLogisticsEdit do |page|
429
+ page.save_and_process_request
430
+ end
431
+ end
432
+
433
+ def save
434
+ on DeliveryLogisticsEdit do |page|
435
+ page.save
436
+ end
437
+ end
438
+ end
@@ -0,0 +1,52 @@
1
+ class ActivityOfferingCluster
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include DateFactory
6
+ include StringFactory
7
+ include Workflows
8
+
9
+ attr_accessor :is_default,
10
+ :private_name,
11
+ :published_name,
12
+ :is_valid,
13
+ :expected_msg,
14
+ :assigned_ao_list
15
+
16
+ alias_method :default?, :is_default
17
+ alias_method :valid?, :is_valid
18
+
19
+ def initialize(browser, opts={})
20
+ @browser = browser
21
+
22
+ defaults = {
23
+ :is_default=>false,
24
+ :private_name=>"test1_pri",
25
+ :published_name=>"test1_pub",
26
+ :is_valid=>true,
27
+ :expected_msg=>"",
28
+ :assigned_ao_list=>["A","AA","AB"]
29
+ }
30
+ options = defaults.merge(opts)
31
+ set_options(options)
32
+ end
33
+
34
+ def create
35
+ on ManageRegistrationGroups do |page|
36
+
37
+ page.private_name.set @private_name
38
+ page.published_name.set @published_name
39
+ page.create_new_cluster_button
40
+ puts page.ao_table.rows.count
41
+ puts page.cluster_list_row_name_text("test1pri")
42
+ page.ao_cluster_select.select("test1")
43
+ page.cluster_list_row_generate_reg_groups("test1")
44
+ puts page.target_ao_row("A").cells[1].text
45
+ puts page.target_ao_row("A").cells[2].text
46
+ page.select_ao_row("A")
47
+ page.ao_cluster_select.select("test1pub")
48
+ page.ao_cluster_assign_button
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,42 @@
1
+ class CourseOffering
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include DateFactory
6
+ include StringFactory
7
+ include Workflows
8
+
9
+ attr_accessor :term,
10
+ :course,
11
+ :suffix,
12
+ :activity_offering_cluster_list
13
+
14
+ def initialize(browser, opts={})
15
+ @browser = browser
16
+
17
+ defaults = {
18
+ :term=>"20122",
19
+ :course=>"ENGL103",
20
+ :suffix=>"",
21
+ :activity_offering_cluster_list=>[]
22
+ }
23
+ options = defaults.merge(opts)
24
+ set_options(options)
25
+ end
26
+
27
+ def manage
28
+ go_to_manage_course_offerings
29
+ on ManageCourseOfferings do |page|
30
+ page.term.set @term
31
+ page.input_code.set @course
32
+ page.show
33
+ end
34
+ end
35
+
36
+ def manage_registration_groups
37
+ on ManageCourseOfferings do |page|
38
+ page.manage_registration_groups
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,120 @@
1
+ class HolidayCalendar
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include DateFactory
6
+ include StringFactory
7
+ include Workflows
8
+
9
+ attr_accessor :name, :start_date, :end_date, :organization, :holiday_types
10
+
11
+ def initialize(browser, opts={})
12
+ @browser = browser
13
+
14
+ defaults = {
15
+ :name=>random_alphanums.strip,
16
+ :start_date=>"09/01/#{next_year}",
17
+ :end_date=>"06/25/#{next_year + 1}",
18
+ :organization=>"Registrar's Office",
19
+ :holiday_types=>[
20
+ {:type=>"random", :start_date=>"02/01/#{next_year + 1}", :all_day=>true, :date_range=>false, :instructional=>false},
21
+ {:type=>"random", :start_date=>"03/02/#{next_year + 1}", :end_date=>"03/04/#{next_year + 1}", :all_day=>true, :date_range=>true, :instructional=>false},
22
+ {:type=>"random", :start_date=>"04/05/#{next_year + 1}", :start_time=>"03:00", :start_meridian=>"pm", :end_time=>"07:44", :end_meridian=>"pm", :all_day=>false, :date_range=>false, :instructional=>false},
23
+ {:type=>"random", :start_date=>"05/11/#{next_year + 1}", :start_time=>"02:22", :start_meridian=>"am", :end_date=>"05/22/#{next_year + 1}", :end_time=>"07:44", :end_meridian=>"pm", :all_day=>false, :date_range=>true, :instructional=>false}
24
+ ]
25
+ }
26
+ options = defaults.merge(opts)
27
+ set_options(options)
28
+ end
29
+
30
+ def create
31
+ go_to_holiday_calendar
32
+ on CopyHolidayCalendar do |page|
33
+ page.start_blank_calendar
34
+ end
35
+ on CreateHolidayCalendar do |page|
36
+ page.name.set @name
37
+ page.start_date.set @start_date
38
+ page.end_date.set @end_date
39
+ page.organization.select @organization
40
+ @holiday_types.each do |holiday|
41
+ if holiday[:type] == "random"
42
+ page.select_random_holiday
43
+ holiday[:type]=page.holiday_type.value
44
+ else
45
+ page.holiday_type.select holiday[:type]
46
+ end
47
+ page.holiday_start_date.set holiday[:start_date]
48
+ if holiday[:date_range]
49
+ page.date_range.set
50
+ begin
51
+ wait_until { holiday_end_date.enabled? }
52
+ rescue Selenium::WebDriver::Error::StaleElementReferenceError
53
+ sleep 2
54
+ end
55
+ page.holiday_end_date.set holiday[:end_date]
56
+ else
57
+ page.date_range.clear if page.date_range.set?
58
+ end
59
+ if holiday[:all_day]
60
+ all_day.set unless all_day.set?
61
+ else
62
+ page.start_time
63
+ end
64
+ end
65
+ end
66
+ end
67
+
68
+ def copy_from(name)
69
+ go_to_holiday_calendar
70
+ if right_source? name
71
+ on CopyHolidayCalendar do |page|
72
+ page.name.set @name
73
+ page.start_date.set @start_date
74
+ page.end_date.set @end_date
75
+ end
76
+ else
77
+ on CopyHolidayCalendar do |page|
78
+ page.choose_different_calendar
79
+ end
80
+ on CalendarSearch do |page|
81
+ page.search_for "Holiday Calendar", name
82
+ page.copy name
83
+ end
84
+ on EditAcademicCalendar do |page|
85
+ page.academic_calendar_name.set @name
86
+ page.organization.select @organization
87
+ page.calendar_start_date.set @start_date
88
+ page.calendar_end_date.set @end_date
89
+ end
90
+ on EditAcademicCalendar do |page|
91
+ page.save
92
+ end
93
+
94
+ def search
95
+ go_to_calendar_search
96
+ on CalendarSearch do |page|
97
+ page.search_for "Academic Calendar", @name
98
+ end
99
+ end
100
+
101
+ def right_source?(name)
102
+ on CreateAcadCalendar do |page|
103
+ if page.source_name == name
104
+ return true
105
+ else
106
+ return false
107
+ end
108
+ end
109
+ end
110
+
111
+ def make_official
112
+ on EditAcademicCalendar do |page|
113
+ page.make_official
114
+ end
115
+ end
116
+
117
+ end
118
+ end
119
+ end
120
+