Module: ImportStepThreeMethods

Includes:
PageObject
Defined in:
lib/kuali-sakai-common-lib/calendar.rb

Overview

The page for reviewing activities and confirming them for import.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.page_elements(identifier) ⇒ Object



460
461
462
463
464
465
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 460

def self.page_elements(identifier)
  in_frame(identifier) do |frame|
    radio_button(:import_events_for_site, :id=>"site", :frame=>frame)
    radio_button(:import_events_for_selected_groups, :id=>"groups", :frame=>frame)
  end
end

Instance Method Details

#event_date(event_name) ⇒ Object

Returns the date of the specified event



451
452
453
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 451

def event_date(event_name)
  frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)[0].text
end

#eventsObject

Returns an array containing the list of Activity names on the page.



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 434

def events
  list = []
  frm.table(:class=>/listHier lines/).rows.each do |row|
    if row.label(:for=>/eventSelected/).exist?
      list << row.label.text
    end
  end
  names = []
  list.uniq!
  list.each do | item |
    name = item[/(?<=\s).+(?=\s\s\()/]
    names << name
  end
  return names
end

#import_eventsObject



428
429
430
431
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 428

def import_events
  frm.button(:value=>"Import Events").click
  Calendar.new(@browser)
end

#uncheck_event(event_name) ⇒ Object

Unchecks the checkbox for the specified event



456
457
458
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 456

def uncheck_event(event_name)
  frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)
end