Class: DisplayScheduleOfClasses
- Inherits:
-
BasePage
- Object
- PageFactory
- BasePage
- DisplayScheduleOfClasses
show all
- Defined in:
- lib/sambal-kuali/pages/display_schedule_of_classes.rb
Constant Summary
collapse
- EXPAND_ACTION_COLUMN =
0
- COURSE_CODE_COLUMN =
1
- TITLE_COLUMN =
2
- CREDITS_COLUMN =
3
- AO_CODE_COLUMN =
0
- TYPE_COLUMN =
1
- DAYS_COLUMN =
2
- ST_TIME_COLUMN =
3
- END_TIME_COLUMN =
4
- BUILDING_COLUMN =
5
- ROOM_COLUMN =
6
- INSTRUCTOR_COLUMN =
7
- MAX_ENR_COLUMN =
8
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BasePage
frame_element, green_search_buttons, validation_elements, wrapper_elements
Class Method Details
.ao_details_table_accessor_maker(method_name, column) ⇒ Object
113
114
115
116
117
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 113
def self.ao_details_table_accessor_maker(method_name, column)
define_method method_name.to_s do |course_code, activity_offering_code|
ao_info(course_code, activity_offering_code,column)
end
end
|
Instance Method Details
104
105
106
107
108
109
110
111
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 104
def ao_information_target_row(course_code,activity_offering_code)
course_ao_information_table(course_code).rows.each do |row|
if row.cells[AO_CODE_COLUMN].text == activity_offering_code
return row
end
end
raise "row not found in course information table - course code: #{course_code}, ao_code: #{activity_offering_code}"
end
|
must call ‘course_expand’ first
70
71
72
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 70
def course_ao_information_table(course_code) target_course_row(course_code).table
end
|
#course_description(course_code) ⇒ Object
must call ‘course_expand’ first
74
75
76
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 74
def course_description(course_code) target_course_row(course_code).div(id: /findThisId/).p.text
end
|
#course_expand(course_code) ⇒ Object
57
58
59
60
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 57
def course_expand(course_code)
target_course_row(course_code).cells[EXPAND_ACTION_COLUMN].image().click
loading.wait_while_present
end
|
#course_title(course_code) ⇒ Object
62
63
64
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 62
def course_title(course_code)
target_course_row(course_code).cells[TITLE_COLUMN].text()
end
|
#credits(course_code) ⇒ Object
66
67
68
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 66
def credits(course_code)
target_course_row(course_code).cells[CREDITS_COLUMN].text()
end
|
#get_ao_list(course_code) ⇒ Object
course details must be expanded
88
89
90
91
92
93
94
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 88
def get_ao_list(course_code) ao_list = []
course_ao_information_table(course_code).rows[1..-1].each do |row|
ao_list << row[AO_CODE_COLUMN].text
end
ao_list
end
|
#get_course_code(row) ⇒ Object
53
54
55
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 53
def get_course_code(row)
row.cells[COURSE_CODE_COLUMN].text
end
|
#get_instructor_list(course_code) ⇒ Object
course details must be expanded
96
97
98
99
100
101
102
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 96
def get_instructor_list(course_code) instructor_list = []
course_ao_information_table(course_code).rows[1..-1].each do |row|
instructor_list << row[INSTRUCTOR_COLUMN].text
end
instructor_list
end
|
#get_results_course_list ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 44
def get_results_course_list()
course_list = []
results_table.rows[1..-1].each do |row|
course_list << row[COURSE_CODE_COLUMN].text
end
course_list.delete_if { |course| course == "" }
course_list
end
|
#select_type_of_search(type_of_search) ⇒ Object
23
24
25
26
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 23
def select_type_of_search(type_of_search)
type_of_search_element.select type_of_search
loading.wait_while_present
end
|
#target_course_row(course_code) ⇒ Object
40
41
42
|
# File 'lib/sambal-kuali/pages/display_schedule_of_classes.rb', line 40
def target_course_row(course_code)
results_table.row(text: /\b#{course_code}\b/)
end
|