sambal-kuali 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -0
- data/Gemfile.lock +34 -0
- data/README.md +40 -0
- data/lib/sambal-kuali/base_page_classes.rb +418 -0
- data/lib/sambal-kuali/data_objects/academic_calendar.rb +90 -0
- data/lib/sambal-kuali/data_objects/activity_offering.rb +438 -0
- data/lib/sambal-kuali/data_objects/activity_offering_cluster.rb +52 -0
- data/lib/sambal-kuali/data_objects/course_offering.rb +42 -0
- data/lib/sambal-kuali/data_objects/holiday_calendar.rb +120 -0
- data/lib/sambal-kuali/data_objects/population.rb +257 -0
- data/lib/sambal-kuali/data_objects/rollover.rb +67 -0
- data/lib/sambal-kuali/data_objects/schedule_of_classes.rb +130 -0
- data/lib/sambal-kuali/kuali_base_page.rb +49 -0
- data/lib/sambal-kuali/pages/active_population_lookup.rb +22 -0
- data/lib/sambal-kuali/pages/activity_offering_inquiry.rb +23 -0
- data/lib/sambal-kuali/pages/activity_offering_lookup.rb +11 -0
- data/lib/sambal-kuali/pages/activity_offering_maintenance.rb +93 -0
- data/lib/sambal-kuali/pages/activity_offering_maintenance_view.rb +44 -0
- data/lib/sambal-kuali/pages/add_hold.rb +11 -0
- data/lib/sambal-kuali/pages/appointment_window_lookup.rb +12 -0
- data/lib/sambal-kuali/pages/calendar_search.rb +82 -0
- data/lib/sambal-kuali/pages/copy_holiday_calendar.rb +20 -0
- data/lib/sambal-kuali/pages/course_offering_edit.rb +122 -0
- data/lib/sambal-kuali/pages/course_offering_info_lookup.rb +12 -0
- data/lib/sambal-kuali/pages/create_acad_calendar.rb +22 -0
- data/lib/sambal-kuali/pages/create_course_offering.rb +20 -0
- data/lib/sambal-kuali/pages/create_holiday_calendar.rb +16 -0
- data/lib/sambal-kuali/pages/create_population.rb +19 -0
- data/lib/sambal-kuali/pages/create_process.rb +17 -0
- data/lib/sambal-kuali/pages/delete_term.rb +17 -0
- data/lib/sambal-kuali/pages/delivery_logistics_edit.rb +37 -0
- data/lib/sambal-kuali/pages/department_lookup.rb +37 -0
- data/lib/sambal-kuali/pages/display_schedule_of_classes.rb +132 -0
- data/lib/sambal-kuali/pages/document_search.rb +37 -0
- data/lib/sambal-kuali/pages/edit_academic_calendar.rb +57 -0
- data/lib/sambal-kuali/pages/edit_population.rb +18 -0
- data/lib/sambal-kuali/pages/enrollment.rb +23 -0
- data/lib/sambal-kuali/pages/enrollment_fee_lookup.rb +11 -0
- data/lib/sambal-kuali/pages/format_offering_info_lookup.rb +9 -0
- data/lib/sambal-kuali/pages/header.rb +5 -0
- data/lib/sambal-kuali/pages/hold_lookup.rb +34 -0
- data/lib/sambal-kuali/pages/holiday_calendar_information.rb +25 -0
- data/lib/sambal-kuali/pages/login_page.rb +15 -0
- data/lib/sambal-kuali/pages/main_menu.rb +73 -0
- data/lib/sambal-kuali/pages/manage_course_offerings.rb +72 -0
- data/lib/sambal-kuali/pages/manage_populations.rb +11 -0
- data/lib/sambal-kuali/pages/manage_process.rb +20 -0
- data/lib/sambal-kuali/pages/manage_registration_groups.rb +89 -0
- data/lib/sambal-kuali/pages/manage_registration_windows.rb +12 -0
- data/lib/sambal-kuali/pages/organization_lookup.rb +39 -0
- data/lib/sambal-kuali/pages/perform_rollover.rb +68 -0
- data/lib/sambal-kuali/pages/personnel_lookup.rb +44 -0
- data/lib/sambal-kuali/pages/rollover_confirm_release_to_depts.rb +14 -0
- data/lib/sambal-kuali/pages/rollover_details.rb +40 -0
- data/lib/sambal-kuali/pages/term_info_lookup.rb +10 -0
- data/lib/sambal-kuali/pages/term_information.rb +8 -0
- data/lib/sambal-kuali/pages/term_lookup.rb +15 -0
- data/lib/sambal-kuali/pages/unknown_term_course_offerings.rb +10 -0
- data/lib/sambal-kuali/pages/view_population.rb +18 -0
- data/lib/sambal-kuali/pages/workflow_preferences.rb +34 -0
- data/lib/sambal-kuali/workflows.rb +121 -0
- data/lib/sambal-kuali.rb +8 -0
- data/linux_headless_setup.sh +107 -0
- data/sambal-kuali.gemspec +12 -0
- metadata +129 -0
@@ -0,0 +1,257 @@
|
|
1
|
+
class Population
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include DateFactory
|
6
|
+
include StringFactory
|
7
|
+
include Workflows
|
8
|
+
|
9
|
+
attr_accessor :name, :description, :rule, :operation, :child_populations,
|
10
|
+
:reference_population, :status, :type
|
11
|
+
|
12
|
+
def initialize(browser, opts={})
|
13
|
+
@browser = browser
|
14
|
+
|
15
|
+
defaults = {
|
16
|
+
:name=>random_alphanums.strip,
|
17
|
+
:description=>random_alphanums_plus.strip, # TODO: figure out why random_multiline does not validate properly
|
18
|
+
:type=>"rule-based",
|
19
|
+
:child_populations=>[],
|
20
|
+
:rule=>nil,
|
21
|
+
:reference_population=>nil,
|
22
|
+
:status=>"Active"
|
23
|
+
}
|
24
|
+
options = defaults.merge(opts)
|
25
|
+
|
26
|
+
set_options(options)
|
27
|
+
operations = {:"union-based"=>"union",:"intersection-based"=>"intersection",:"exclusion-based"=>"exclusion"}
|
28
|
+
@operation = operations[type.to_sym]
|
29
|
+
end
|
30
|
+
|
31
|
+
def create
|
32
|
+
go_to_create_population
|
33
|
+
on CreatePopulation do |page|
|
34
|
+
page.name.set @name
|
35
|
+
page.description.set @description
|
36
|
+
page.by_using_populations unless @type == 'rule-based'
|
37
|
+
case(@type)
|
38
|
+
when 'rule-based'
|
39
|
+
# Select a random rule if none is defined
|
40
|
+
@rule=random_rule(page) if @rule == nil
|
41
|
+
page.rule.select @rule
|
42
|
+
when 'union-based'
|
43
|
+
# Select union...
|
44
|
+
page.union
|
45
|
+
when 'intersection-based'
|
46
|
+
# Select intersection...
|
47
|
+
page.intersection
|
48
|
+
when 'exclusion-based'
|
49
|
+
# Select exclusion...
|
50
|
+
page.exclusion
|
51
|
+
@reference_population == nil ? @reference_population = add_random_ref_pop : add_ref_pop(@reference_population) unless @reference_population == " "
|
52
|
+
else
|
53
|
+
raise "Your population type value must be one of the following:\n'rule-based', 'union-based', 'intersection-based', or 'exclusion-based'.\nPlease update your script"
|
54
|
+
end
|
55
|
+
unless type=='rule-based'
|
56
|
+
if @child_populations.length == 0
|
57
|
+
2.times { @child_populations << add_random_population }
|
58
|
+
else
|
59
|
+
@child_populations.each do |pop|
|
60
|
+
if pop == "random"
|
61
|
+
pop.replace(add_random_population)
|
62
|
+
else
|
63
|
+
add_child_population(pop)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
on CreatePopulation do |page|
|
70
|
+
# Click the create population button...
|
71
|
+
page.create
|
72
|
+
end
|
73
|
+
sleep 10
|
74
|
+
end
|
75
|
+
|
76
|
+
def edit_population opts={}
|
77
|
+
|
78
|
+
defaults = {
|
79
|
+
:name=>@name,
|
80
|
+
:description=>@description,
|
81
|
+
:status=>@status,
|
82
|
+
:rule=>@rule,
|
83
|
+
:reference_population=>@reference_population,
|
84
|
+
:child_populations=>@child_populations
|
85
|
+
}
|
86
|
+
options=defaults.merge(opts)
|
87
|
+
|
88
|
+
go_to_manage_population
|
89
|
+
on ManagePopulations do |page|
|
90
|
+
page.keyword.set @name
|
91
|
+
page.both.set
|
92
|
+
page.search
|
93
|
+
page.edit @name
|
94
|
+
end
|
95
|
+
on EditPopulation do |page|
|
96
|
+
page.name.set options[:name]
|
97
|
+
page.description.set options[:description]
|
98
|
+
page.send(options[:status].downcase).set
|
99
|
+
if options[:rule] == "random"
|
100
|
+
options[:rule]=new_random_rule(page)
|
101
|
+
end
|
102
|
+
page.rule.select(options[:rule]) unless options[:rule] == nil
|
103
|
+
|
104
|
+
if options[:reference_population] == "random"
|
105
|
+
options[:reference_population] = update_random_ref_pop
|
106
|
+
@reference_population = options[:reference_population] #updating instance variable immediately - don't want to reuse this pop
|
107
|
+
else
|
108
|
+
update_ref_pop(options[:reference_population]) unless options[:reference_population] == @reference_population or options[:reference_population] == nil
|
109
|
+
end
|
110
|
+
|
111
|
+
unless @child_populations == options[:child_populations] or options[:child_populations] == []
|
112
|
+
page.child_populations.reverse.each { |pop| page.remove_population(pop) }
|
113
|
+
@child_populations = options[:child_populations] #updating instance variable immediately - don't want to reuse this pop
|
114
|
+
@child_populations.each do |pop|
|
115
|
+
if pop == "random"
|
116
|
+
pop.replace(add_random_population)
|
117
|
+
else
|
118
|
+
add_child_population(pop)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
options[:child_populations] = @child_populations #keep in sync
|
122
|
+
end
|
123
|
+
|
124
|
+
page.update
|
125
|
+
|
126
|
+
if page.first_msg == "Document was successfully submitted."
|
127
|
+
set_options(options)
|
128
|
+
else
|
129
|
+
# Do not update the Population attributes.
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def add_child_population(child_population)
|
135
|
+
on CreatePopulation do |page|
|
136
|
+
page.lookup_population
|
137
|
+
end
|
138
|
+
on ActivePopulationLookup do |page|
|
139
|
+
page.keyword.wait_until_present
|
140
|
+
page.keyword.set child_population
|
141
|
+
page.search
|
142
|
+
page.return_value child_population
|
143
|
+
end
|
144
|
+
on CreatePopulation do |page|
|
145
|
+
page.wait_until(30) { page.child_population.value == child_population }
|
146
|
+
page.add
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def add_random_population
|
151
|
+
on CreatePopulation do |page|
|
152
|
+
page.lookup_population
|
153
|
+
end
|
154
|
+
population = search_for_random_pop
|
155
|
+
on ActivePopulationLookup do |page|
|
156
|
+
page.return_value population
|
157
|
+
end
|
158
|
+
on CreatePopulation do |page|
|
159
|
+
page.wait_until(30) { page.child_population.value == population }
|
160
|
+
page.add
|
161
|
+
end
|
162
|
+
population
|
163
|
+
end
|
164
|
+
|
165
|
+
def add_ref_pop(population)
|
166
|
+
on CreatePopulation do |page|
|
167
|
+
page.lookup_ref_population
|
168
|
+
end
|
169
|
+
on ActivePopulationLookup do |page|
|
170
|
+
page.keyword.wait_until_present
|
171
|
+
page.keyword.set population
|
172
|
+
page.search
|
173
|
+
page.return_value population
|
174
|
+
end
|
175
|
+
on CreatePopulation do |page|
|
176
|
+
page.wait_until(30) { page.reference_population.value == population }
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def add_random_ref_pop
|
181
|
+
on CreatePopulation do |page|
|
182
|
+
page.lookup_ref_population
|
183
|
+
end
|
184
|
+
population = search_for_random_pop
|
185
|
+
on ActivePopulationLookup do |page|
|
186
|
+
page.return_value population
|
187
|
+
end
|
188
|
+
on CreatePopulation do |page|
|
189
|
+
page.wait_until(30) { page.reference_population.value == population }
|
190
|
+
end
|
191
|
+
population
|
192
|
+
end
|
193
|
+
|
194
|
+
def update_ref_pop(pop)
|
195
|
+
on EditPopulation do |page|
|
196
|
+
page.lookup_ref_population
|
197
|
+
end
|
198
|
+
pop = search_for_random_pop
|
199
|
+
on ActivePopulationLookup do |page|
|
200
|
+
page.return_value pop
|
201
|
+
end
|
202
|
+
on CreatePopulation do |page|
|
203
|
+
page.wait_until(30) { page.reference_population.value == pop }
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
def update_random_ref_pop
|
208
|
+
pop = ""
|
209
|
+
on EditPopulation do |page|
|
210
|
+
page.lookup_ref_population
|
211
|
+
end
|
212
|
+
pop = search_for_random_pop
|
213
|
+
on ActivePopulationLookup do |page|
|
214
|
+
page.return_value pop
|
215
|
+
end
|
216
|
+
on CreatePopulation do |page|
|
217
|
+
page.wait_until(30) { page.reference_population.value == pop }
|
218
|
+
end
|
219
|
+
pop
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns (as a string) one of the rules listed in the Rule selection list.
|
223
|
+
def random_rule(page)
|
224
|
+
rules = []
|
225
|
+
page.rule.options.to_a.each { |item| rules << item.text }
|
226
|
+
rules.delete(@rule) unless @rule == nil
|
227
|
+
rules.shuffle!
|
228
|
+
rules[0]
|
229
|
+
end
|
230
|
+
|
231
|
+
def new_random_rule(page)
|
232
|
+
new_rule = random_rule(page)
|
233
|
+
if new_rule == @rule
|
234
|
+
new_random_rule(page)
|
235
|
+
else
|
236
|
+
new_rule
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
private
|
241
|
+
|
242
|
+
def search_for_random_pop #checks to make sure not already used
|
243
|
+
names = []
|
244
|
+
on ActivePopulationLookup do |page|
|
245
|
+
page.keyword.wait_until_present
|
246
|
+
page.search
|
247
|
+
no_of_full_pages = [(page.no_of_entries.to_i/10).to_i,5].min
|
248
|
+
page.change_results_page(1+rand(no_of_full_pages))
|
249
|
+
names = page.results_list
|
250
|
+
end
|
251
|
+
#next 2 lines ensures populat
|
252
|
+
names = names - @child_populations unless @child_populations == nil
|
253
|
+
names.delete(@reference_population) unless @reference_population == nil
|
254
|
+
names[1+rand(names.length-1)]
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
class Rollover
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include DateFactory
|
6
|
+
include StringFactory
|
7
|
+
include Workflows
|
8
|
+
|
9
|
+
attr_accessor :source_term,
|
10
|
+
:target_term
|
11
|
+
|
12
|
+
def initialize(browser, opts={})
|
13
|
+
@browser = browser
|
14
|
+
|
15
|
+
defaults = {
|
16
|
+
:source_term=>"20122",
|
17
|
+
:target_term=>"20212"
|
18
|
+
}
|
19
|
+
options = defaults.merge(opts)
|
20
|
+
set_options(options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def perform_rollover
|
24
|
+
go_to_perform_rollover
|
25
|
+
on PerformRollover do |page|
|
26
|
+
@target_term = page.select_terms(@target_term,@source_term)
|
27
|
+
raise "source_term_code issue" unless page.source_term_code == @source_term
|
28
|
+
raise "target_term_code issue" unless page.target_term_code == @target_term
|
29
|
+
page.rollover_course_offerings
|
30
|
+
raise "rollover issue" unless page.status == "In Progress"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def wait_for_rollover_to_complete
|
35
|
+
go_to_rollover_details
|
36
|
+
on RolloverDetails do |page|
|
37
|
+
page.term.set @target_term
|
38
|
+
page.go
|
39
|
+
poll_ctr = 0
|
40
|
+
while page.status != "Finished" and poll_ctr < 20 #will wait 10 mins
|
41
|
+
poll_ctr = poll_ctr + 1
|
42
|
+
sleep 30
|
43
|
+
page.go
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def release_to_depts
|
49
|
+
go_to_rollover_details
|
50
|
+
on RolloverDetails do |page|
|
51
|
+
page.term.set @target_term
|
52
|
+
page.go
|
53
|
+
raise "rollover details - release to depts not enabled" unless page.release_to_departments_button.enabled?
|
54
|
+
page.release_to_departments
|
55
|
+
end
|
56
|
+
|
57
|
+
on RolloverConfirmReleaseToDepts do |page|
|
58
|
+
page.confirm
|
59
|
+
page.release_to_departments
|
60
|
+
end
|
61
|
+
|
62
|
+
on RolloverDetails do |page|
|
63
|
+
raise "release to depts not completed" unless page.status_detail_msg =~ /have been released to the departments/
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
class ScheduleOfClasses
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include DateFactory
|
6
|
+
include StringFactory
|
7
|
+
include Workflows
|
8
|
+
|
9
|
+
attr_accessor :term,
|
10
|
+
:course_search_parm,
|
11
|
+
:keyword,
|
12
|
+
:instructor_principal_name,
|
13
|
+
:instructor_long_name,
|
14
|
+
:department_short_name,
|
15
|
+
:type_of_search,
|
16
|
+
:exp_course_list #TODO: exp results can be expanded to include AO info, etc.
|
17
|
+
|
18
|
+
def initialize(browser, opts={})
|
19
|
+
@browser = browser
|
20
|
+
|
21
|
+
defaults = {
|
22
|
+
:term=>"Spring 2012",
|
23
|
+
:course_search_parm=>"ENGL103",
|
24
|
+
:department_short_name=>"ENGL",
|
25
|
+
:instructor_principal_name=>"B.JOHND",
|
26
|
+
:keyword=>"WRITING FROM SOURCES" ,
|
27
|
+
:type_of_search=>"Course", #Course, Department, Instructor, Title & Description
|
28
|
+
:exp_course_list=>["ENGL103"]
|
29
|
+
}
|
30
|
+
options = defaults.merge(opts)
|
31
|
+
set_options(options)
|
32
|
+
end
|
33
|
+
|
34
|
+
def display
|
35
|
+
on DisplayScheduleOfClasses do |page|
|
36
|
+
page.term.select @term
|
37
|
+
page.select_type_of_search(@type_of_search)
|
38
|
+
case @type_of_search
|
39
|
+
when "Course" then page.course_search_parm.set @course_search_parm
|
40
|
+
when "Instructor" then instructor_lookup(@instructor_principal_name)
|
41
|
+
when "Department" then department_lookup(@department_short_name)
|
42
|
+
when "Title & Description" then page.title_description_search_parm.set @keyword
|
43
|
+
else raise "ScheduleOfClasses - search type not recognized"
|
44
|
+
end
|
45
|
+
|
46
|
+
page.show
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def department_lookup(short_name)
|
51
|
+
on DisplayScheduleOfClasses do |page|
|
52
|
+
page.department_search_lookup
|
53
|
+
end
|
54
|
+
on DepartmentLookup do |page|
|
55
|
+
page.short_name.set(short_name)
|
56
|
+
page.search
|
57
|
+
page.return_value(short_name)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def instructor_lookup(principal_name)
|
62
|
+
on DisplayScheduleOfClasses do |page|
|
63
|
+
page.instructor_search_lookup
|
64
|
+
end
|
65
|
+
on PersonnelLookup do |page|
|
66
|
+
page.principal_name.set(principal_name)
|
67
|
+
page.search
|
68
|
+
@instructor_long_name = page.get_long_name(principal_name)
|
69
|
+
page.return_value(principal_name)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def check_results_for_subject_code_match(subject_code)
|
74
|
+
on DisplayScheduleOfClasses do |page|
|
75
|
+
page.get_results_course_list.each do |course_code|
|
76
|
+
raise "correct subject prefix not found for #{course_code}" unless course_code.match /^#{subject_code}/
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def check_expected_results
|
82
|
+
on DisplayScheduleOfClasses do |page|
|
83
|
+
@exp_course_list.each do |course_code|
|
84
|
+
raise "correct course not found" unless page.target_course_row(course_code).exists?
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def expand_course_details
|
90
|
+
on DisplayScheduleOfClasses do |page|
|
91
|
+
page.course_expand(@exp_course_list[0])
|
92
|
+
raise "error expanding course details for #{@exp_course_list[0]}" unless page.course_ao_information_table(@exp_course_list[0]).exists?
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def expand_all_course_details
|
97
|
+
on DisplayScheduleOfClasses do |page|
|
98
|
+
list_of_courses = page.get_results_course_list()
|
99
|
+
page.get_results_course_list().each do |course|
|
100
|
+
page.course_expand(course)
|
101
|
+
if !page.course_ao_information_table(course).exists?
|
102
|
+
puts "error expanding course details for #{course}"
|
103
|
+
#need to re-login after stacktrace
|
104
|
+
log_in "admin", "admin"
|
105
|
+
go_to_display_schedule_of_classes
|
106
|
+
display
|
107
|
+
else
|
108
|
+
page.course_expand(course) #collapses
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
|
115
|
+
def check_results_for_instructor
|
116
|
+
course_list = []
|
117
|
+
on DisplayScheduleOfClasses do |page|
|
118
|
+
course_list = page.get_results_course_list
|
119
|
+
course_list.each do |course_code|
|
120
|
+
page.course_expand(course_code)
|
121
|
+
raise "error expanding course details for #{course_code}" unless page.course_ao_information_table(course_code).exists?
|
122
|
+
instructor_list = page.get_instructor_list(course_code)
|
123
|
+
raise "data validation issues: instructor #{@instructor_long_name} not found for course: #{course_code}" unless instructor_list.include?(@instructor_long_name)
|
124
|
+
page.course_expand(course_code) #closes details
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class BasePage < PageFactory
|
2
|
+
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def wrapper_elements
|
6
|
+
crucial_element(:main_menu_el) { |b| b.link(title: "Main Menu") }
|
7
|
+
crucial_element(:logout_el) { |b| b.button(value: "Logout") }
|
8
|
+
crucial_element(:administration_el) { |b| b.link(title: "Administration") }
|
9
|
+
|
10
|
+
action(:home) { |b| b.link(text: "Home").click }
|
11
|
+
action(:main_menu) { |p| p.main_menu_el.click }
|
12
|
+
action(:provide_feedback) { |b| b.link(title: "Provide Feedback").click }
|
13
|
+
action(:administration) { |p| p.administration_el.click }
|
14
|
+
action(:action_list) { |b| b.link(title: "Action List").click }
|
15
|
+
action(:doc_search) { |b| b.link(title: "Document Search").click }
|
16
|
+
|
17
|
+
value(:build) { |b| b.div(id: "build").text }
|
18
|
+
value(:logged_in_user) { |b| b.div(id: "login-info").text[/(?<=:.).*$/] }
|
19
|
+
|
20
|
+
value(:copyright) { |b| b.div(id: "footer-copyright").text }
|
21
|
+
action(:acknowledgements) { |b| b.link(href: "acknowledgments.jsp").click }
|
22
|
+
|
23
|
+
element(:loading) { |b| b.image(alt: "Loading...") }
|
24
|
+
end
|
25
|
+
|
26
|
+
def frame_element
|
27
|
+
#crucial_element(:frm) { |b| b.frame(id: "iframeportlet") }
|
28
|
+
crucial_element(:frm) { |b| b } #with iframe removed
|
29
|
+
end
|
30
|
+
|
31
|
+
def green_search_buttons
|
32
|
+
action(:search) { |b| b.frm.button(text: "Search").click; b.loading.wait_while_present } # Persistent ID needed!
|
33
|
+
action(:clear_values) { |b| b.frm.button(text: "Clear Values").click; b.loading.wait_while_present } # Persistent ID needed!
|
34
|
+
action(:cancel) { |b| b.frm.button(text: "Cancel").click; b.loading.wait_while_present } # Persistent ID needed!
|
35
|
+
action(:close) { |b| b.frm.button(text: "Close").click; b.loading.wait_while_present } # Persistent ID needed!
|
36
|
+
end
|
37
|
+
|
38
|
+
def validation_elements
|
39
|
+
value(:error_header) { |b| b.frm.h3(id: "pageValidationHeader").text }
|
40
|
+
value(:info_header) { |b| b.frm.h3(id: "pageValidationHeader").text }
|
41
|
+
element(:error_list) { |b| b.frm.ul(id: "pageValidationList") }
|
42
|
+
element(:info_list) { |b| b.frm.ul(id: "pageValidationList") }
|
43
|
+
value(:first_error) { |b| b.error_list.link.text }
|
44
|
+
value(:first_msg) { |b| b.info_list.li.text }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class ActivePopulationLookup < PopulationsBase
|
2
|
+
|
3
|
+
expected_element :keyword
|
4
|
+
|
5
|
+
def frm
|
6
|
+
self.frame(class: "fancybox-iframe")
|
7
|
+
end
|
8
|
+
|
9
|
+
include PopulationsSearch
|
10
|
+
|
11
|
+
population_lookup_elements
|
12
|
+
green_search_buttons
|
13
|
+
element(:paginate_links_span) { |b| b.frm.div(class: "dataTables_paginate paging_full_numbers").span() }
|
14
|
+
element(:no_of_pages_info_div) { |b| b.frm.div(class: "dataTables_info") }
|
15
|
+
value(:no_of_entries) { |b| b.no_of_pages_info_div.text[/\d+(?=.ent)/] }
|
16
|
+
|
17
|
+
|
18
|
+
def change_results_page(page_number)
|
19
|
+
results_table.wait_until_present
|
20
|
+
paginate_links_span.link(text: "#{page_number}").click
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class ActivityOfferingInquiry < BasePage
|
2
|
+
|
3
|
+
def frm
|
4
|
+
self.frame(class: "fancybox-iframe")
|
5
|
+
end
|
6
|
+
|
7
|
+
action(:close) { |b| b.frm.button(text: "Close").click; b.loading.wait_while_present }
|
8
|
+
|
9
|
+
value(:course_offering_code) { |b| b.frm.span(id: "u14").text } # Persistent ID needed!
|
10
|
+
value(:activity_code) { |b| b.frm.span(id: "u23").text } # Persistent ID needed!
|
11
|
+
value(:course_offering_title) { |b| b.frm.span(id: "u32").text } # Persistent ID needed!
|
12
|
+
value(:term) { |b| b.frm.span(id: "u41").text } # Persistent ID needed!
|
13
|
+
value(:type) { |b| b.frm.span(id: "u50").text } # Persistent ID needed!
|
14
|
+
value(:format_offering) { |b| b.frm.span(id: "u59").text } # Persistent ID needed!
|
15
|
+
value(:total_maximum_enrollment) { |b| b.frm.span(id: "u68").text } # Persistent ID needed!
|
16
|
+
value(:state) { |b| b.frm.span(id: "u77").text } # Persistent ID needed!
|
17
|
+
value(:requires_evaluation) { |b| b.frm.span(id: "u86").text } # Persistent ID needed!
|
18
|
+
value(:honors_offering) { |b| b.frm.span(id: "u95").text } # Persistent ID needed!
|
19
|
+
value(:activity_offering_url) { |b| b.frm.span(id: "u104").text } # Persistent ID needed!
|
20
|
+
value(:affiliated_personnel) { |b| b.frm.span(id: "u114").text } # Persistent ID needed!
|
21
|
+
value(:maximum_enrollment) { |b| b.frm.span(id: "u123").text } # Persistent ID needed!
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
class ActivityOfferingMaintenance < ActivityOfferingMaintenanceBase
|
2
|
+
|
3
|
+
expected_element :activity_code
|
4
|
+
|
5
|
+
action(:submit) { |b| b.frm.button(text: "submit").click; b.loading.wait_while_present }
|
6
|
+
|
7
|
+
element(:activity_code) { |b| b.frm.text_field(name: "document.newMaintainableObject.dataObject.aoInfo.activityCode") }
|
8
|
+
element(:total_maximum_enrollment) { |b| b.frm.text_field(id: "maximumEnrollment_control") }
|
9
|
+
|
10
|
+
PERS_ACTION_COLUMN = 4
|
11
|
+
|
12
|
+
element(:add_person_id) { |b| b.personnel_table.rows[1].cells[ID_COLUMN].text_field() }
|
13
|
+
|
14
|
+
action(:lookup_person) { |b| b.personnel_table.rows[1].cells[ID_COLUMN].button().click; b.loading.wait_while_present }
|
15
|
+
element(:add_affiliation) { |b| b.personnel_table.rows[1].cells[AFFILIATION_COLUMN].select() }
|
16
|
+
element(:add_inst_effort) { |b| b.personnel_table.rows[1].cells[INST_EFFORT_COLUMN].text_field() }
|
17
|
+
action(:add_personnel) { |b| b.personnel_table.rows[1].cells[PERS_ACTION_COLUMN].button().click; b.loading.wait_while_present }
|
18
|
+
|
19
|
+
def get_inst_effort(id)
|
20
|
+
target_person_row(id).cells[INST_EFFORT_COLUMN].text_field.value
|
21
|
+
end
|
22
|
+
|
23
|
+
def update_affiliation(id, affiliation)
|
24
|
+
target_person_row(id).select affiliation
|
25
|
+
end
|
26
|
+
|
27
|
+
def update_inst_effort(id, effort)
|
28
|
+
target_person_row(id).text_field.set effort
|
29
|
+
end
|
30
|
+
|
31
|
+
def delete_id(id)
|
32
|
+
target_person_row(id).button.click
|
33
|
+
loading.wait_while_present
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
SEATS_ACTION_COLUMN = 5
|
38
|
+
|
39
|
+
#seat pool validation elements
|
40
|
+
element(:seatpool_error_list) { |b| b.seat_pools_div.ul(class: "uif-validationMessagesList") }
|
41
|
+
element(:seatpool_info_list) { |b| b.seat_pools_div.ul(class: "uif-validationMessagesList") }
|
42
|
+
value(:seatpool_first_msg) { |b| b.seatpool_info_list.li.text }
|
43
|
+
|
44
|
+
element(:add_pool_priority) { |b| b.seat_pools_table.rows[1].cells[PRIORITY_COLUMN].text_field() }
|
45
|
+
element(:add_pool_seats) { |b| b.seat_pools_table.rows[1].cells[SEATS_COLUMN].text_field() }
|
46
|
+
value(:add_pool_name) { |b| b.seat_pools_table.rows[1].cells[POP_NAME_COLUMN].text_field().text }
|
47
|
+
|
48
|
+
action(:lookup_population_name) { |b| b.seat_pools_table.button(title: "Search Field").click; b.loading.wait_while_present }
|
49
|
+
|
50
|
+
element(:add_pool_expiration_milestone) { |b| b.seat_pools_table.rows[1].cells[EXP_MILESTONE_COLUMN].select() }
|
51
|
+
|
52
|
+
action(:add_seat_pool) { |b| b.seat_pools_table.rows[1].cells[SEATS_ACTION_COLUMN].button().click; b.loading.wait_while_present }
|
53
|
+
|
54
|
+
def remove_seatpool(pop_name)
|
55
|
+
target_pool_row(pop_name).button(text: "remove").click
|
56
|
+
loading.wait_while_present
|
57
|
+
end
|
58
|
+
|
59
|
+
def update_priority(pop_name, priority)
|
60
|
+
target_pool_row(pop_name).text_field(name: /processingPriority/).set priority
|
61
|
+
end
|
62
|
+
|
63
|
+
def update_seats(pop_name, seats)
|
64
|
+
target_pool_row(pop_name).text_field(name: /seatLimit/).set seats
|
65
|
+
end
|
66
|
+
|
67
|
+
def update_expiration_milestone(pop_name, milestone)
|
68
|
+
target_pool_row(pop_name).cells[EXP_MILESTONE_COLUMN].select.select(milestone)
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_priority(pop_name)
|
72
|
+
target_pool_row(pop_name).cells[PRIORITY_COLUMN].text_field.value #cell is hard-coded, getting this value was very problematic
|
73
|
+
end
|
74
|
+
|
75
|
+
def get_seats(pop_name)
|
76
|
+
target_pool_row(pop_name).cells[SEATS_COLUMN].text_field.value #cell is hard-coded, getting this value was very problematic
|
77
|
+
end
|
78
|
+
|
79
|
+
def get_expiration_milestone(pop_name)
|
80
|
+
target_pool_row(pop_name).cells[EXP_MILESTONE_COLUMN].select.selected_options[0].text #cell is hard-coded, getting this value was very problematic
|
81
|
+
end
|
82
|
+
|
83
|
+
element(:course_url) { |b| b.frm.text_field(name: "document.newMaintainableObject.dataObject.aoInfo.activityOfferingURL") }
|
84
|
+
element(:requires_evaluation) { |b| b.frm.checkbox(name: "document.newMaintainableObject.dataObject.aoInfo.isEvaluated") }
|
85
|
+
element(:honors_flag) { |b| b.frm.checkbox(name: "document.newMaintainableObject.dataObject.aoInfo.isHonorsOffering") }
|
86
|
+
|
87
|
+
#validation error dialog
|
88
|
+
element(:validation_error_dialog_div) { |b| b.frm.div(class: "fancybox-wrap fancybox-desktop fancybox-type-html fancybox-opened") }
|
89
|
+
value(:validation_error_dialog_text) { |b| b.validation_error_dialog_div.div(index: 2).text }
|
90
|
+
action(:close_validation_error_dialog) { |b| b.validation_error_dialog_div.div(title: "Close").click}
|
91
|
+
#validation error dialog
|
92
|
+
|
93
|
+
end
|