Class: CalendarSearch

Inherits:
BasePage
  • Object
show all
Defined in:
lib/sambal-kuali/pages/calendar_search.rb

Constant Summary collapse

CALENDAR_NAME =
0
CALENDAR_START_DATE =
1
CALENDAR_END_DATE =
2
CALENDAR_STATUS =
3

Instance Method Summary collapse

Methods inherited from BasePage

frame_element, green_search_buttons, validation_elements, wrapper_elements

Instance Method Details

#calendar_status(calendar) ⇒ Object



57
58
59
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 57

def calendar_status calendar
  results_table.row(text: /#{calendar}/)[CALENDAR_STATUS].text
end

#copy(calendar) ⇒ Object



47
48
49
50
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 47

def copy calendar
  results_table.row(text: /#{calendar}/).link(text: "Copy").click
  loading.wait_while_present
end

#delete(calendar) ⇒ Object



52
53
54
55
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 52

def delete calendar
  results_table.row(text: /#{calendar}/).link(text: "Delete").click
  loading.wait_while_present
end

#edit(calendar) ⇒ Object



42
43
44
45
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 42

def edit calendar
  results_table.row(text: /#{calendar}/).link(text: "Edit").click
  loading.wait_while_present
end

#results_listObject



61
62
63
64
65
66
67
68
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 61

def results_list
  list = []
  results_table.rows.each do |row|
    list << row[CALENDAR_NAME].text
  end
  list.delete_if { |item| item == "Name" }
  list
end

#search_for(cal_or_term, nm, yr = "") ⇒ Object



32
33
34
35
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 32

def search_for cal_or_term, nm, yr=""
  search_for_select.select cal_or_term
  setnameyear nm, yr
end

#showing_up_toObject



28
29
30
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 28

def showing_up_to
  table_info[/(?<=to )\d+/]
end

#total_resultsObject



24
25
26
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 24

def total_results
  table_info[/(?<=of )\d+/]
end

#view(calendar) ⇒ Object



37
38
39
40
# File 'lib/sambal-kuali/pages/calendar_search.rb', line 37

def view calendar
  results_table.row(text: /#{calendar}/).link(text: "View").click
  loading.wait_while_present
end