sambal-kuali 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sambal-kuali (0.0.1)
|
5
|
+
test-factory (>= 0.0.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.2.7)
|
11
|
+
childprocess (0.3.1)
|
12
|
+
ffi (~> 1.0.6)
|
13
|
+
ffi (1.0.11)
|
14
|
+
libwebsocket (0.1.3)
|
15
|
+
addressable
|
16
|
+
multi_json (1.2.0)
|
17
|
+
rubyzip (0.9.7)
|
18
|
+
selenium-webdriver (2.25.0)
|
19
|
+
childprocess (>= 0.2.5)
|
20
|
+
libwebsocket (~> 0.1.3)
|
21
|
+
multi_json (~> 1.0)
|
22
|
+
rubyzip
|
23
|
+
test-factory (0.0.2)
|
24
|
+
watir-webdriver (>= 0.6.1)
|
25
|
+
watir-webdriver (0.6.1)
|
26
|
+
selenium-webdriver (>= 2.18.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
sambal-kuali!
|
33
|
+
test-factory
|
34
|
+
watir-webdriver
|
data/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Functional Automation testing for Kuali and Sakai
|
2
|
+
|
3
|
+
## Description:
|
4
|
+
|
5
|
+
This repository contains the following projects:
|
6
|
+
|
7
|
+
- Cucumber features and step definitions for testing Kuali Student
|
8
|
+
- The beginnings of a test API for the Kuali projects. This API is called "Sambal".
|
9
|
+
|
10
|
+
## APIs
|
11
|
+
|
12
|
+
The Sakai APIs are written in Ruby 1.9.2 using the Watir-webdriver and Page Object abstraction layer. There are test object classes which allow the test code to persist information about parallel objects created within the system under test
|
13
|
+
|
14
|
+
## Cucumber projects
|
15
|
+
|
16
|
+
You are of course welcome to use the APIs on their own to write your own test scripts using whatever framework you prefer. However, if you're interested in getting a fast start and either learning the API by example or leveraging work we've already done, you're welcome to grab our Cucumber projects.
|
17
|
+
|
18
|
+
Obviously, at the moment the Cucumber projects are in their infancy.
|
19
|
+
|
20
|
+
## Contribute
|
21
|
+
|
22
|
+
* Fork the project.
|
23
|
+
* Additional or bug-fixed Classes, Elements, or Methods should be demonstrated in accompanying tests. Pull requests that do not include test scripts that use the new code are less likely to be accepted.
|
24
|
+
* Make sure you provide RDoc comments for any new public method or page class you add. Remember, others will be using this code.
|
25
|
+
* Send a pull request. Bonus points for topic branches.
|
26
|
+
|
27
|
+
Copyright 2012 The Kuali Foundation
|
28
|
+
|
29
|
+
Licensed under the Educational Community License, Version 2.0 (the "License");
|
30
|
+
you may not use this file except in compliance with the License.
|
31
|
+
You may obtain a copy of the License at
|
32
|
+
|
33
|
+
http://www.osedu.org/licenses/ECL-2.0
|
34
|
+
|
35
|
+
Unless required by applicable law or agreed to in writing,
|
36
|
+
software distributed under the License is distributed on an "AS IS"
|
37
|
+
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
38
|
+
or implied. See the License for the specific language governing
|
39
|
+
permissions and limitations under the License.
|
40
|
+
|
@@ -0,0 +1,418 @@
|
|
1
|
+
class PopulationsBase < BasePage
|
2
|
+
|
3
|
+
wrapper_elements
|
4
|
+
element(:child_populations_table) { |b| b.frm.div(id: "populations_table").table() }
|
5
|
+
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def population_lookup_elements
|
9
|
+
element(:keyword) { |b| b.frm.text_field(name: "lookupCriteria[keyword]") }
|
10
|
+
element(:results_table) { |b| b.frm.div(id: "population_lookup").table(index: 0) }
|
11
|
+
|
12
|
+
element(:active) { |b| b.frm.radio(value: "kuali.population.population.state.active") }
|
13
|
+
element(:inactive) { |b| b.frm.radio(value: "kuali.population.population.state.inactive") }
|
14
|
+
element(:both) { |b| b.frm.radio(value: "both") }
|
15
|
+
end
|
16
|
+
|
17
|
+
def population_attribute_elements
|
18
|
+
element(:name) { |b| b.frm.text_field(name: "document.newMaintainableObject.dataObject.populationInfo.name") }
|
19
|
+
element(:description) { |b| b.frm.text_field(name: "document.newMaintainableObject.dataObject.populationInfo.descr.plain") }
|
20
|
+
element(:rule) { |b| b.frm.select(name: "document.newMaintainableObject.dataObject.populationRuleInfo.agendaIds[0]") }
|
21
|
+
element(:child_population) { |b| b.frm.text_field(name: "newCollectionLines['document.newMaintainableObject.dataObject.childPopulations'].name") }
|
22
|
+
element(:reference_population) { |b| b.frm.text_field(name: "document.newMaintainableObject.dataObject.referencePopulation.name") }
|
23
|
+
|
24
|
+
action(:lookup_population) { |b| b.frm.link(id: "lookup_searchPopulation_add").click; b.loading.wait_while_present }
|
25
|
+
action(:lookup_ref_population) { |b| b.frm.link(id: "lookup_searchRefPopulation").click; b.loading.wait_while_present }
|
26
|
+
action(:add) { |b| b.child_populations_table.button(text: "add").click; b.loading.wait_while_present; sleep 1.5 }
|
27
|
+
end
|
28
|
+
|
29
|
+
def population_view_elements
|
30
|
+
element(:name_label) {|b| b.frm.div(data_label: "Name").label }
|
31
|
+
value(:name) { |b| b.frm.div(data_label: "Name").span(index: 1).text }
|
32
|
+
value(:description) { |b| b.frm.div(data_label: "Description").span(index: 1).text }
|
33
|
+
value(:state) { |b| b.frm.div(data_label: "State").span(index: 1).text }
|
34
|
+
value(:rule) { |b| b.frm.div(data_label: "Rule").span(index: 2).text }
|
35
|
+
value(:operation) { |b| b.frm.div(data_label: "Operation").span(index: 2).text }
|
36
|
+
value(:reference_population) { |b| b.frm.div(data_label: "Reference Population").span(index: 1).text }
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
module PopulationsSearch
|
44
|
+
|
45
|
+
# Results Table Columns...
|
46
|
+
POPULATION_NAME = 1
|
47
|
+
POPULATION_DESCRIPTION = 2
|
48
|
+
POPULATION_TYPE = 3
|
49
|
+
POPULATION_STATE = 4
|
50
|
+
|
51
|
+
# Clicks the 'return value' link for the named row
|
52
|
+
def return_value(name)
|
53
|
+
target_row(name).wait_until_present
|
54
|
+
target_row(name).link(text: "return value").wait_until_present
|
55
|
+
begin
|
56
|
+
target_row(name).link(text: "return value").click
|
57
|
+
rescue Timeout::Error => e
|
58
|
+
puts "rescued target_row(name).link(text: return value).click"
|
59
|
+
end
|
60
|
+
loading.wait_while_present
|
61
|
+
end
|
62
|
+
|
63
|
+
# Clicks the 'edit' link for the named item in the results table
|
64
|
+
def edit(name)
|
65
|
+
target_row(name).wait_until_present
|
66
|
+
target_row(name).link(text: "edit").click
|
67
|
+
loading.wait_while_present
|
68
|
+
sleep 0.5 # Needed because the text doesn't immediately appear in the Populations field for some reason
|
69
|
+
end
|
70
|
+
|
71
|
+
# Clicks the link for the named item in the results table
|
72
|
+
def view(name)
|
73
|
+
target_row(name).wait_until_present
|
74
|
+
results_table.link(text: name).click
|
75
|
+
loading.wait_while_present
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns the status of the named item from the results
|
79
|
+
# table. Note that this method assumes that the specified
|
80
|
+
# item is actually listed in the results table.
|
81
|
+
def status(name)
|
82
|
+
target_row(name).wait_until_present
|
83
|
+
target_row(name)[POPULATION_STATE].text
|
84
|
+
end
|
85
|
+
|
86
|
+
# Returns an array containing the names of the items returned in the search
|
87
|
+
def results_list
|
88
|
+
names = []
|
89
|
+
results_table.wait_until_present
|
90
|
+
results_table.rows.each { |row| names << row[POPULATION_NAME].text }
|
91
|
+
names.delete_if { |name| name == "" }
|
92
|
+
names.delete_if { |name| name == "Name" }
|
93
|
+
names
|
94
|
+
end
|
95
|
+
alias results_names results_list
|
96
|
+
|
97
|
+
def results_descriptions
|
98
|
+
descriptions = []
|
99
|
+
results_table.wait_until_present
|
100
|
+
results_table.rows.each { |row| descriptions << row[POPULATION_DESCRIPTION].text }
|
101
|
+
descriptions.delete_if { |description| description == "" }
|
102
|
+
descriptions
|
103
|
+
end
|
104
|
+
|
105
|
+
def results_states
|
106
|
+
states = []
|
107
|
+
results_table.wait_until_present
|
108
|
+
results_table.rows.each { |row| states << row[POPULATION_STATE].text }
|
109
|
+
states.delete_if { |state| state == "" }
|
110
|
+
states.delete_if { |state| state == "State" }
|
111
|
+
states
|
112
|
+
end
|
113
|
+
|
114
|
+
private
|
115
|
+
|
116
|
+
def target_row(name)
|
117
|
+
results_table.row(text: /#{name}/)
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
module PopulationEdit
|
123
|
+
|
124
|
+
def child_populations
|
125
|
+
names = []
|
126
|
+
child_populations_table.divs(class: "uif-field").each { |div| names << div.text }
|
127
|
+
names.delete_if { |name| name == "" || name == "delete" || name == "add" }
|
128
|
+
end
|
129
|
+
|
130
|
+
def remove_population(name)
|
131
|
+
child_populations_table.row(text: /#{name}/).button(index: 0).click
|
132
|
+
loading.wait_while_present
|
133
|
+
wait_until { description.enabled? }
|
134
|
+
sleep 2 #FIXME - Needed because otherwise the automation causes an application error
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
class HoldBase < BasePage
|
140
|
+
|
141
|
+
class << self
|
142
|
+
def hold_elements
|
143
|
+
element(:hold_name) { |b| b.frm.text_field(name: "name") }
|
144
|
+
element(:category_name) { |b| b.frm.select(name: "typeKey") }
|
145
|
+
element(:phrase) { |b| b.frm.text_field(name: "descr") }
|
146
|
+
element(:owning_organization) { |b| b.frm.text_field(name: "id") }
|
147
|
+
action(:lookup_owning_org) { |b| b.frm.button(title:"Search Field").click; b.loading.wait_while_present }
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class OrganizationBase < BasePage
|
153
|
+
|
154
|
+
class << self
|
155
|
+
def organization_elements
|
156
|
+
element(:short_name) { |b| b.frm.text_field(name: "lookupCriteria[shortName]") }
|
157
|
+
element(:long_name) { |b| b.frm.text_field(name: "lookupCriteria[longName]") }
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
end
|
162
|
+
|
163
|
+
class HolidayBase < BasePage
|
164
|
+
|
165
|
+
element(:holiday_type) { |b| b.frm.select(name: "newCollectionLines['holidays'].typeKey") }
|
166
|
+
element(:holiday_start_date) { |b| b.frm.text_field(name: "newCollectionLines['holidays'].startDate") }
|
167
|
+
element(:holiday_start_time) { |b| b.frm.text_field(name: "newCollectionLines['holidays'].startTime") }
|
168
|
+
element(:holiday_start_meridian) { |b| b.frm.select(name: "newCollectionLines['holidays'].startTimeAmPm") }
|
169
|
+
element(:holiday_end_date) { |b| b.frm.text_field(name: "newCollectionLines['holidays'].endDate") }
|
170
|
+
element(:holiday_end_time) { |b| b.frm.text_field(name: "newCollectionLines['holidays'].endTime") }
|
171
|
+
element(:holiday_end_meridian) { |b| b.frm.select(name: "newCollectionLines['holidays'].endTimeAmPm") }
|
172
|
+
element(:all_day) { |b| b.frm.checkbox(name: "newCollectionLines['holidays'].allDay") }
|
173
|
+
element(:date_range) { |b| b.frm.checkbox(name: "newCollectionLines['holidays'].dateRange") }
|
174
|
+
element(:instructional) { |b| b.frm.checkbox(name: "newCollectionLines['holidays'].instructional") }
|
175
|
+
element(:add_button) { |b| b.frm.button(id: /u\d+_add/) }
|
176
|
+
|
177
|
+
element(:make_official_button) { |b| b.frm.button(text: "Make Official") }
|
178
|
+
|
179
|
+
action(:make_official) { |b| b.make_official_button.click; b.loading.wait_while_present }
|
180
|
+
action(:save) { |b| b.frm.button(text: "Save").click; b.loading.wait_while_present }
|
181
|
+
|
182
|
+
end
|
183
|
+
|
184
|
+
module Holidays
|
185
|
+
|
186
|
+
def add_all_day_holiday(type, date, inst=false)
|
187
|
+
wait_until { holiday_type.enabled? }
|
188
|
+
holiday_type.select type
|
189
|
+
holiday_start_date.set date
|
190
|
+
all_day.set unless all_day.set?
|
191
|
+
date_range.clear if date_range.set?
|
192
|
+
loading.wait_while_present
|
193
|
+
instruct(inst)
|
194
|
+
add_button.click
|
195
|
+
loading.wait_while_present
|
196
|
+
end
|
197
|
+
|
198
|
+
def add_date_range_holiday(type, start_date, end_date, inst=false)
|
199
|
+
wait_until { holiday_type.enabled? }
|
200
|
+
holiday_type.select type
|
201
|
+
holiday_start_date.set start_date
|
202
|
+
all_day.set unless all_day.set?
|
203
|
+
date_range.set unless date_range.set?
|
204
|
+
loading.wait_while_present
|
205
|
+
begin
|
206
|
+
wait_until { holiday_end_date.enabled? }
|
207
|
+
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
208
|
+
sleep 2
|
209
|
+
end
|
210
|
+
holiday_end_date.set end_date
|
211
|
+
instruct(inst)
|
212
|
+
add_button.click
|
213
|
+
loading.wait_while_present
|
214
|
+
end
|
215
|
+
|
216
|
+
def add_partial_day_holiday(type, start_date, start_time, start_meridian, end_time, end_meridian, inst=false)
|
217
|
+
wait_until { holiday_type.enabled? }
|
218
|
+
holiday_type.select type
|
219
|
+
holiday_start_date.set start_date
|
220
|
+
all_day.clear if all_day.set?
|
221
|
+
date_range.clear if date_range.set?
|
222
|
+
loading.wait_while_present
|
223
|
+
begin
|
224
|
+
wait_until { holiday_end_time.enabled? }
|
225
|
+
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
226
|
+
sleep 2
|
227
|
+
end
|
228
|
+
holiday_start_time.set start_time
|
229
|
+
holiday_start_meridian.select start_meridian
|
230
|
+
holiday_end_time.set end_time
|
231
|
+
holiday_end_meridian.select end_meridian
|
232
|
+
instruct(inst)
|
233
|
+
add_button.click
|
234
|
+
loading.wait_while_present
|
235
|
+
end
|
236
|
+
|
237
|
+
def add_partial_range_holiday(type, start_date, start_time, start_meridian, end_date, end_time, end_meridian, inst=false)
|
238
|
+
wait_until { holiday_type.enabled? }
|
239
|
+
holiday_type.select type
|
240
|
+
holiday_start_date.set start_date
|
241
|
+
all_day.clear if all_day.set?
|
242
|
+
date_range.set unless date_range.set?
|
243
|
+
loading.wait_while_present
|
244
|
+
begin
|
245
|
+
wait_until { holiday_end_date.enabled? }
|
246
|
+
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
247
|
+
sleep 2
|
248
|
+
end
|
249
|
+
holiday_start_time.set start_time
|
250
|
+
holiday_start_meridian.select start_meridian
|
251
|
+
holiday_end_date.set end_date
|
252
|
+
holiday_end_time.set end_time
|
253
|
+
holiday_end_meridian.select end_meridian
|
254
|
+
instruct(inst)
|
255
|
+
add_button.click
|
256
|
+
loading.wait_while_present
|
257
|
+
end
|
258
|
+
|
259
|
+
def delete_holiday(holiday_type)
|
260
|
+
target_row(holiday_type).button(text: "delete").click
|
261
|
+
loading.wait_while_present
|
262
|
+
end
|
263
|
+
|
264
|
+
def edit_start_date(holiday_type, date)
|
265
|
+
target_row(holiday_type).text_field(name: /startDate/).set date
|
266
|
+
end
|
267
|
+
|
268
|
+
def edit_start_time(holiday_type, time, meridian)
|
269
|
+
target_row(holiday_type).checkbox(name: /allDay/).clear if target_row(holiday_type).checkbox(name: /allDay/).set?
|
270
|
+
target_row(holiday_type).text_field(name: /startTime\d/).set time
|
271
|
+
target_row(holiday_type).text_field(name: /startTimeAmPm/).set meridian
|
272
|
+
end
|
273
|
+
|
274
|
+
def edit_end_time(holiday_type, time, meridian)
|
275
|
+
target_row(holiday_type).checkbox(name: /dateRange/).set unless target_row(holiday_type).checkbox(name: /dateRange/).set?
|
276
|
+
target_row(holiday_type).text_field(name: /endTime\d/).set time
|
277
|
+
target_row(holiday_type).text_field(name: /endTimeAmPm/).set meridian
|
278
|
+
end
|
279
|
+
|
280
|
+
def toggle_all_day(holiday_type)
|
281
|
+
if target_row(holiday_type).checkbox(name: /allDay/).set?
|
282
|
+
target_row(holiday_type).checkbox(name: /allDay/).clear
|
283
|
+
else
|
284
|
+
target_row(holiday_type).checkbox(name: /allDay/).set
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
def toggle_range(holiday_type)
|
289
|
+
if target_row(holiday_type).checkbox(name: /dateRange/).set?
|
290
|
+
target_row(holiday_type).checkbox(name: /dateRange/).clear
|
291
|
+
else
|
292
|
+
target_row(holiday_type).checkbox(name: /dateRange/).set
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
def toggle_instructional(holiday_type)
|
297
|
+
if target_row(holiday_type).checkbox(name: /instructional/).set?
|
298
|
+
target_row(holiday_type).checkbox(name: /instructional/).clear
|
299
|
+
else
|
300
|
+
target_row(holiday_type).checkbox(name: /instructional/).set
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
# Returns a random item from the list of holidays
|
305
|
+
def select_random_holiday
|
306
|
+
holidays = []
|
307
|
+
wait_until { holiday_type.enabled? }
|
308
|
+
sleep 5
|
309
|
+
holiday_type.options.each { |opt| holidays << opt.text }
|
310
|
+
holidays.delete_if { |item| item == "Select holiday type" }
|
311
|
+
holidays[rand(holidays.length)]
|
312
|
+
end
|
313
|
+
|
314
|
+
private
|
315
|
+
|
316
|
+
def target_row(holiday_type)
|
317
|
+
holiday_table.row(text: /#{Regexp.escape(holiday_type)}/)
|
318
|
+
end
|
319
|
+
|
320
|
+
def instruct(instr)
|
321
|
+
if instr
|
322
|
+
instructional.set
|
323
|
+
else
|
324
|
+
instructional.clear
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
end
|
329
|
+
|
330
|
+
class ActivityOfferingMaintenanceBase < BasePage
|
331
|
+
|
332
|
+
wrapper_elements
|
333
|
+
validation_elements
|
334
|
+
frame_element
|
335
|
+
|
336
|
+
element(:logistics_div_actual) { |b| b.frm.div(id: /^ActivityOffering-DeliveryLogistic.*-Actuals$/) }
|
337
|
+
action(:revise_logistics) { |b| b.logistics_div_actual.link(text: "Revise").click; b.loading.wait_while_present }
|
338
|
+
|
339
|
+
element(:actual_logistics_table) { |b| b.logistics_div_actual.table()}
|
340
|
+
|
341
|
+
TBA_COLUMN = 0
|
342
|
+
DAYS_COLUMN = 1
|
343
|
+
ST_TIME_COLUMN = 2
|
344
|
+
END_TIME_COLUMN = 3
|
345
|
+
FACILITY_COLUMN = 4
|
346
|
+
ROOM_COLUMN = 5
|
347
|
+
FEATURES_COLUMN = 6
|
348
|
+
|
349
|
+
def self.adl_table_accessor_maker(method_name, column)
|
350
|
+
define_method method_name.to_s do |row|
|
351
|
+
row.cells[column].text()
|
352
|
+
end
|
353
|
+
end
|
354
|
+
adl_table_accessor_maker :get_actual_logistics_tba, TBA_COLUMN
|
355
|
+
adl_table_accessor_maker :get_actual_logistics_days, DAYS_COLUMN
|
356
|
+
adl_table_accessor_maker :get_actual_logistics_start_time,ST_TIME_COLUMN
|
357
|
+
adl_table_accessor_maker :get_actual_logistics_end_time,END_TIME_COLUMN
|
358
|
+
adl_table_accessor_maker :get_actual_logistics_facility,FACILITY_COLUMN
|
359
|
+
adl_table_accessor_maker :get_actual_logistics_room,ROOM_COLUMN
|
360
|
+
adl_table_accessor_maker :get_actual_logistics_features,FEATURES_COLUMN
|
361
|
+
|
362
|
+
element(:logistics_div_requested) { |b| b.frm.div(id: "ActivityOffering-DeliveryLogistic-SchedulePage-Requested") }
|
363
|
+
element(:requested_logistics_table) { |b| b.logistics_div_requested.table()}
|
364
|
+
|
365
|
+
def self.rdl_table_accessor_maker(method_name, column)
|
366
|
+
define_method method_name.to_s do |row|
|
367
|
+
requested_logistics_table.rows[row].cells[column].text()
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
rdl_table_accessor_maker :get_requested_logistics_tba,TBA_COLUMN
|
372
|
+
rdl_table_accessor_maker :get_requested_logistics_days,DAYS_COLUMN
|
373
|
+
rdl_table_accessor_maker :get_requested_logistics_start_time,ST_TIME_COLUMN
|
374
|
+
rdl_table_accessor_maker :get_requested_logistics_end_time,END_TIME_COLUMN
|
375
|
+
rdl_table_accessor_maker :get_requested_logistics_facility,FACILITY_COLUMN
|
376
|
+
rdl_table_accessor_maker :get_requested_logistics_room,ROOM_COLUMN
|
377
|
+
rdl_table_accessor_maker :get_requested_logistics_features,FEATURES_COLUMN
|
378
|
+
|
379
|
+
element(:personnel_table) { |b| b.frm.div(id: "ao-personnelgroup").table() }
|
380
|
+
ID_COLUMN = 0
|
381
|
+
PERS_NAME_COLUMN = 1
|
382
|
+
AFFILIATION_COLUMN = 2
|
383
|
+
INST_EFFORT_COLUMN = 3
|
384
|
+
|
385
|
+
def get_affiliation(id)
|
386
|
+
target_person_row(id).cells[AFFILIATION_COLUMN].text
|
387
|
+
end
|
388
|
+
|
389
|
+
element(:seat_pools_div) { |b| b.frm.div(id: "ao-seatpoolgroup") }
|
390
|
+
element(:seat_pools_table) { |b| b.seat_pools_div.table() }
|
391
|
+
|
392
|
+
PRIORITY_COLUMN = 0
|
393
|
+
SEATS_COLUMN = 1
|
394
|
+
PERCENT_COLUMN = 2
|
395
|
+
POP_NAME_COLUMN = 3
|
396
|
+
EXP_MILESTONE_COLUMN = 4
|
397
|
+
|
398
|
+
def pool_percentage(pop_name)
|
399
|
+
target_pool_row(pop_name).div(id: /seatLimitPercent_line/).text
|
400
|
+
end
|
401
|
+
|
402
|
+
value(:seat_pool_count) { |b| b.frm.div(data_label: "Seat Pools").span(index: 2).text }
|
403
|
+
value(:seats_remaining_span) { |b| b.frm.div(id: "seatsRemaining").span(index: 2) }
|
404
|
+
value(:seats_remaining) { |b| b.seats_remaining_span.text }
|
405
|
+
value(:percent_seats_remaining) { |b| b.seats_remaining_span.text[/\d+(?=%)/] }
|
406
|
+
value(:seat_count_remaining) { |b| b.seats_remaining_span.text[/\d+(?=.S)/] }
|
407
|
+
value(:max_enrollment_count) { |b| b.frm.div(id: "seatsRemaining").text[/\d+(?=\))/] }
|
408
|
+
|
409
|
+
private
|
410
|
+
|
411
|
+
def target_person_row(id)
|
412
|
+
personnel_table.row(text: /#{Regexp.escape(id.to_s)}/)
|
413
|
+
end
|
414
|
+
|
415
|
+
def target_pool_row(pop_name)
|
416
|
+
seat_pools_table.row(text: /#{Regexp.escape(pop_name)}/)
|
417
|
+
end
|
418
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
class AcademicCalendar
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include DateFactory
|
6
|
+
include StringFactory
|
7
|
+
include Workflows
|
8
|
+
|
9
|
+
attr_accessor :name, :start_date, :end_date, :organization, :events,
|
10
|
+
:holidays, :terms
|
11
|
+
|
12
|
+
def initialize(browser, opts={})
|
13
|
+
@browser = browser
|
14
|
+
|
15
|
+
defaults = {
|
16
|
+
:name=>random_alphanums.strip,
|
17
|
+
:start_date=>"09/01/#{next_year}",
|
18
|
+
:end_date=>"06/25/#{next_year + 1}",
|
19
|
+
:organization=>"Registrar's Office"
|
20
|
+
}
|
21
|
+
options = defaults.merge(opts)
|
22
|
+
set_options(options)
|
23
|
+
end
|
24
|
+
|
25
|
+
def create
|
26
|
+
go_to_academic_calendar
|
27
|
+
on CreateAcadCalendar do |page|
|
28
|
+
page.start_blank_calendar
|
29
|
+
end
|
30
|
+
on EditAcademicCalendar do |page|
|
31
|
+
page.academic_calendar_name.set @name
|
32
|
+
page.organization.select @organization
|
33
|
+
page.calendar_start_date.set @start_date
|
34
|
+
page.calendar_end_date.set @end_date
|
35
|
+
page.save
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def copy_from(name)
|
40
|
+
go_to_academic_calendar
|
41
|
+
if right_source? name
|
42
|
+
on CreateAcadCalendar do |page|
|
43
|
+
page.name.set @name
|
44
|
+
page.start_date.set @start_date
|
45
|
+
page.end_date.set @end_date
|
46
|
+
end
|
47
|
+
else
|
48
|
+
on CreateAcadCalendar do |page|
|
49
|
+
page.choose_different_calendar
|
50
|
+
end
|
51
|
+
on CalendarSearch do |page|
|
52
|
+
page.search_for "Academic Calendar", name
|
53
|
+
page.copy name
|
54
|
+
end
|
55
|
+
on EditAcademicCalendar do |page|
|
56
|
+
page.academic_calendar_name.set @name
|
57
|
+
page.organization.select @organization
|
58
|
+
page.calendar_start_date.set @start_date
|
59
|
+
page.calendar_end_date.set @end_date
|
60
|
+
end
|
61
|
+
end
|
62
|
+
on EditAcademicCalendar do |page|
|
63
|
+
page.save
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def search
|
68
|
+
go_to_calendar_search
|
69
|
+
on CalendarSearch do |page|
|
70
|
+
page.search_for "Academic Calendar", @name
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def right_source?(name)
|
75
|
+
on CreateAcadCalendar do |page|
|
76
|
+
if page.source_name == name
|
77
|
+
return true
|
78
|
+
else
|
79
|
+
return false
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def make_official
|
85
|
+
on EditAcademicCalendar do |page|
|
86
|
+
page.make_official
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|