Class: Rollover
- Inherits:
-
Object
- Object
- Rollover
- Includes:
- DataFactory, DateFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-kuali/data_objects/rollover.rb
Instance Attribute Summary collapse
-
#source_term ⇒ Object
Returns the value of attribute source_term.
-
#target_term ⇒ Object
Returns the value of attribute target_term.
Instance Method Summary collapse
-
#initialize(browser, opts = {}) ⇒ Rollover
constructor
A new instance of Rollover.
- #perform_rollover ⇒ Object
- #release_to_depts ⇒ Object
- #wait_for_rollover_to_complete ⇒ Object
Methods included from Workflows
#go_to_academic_calendar, #go_to_calendar_search, #go_to_create_course_offerings, #go_to_create_population, #go_to_display_schedule_of_classes, #go_to_holiday_calendar, #go_to_manage_course_offerings, #go_to_manage_population, #go_to_perform_rollover, #go_to_rollover_details, #log_in, #logged_in_user
Constructor Details
#initialize(browser, opts = {}) ⇒ Rollover
Returns a new instance of Rollover.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 12 def initialize(browser, opts={}) @browser = browser defaults = { :source_term=>"20122", :target_term=>"20212" } = defaults.merge(opts) () end |
Instance Attribute Details
#source_term ⇒ Object
Returns the value of attribute source_term.
9 10 11 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 9 def source_term @source_term end |
#target_term ⇒ Object
Returns the value of attribute target_term.
9 10 11 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 9 def target_term @target_term end |
Instance Method Details
#perform_rollover ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 23 def perform_rollover go_to_perform_rollover on PerformRollover do |page| @target_term = page.select_terms(@target_term,@source_term) raise "source_term_code issue" unless page.source_term_code == @source_term raise "target_term_code issue" unless page.target_term_code == @target_term page.rollover_course_offerings raise "rollover issue" unless page.status == "In Progress" end end |
#release_to_depts ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 48 def release_to_depts go_to_rollover_details on RolloverDetails do |page| page.term.set @target_term page.go raise "rollover details - release to depts not enabled" unless page..enabled? page.release_to_departments end on RolloverConfirmReleaseToDepts do |page| page.confirm page.release_to_departments end on RolloverDetails do |page| raise "release to depts not completed" unless page.status_detail_msg =~ /have been released to the departments/ end end |
#wait_for_rollover_to_complete ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/sambal-kuali/data_objects/rollover.rb', line 34 def wait_for_rollover_to_complete go_to_rollover_details on RolloverDetails do |page| page.term.set @target_term page.go poll_ctr = 0 while page.status != "Finished" and poll_ctr < 20 #will wait 10 mins poll_ctr = poll_ctr + 1 sleep 30 page.go end end end |