Module: ImportStepThreeMethods

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

Overview

The page for reviewing activities and confirming them for import.

Instance Method Summary collapse

Instance Method Details

#event_date(event_name) ⇒ Object

Returns the date of the specified event



447
448
449
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 447

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.



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 430

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



424
425
426
427
# File 'lib/kuali-sakai-common-lib/calendar.rb', line 424

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



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

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