kuality-coeus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +16 -18
- data/chromedriver.log +46 -0
- data/features/grants_gov/grants_gov_forms/code_and_form_mapping.feature +26 -0
- data/features/grants_gov/grants_gov_forms/forms_validation.feature +1 -0
- data/features/grants_gov/grants_gov_forms/s2s_questionnaire.feature +19 -0
- data/features/grants_gov/s2s_submission.feature +30 -0
- data/features/grants_gov/s2s_validation.feature +36 -0
- data/features/proposal_development/create_budget_versions.feature +31 -0
- data/features/proposal_development/create_proposal.feature +25 -0
- data/features/proposal_development/key_personnel_validations.feature +41 -0
- data/features/proposal_development/proposal_actions_validations.feature +46 -0
- data/features/proposal_development/proposal_permissions.feature +73 -0
- data/features/proposal_development/proposal_workflow.feature +105 -0
- data/features/proposal_development/special_review_validations.feature +12 -0
- data/features/step_definitions/action_list.rb +12 -0
- data/features/step_definitions/awards/create_award.rb +3 -0
- data/features/step_definitions/grants_gov/forms.rb +34 -0
- data/features/step_definitions/grants_gov/s2s_submission.rb +51 -0
- data/features/step_definitions/institutional_proposals/create_institutional_proposal.rb +3 -0
- data/features/step_definitions/proposal_development/budget_versions.rb +102 -0
- data/features/step_definitions/proposal_development/create_proposal.rb +157 -0
- data/features/step_definitions/proposal_development/edit_proposal.rb +79 -0
- data/features/step_definitions/proposal_development/institute_rates.rb +21 -0
- data/features/step_definitions/proposal_development/key_personnel_validations.rb +74 -0
- data/features/step_definitions/proposal_development/proposal_actions_validations.rb +73 -0
- data/features/step_definitions/proposal_development/proposal_permissions.rb +141 -0
- data/features/step_definitions/proposal_development/proposal_workflow.rb +81 -0
- data/features/step_definitions/proposal_development/s2s_validation.rb +30 -0
- data/features/step_definitions/proposal_development/special_review_validations.rb +7 -0
- data/features/step_definitions/test.rb +3 -0
- data/features/step_definitions/users.rb +65 -0
- data/features/support/env.rb +35 -0
- data/features/test.feature +13 -0
- data/kuality-coeus.gemspec +1 -1
- data/lib/chromedriver.log +4483 -0
- data/lib/kuality-coeus.rb +5 -2
- data/lib/kuality-coeus/core_extensions.rb +10 -0
- data/lib/kuality-coeus/data_objects/award/award.rb +126 -0
- data/lib/kuality-coeus/data_objects/award/award_transaction.rb +57 -0
- data/lib/kuality-coeus/data_objects/budget/budget_periods.rb +114 -0
- data/lib/kuality-coeus/data_objects/budget/budget_versions.rb +221 -0
- data/lib/kuality-coeus/data_objects/budget/subaward_budget.rb +65 -0
- data/lib/kuality-coeus/data_objects/committee_document/committee_document.rb +65 -0
- data/lib/kuality-coeus/data_objects/committee_document/committee_members.rb +30 -0
- data/lib/kuality-coeus/data_objects/committee_document/committee_schedule.rb +27 -0
- data/lib/kuality-coeus/data_objects/committee_document/member_roles.rb +28 -0
- data/lib/kuality-coeus/data_objects/conflict_of_interest/financial_entity.rb +48 -0
- data/lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb +90 -0
- data/lib/kuality-coeus/data_objects/grants_gov/phs_training_budget_questionnaire.rb +5 -0
- data/lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb +20 -0
- data/lib/kuality-coeus/data_objects/institutional_proposal/intellectual_property_review.rb +62 -0
- data/lib/kuality-coeus/data_objects/navigation.rb +64 -0
- data/lib/kuality-coeus/data_objects/proposal_development/compliance_questions.rb +47 -0
- data/lib/kuality-coeus/data_objects/proposal_development/custom_data.rb +41 -0
- data/lib/kuality-coeus/data_objects/proposal_development/degrees.rb +40 -0
- data/lib/kuality-coeus/data_objects/proposal_development/key_personnel.rb +299 -0
- data/lib/kuality-coeus/data_objects/proposal_development/kuali_university_questions.rb +58 -0
- data/lib/kuality-coeus/data_objects/proposal_development/permissions.rb +107 -0
- data/lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.rb +46 -0
- data/lib/kuality-coeus/data_objects/proposal_development/proposal_attachments.rb +41 -0
- data/lib/kuality-coeus/data_objects/proposal_development/proposal_development.rb +301 -0
- data/lib/kuality-coeus/data_objects/proposal_development/proposal_questions.rb +52 -0
- data/lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb +129 -0
- data/lib/kuality-coeus/data_objects/proposal_development/special_review.rb +79 -0
- data/lib/kuality-coeus/data_objects/rates/institute_rate.rb +209 -0
- data/lib/kuality-coeus/data_objects/user.rb +303 -33
- data/lib/kuality-coeus/gem_extensions.rb +26 -0
- data/lib/kuality-coeus/page_objects/000_base_page.rb +196 -14
- data/lib/kuality-coeus/page_objects/action_list.rb +32 -0
- data/lib/kuality-coeus/page_objects/award/award.rb +25 -0
- data/lib/kuality-coeus/page_objects/award/award_actions.rb +7 -0
- data/lib/kuality-coeus/page_objects/award/award_budget_versions.rb +9 -0
- data/lib/kuality-coeus/page_objects/award/commitments.rb +27 -0
- data/lib/kuality-coeus/page_objects/award/contacts.rb +19 -0
- data/lib/kuality-coeus/page_objects/award/custom_data.rb +6 -0
- data/lib/kuality-coeus/page_objects/award/payment_reports_terms.rb +26 -0
- data/lib/kuality-coeus/page_objects/award/special_review.rb +7 -0
- data/lib/kuality-coeus/page_objects/award/time_and_money.rb +36 -0
- data/lib/kuality-coeus/page_objects/budget/budget_actions.rb +31 -0
- data/lib/kuality-coeus/page_objects/budget/budget_versions.rb +13 -0
- data/lib/kuality-coeus/page_objects/budget/modular_budget.rb +16 -0
- data/lib/kuality-coeus/page_objects/budget/non-personnel.rb +11 -0
- data/lib/kuality-coeus/page_objects/budget/parameters.rb +65 -0
- data/lib/kuality-coeus/page_objects/budget/personnel.rb +56 -0
- data/lib/kuality-coeus/page_objects/budget/rates.rb +7 -0
- data/lib/kuality-coeus/page_objects/budget/summary.rb +5 -0
- data/lib/kuality-coeus/page_objects/budget_document.rb +19 -0
- data/lib/kuality-coeus/page_objects/central_admin.rb +4 -2
- data/lib/kuality-coeus/page_objects/committee/committee.rb +10 -10
- data/lib/kuality-coeus/page_objects/committee/members.rb +4 -4
- data/lib/kuality-coeus/page_objects/committee_document.rb +1 -6
- data/lib/kuality-coeus/page_objects/confirmation.rb +16 -0
- data/lib/kuality-coeus/page_objects/disclosure/disclosure.rb +56 -0
- data/lib/kuality-coeus/page_objects/disclosure/disclosure_actions.rb +9 -0
- data/lib/kuality-coeus/page_objects/document_header.rb +5 -0
- data/lib/kuality-coeus/page_objects/financial_entities.rb +1 -4
- data/lib/kuality-coeus/page_objects/financial_entities/my_financial_entities.rb +6 -0
- data/lib/kuality-coeus/page_objects/financial_entities/new_financial_entity.rb +11 -0
- data/lib/kuality-coeus/page_objects/financial_entities/reporter.rb +5 -3
- data/lib/kuality-coeus/page_objects/identity/person.rb +57 -0
- data/lib/kuality-coeus/page_objects/institute_rates_maintenance.rb +18 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal.rb +18 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/contacts.rb +32 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/custom_data.rb +6 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/distribution.rb +20 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/institutional_proposal.rb +27 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/institutional_proposal_actions.rb +7 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/intellectual_property_review.rb +20 -0
- data/lib/kuality-coeus/page_objects/institutional_proposal/special_review.rb +6 -0
- data/lib/kuality-coeus/page_objects/kc_awards.rb +48 -0
- data/lib/kuality-coeus/page_objects/kc_protocol.rb +15 -0
- data/lib/kuality-coeus/page_objects/login.rb +4 -5
- data/lib/kuality-coeus/page_objects/lookup_pages/000_lookups.rb +10 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/action_list_filter.rb +6 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/address_book_lookup.rb +4 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/development_proposal_lookup.rb +3 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/document_search.rb +10 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/group_lookup.rb +3 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/institute_rates_lookup.rb +12 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/opportunity_lookup.rb +6 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/organization_lookup.rb +5 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/person_extended_attributes.rb +5 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/person_lookup.rb +10 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/role_lookup.rb +6 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/sponsor_lookup.rb +9 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/unit_admin_lookup.rb +3 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/unit_lookup.rb +3 -0
- data/lib/kuality-coeus/page_objects/maintenance.rb +7 -0
- data/lib/kuality-coeus/page_objects/notification_editor.rb +6 -0
- data/lib/kuality-coeus/page_objects/proposal_development.rb +7 -2
- data/lib/kuality-coeus/page_objects/proposal_development/abstracts_and_attachments.rb +54 -0
- data/lib/kuality-coeus/page_objects/proposal_development/key_personnel.rb +126 -0
- data/lib/kuality-coeus/page_objects/proposal_development/pd_custom_data.rb +6 -0
- data/lib/kuality-coeus/page_objects/proposal_development/permissions.rb +44 -0
- data/lib/kuality-coeus/page_objects/proposal_development/phs_fellowship_questionnaire.rb +44 -0
- data/lib/kuality-coeus/page_objects/proposal_development/phs_training_budget_questionnaire.rb +50 -0
- data/lib/kuality-coeus/page_objects/proposal_development/proposal.rb +47 -8
- data/lib/kuality-coeus/page_objects/proposal_development/proposal_actions.rb +62 -0
- data/lib/kuality-coeus/page_objects/proposal_development/proposal_summary.rb +9 -0
- data/lib/kuality-coeus/page_objects/proposal_development/questions.rb +111 -0
- data/lib/kuality-coeus/page_objects/proposal_development/s2s.rb +35 -0
- data/lib/kuality-coeus/page_objects/proposal_development/special_review.rb +6 -0
- data/lib/kuality-coeus/page_objects/protocol/custom_data.rb +6 -0
- data/lib/kuality-coeus/page_objects/protocol/permissions.rb +5 -0
- data/lib/kuality-coeus/page_objects/protocol/personnel.rb +5 -0
- data/lib/kuality-coeus/page_objects/protocol/protocol.rb +11 -0
- data/lib/kuality-coeus/page_objects/protocol/questionnaire.rb +5 -0
- data/lib/kuality-coeus/page_objects/protocol/special_review.rb +6 -0
- data/lib/kuality-coeus/page_objects/rejection_confirmation.rb +5 -0
- data/lib/kuality-coeus/page_objects/researcher.rb +4 -2
- data/lib/kuality-coeus/page_objects/shared/unit_administrator.rb +13 -0
- data/lib/kuality-coeus/page_objects/system/person_extended_attributes.rb +18 -0
- data/lib/kuality-coeus/page_objects/system_admin.rb +7 -0
- data/lib/kuality-coeus/page_objects/unit.rb +2 -4
- data/lib/kuality-coeus/utilities.rb +39 -0
- data/libpeerconnection.log +0 -0
- metadata +140 -5
- data/lib/kuality-coeus/data_objects/committee_document.rb +0 -65
- data/lib/kuality-coeus/data_objects/proposal_development.rb +0 -53
- data/lib/kuality-coeus/navigation.rb +0 -3
@@ -0,0 +1,52 @@
|
|
1
|
+
class ProposalQuestionsObject
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include StringFactory
|
6
|
+
include DateFactory
|
7
|
+
include Navigation
|
8
|
+
|
9
|
+
attr_accessor :document_id, :agree_to_nih_policy, :policy_review_date
|
10
|
+
|
11
|
+
def initialize(browser, opts={})
|
12
|
+
@browser = browser
|
13
|
+
|
14
|
+
# PLEASE NOTE:
|
15
|
+
# This is a unique data object class in that
|
16
|
+
# it breaks the typical model for radio button
|
17
|
+
# methods and their associated class instance variables
|
18
|
+
#
|
19
|
+
# In general, it's not workable to set up radio button elements
|
20
|
+
# to use "Y" and "N" as the instance variables associated with them.
|
21
|
+
defaults = {
|
22
|
+
agree_to_nih_policy: 'Y',
|
23
|
+
policy_review_date: right_now[:date_w_slashes]
|
24
|
+
}
|
25
|
+
|
26
|
+
set_options(defaults.merge(opts))
|
27
|
+
requires :document_id
|
28
|
+
end
|
29
|
+
|
30
|
+
def create
|
31
|
+
navigate
|
32
|
+
on Questions do |pq|
|
33
|
+
pq.show_proposal_questions
|
34
|
+
fill_out pq, :agree_to_nih_policy, :policy_review_date
|
35
|
+
#pq.agree_to_nih_policy @agree_to_nih_policy
|
36
|
+
#pq.policy_review_date.set @policy_review_date
|
37
|
+
pq.save
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# =======
|
42
|
+
private
|
43
|
+
# =======
|
44
|
+
|
45
|
+
# Nav Aids...
|
46
|
+
|
47
|
+
def navigate
|
48
|
+
open_document @doc_type
|
49
|
+
on(Proposal).questions unless on_page?(on(Questions).questions_header)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
class S2SQuestionnaireObject
|
2
|
+
|
3
|
+
# Convenient gathering of all Yes/No questions. Makes it possible to
|
4
|
+
# do simple iterations through them.
|
5
|
+
YN_QUESTIONS = [:civil_service, :total_ftes, :potential_effects, :international_support,
|
6
|
+
:pi_in_govt, :pi_foreign_employee, :change_in_pi, :change_in_institution,
|
7
|
+
:renewal_application, :inventions_conceived, :previously_reported,
|
8
|
+
:disclose_title, :clinical_trial, :phase_3_trial, :human_stem_cells,
|
9
|
+
:specific_cell_line, :pi_new_investigator, :proprietary_info,
|
10
|
+
:environmental_impact, :authorized_exemption, :site_historic,
|
11
|
+
:international_activities, :other_agencies, :subject_to_review,
|
12
|
+
:novice_applicants]
|
13
|
+
|
14
|
+
include Foundry
|
15
|
+
include DataFactory
|
16
|
+
include StringFactory
|
17
|
+
include Navigation
|
18
|
+
include Utilities
|
19
|
+
|
20
|
+
attr_accessor :document_id, :civil_service, :total_ftes, :potential_effects, :explain_potential_effects,
|
21
|
+
:international_support, :explain_support, :pi_in_govt, :pis_us_govt_agency, :total_amount_requested,
|
22
|
+
:pi_foreign_employee, :change_in_pi, :former_pi, :change_in_institution, :former_institution,
|
23
|
+
:renewal_application, :inventions_conceived, :previously_reported, :disclose_title,
|
24
|
+
:clinical_trial, :phase_3_trial, :human_stem_cells, :specific_cell_line,
|
25
|
+
:pi_new_investigator, :proprietary_info, :environmental_impact, :explain_environmental_impact,
|
26
|
+
:authorized_exemption, :explain_exemption, :site_historic, :explain_historic_designation,
|
27
|
+
:international_activities, :identify_countries, :explain_international_activities,
|
28
|
+
:other_agencies, :submitted_to_govt_agency, :application_date, :subject_to_review,
|
29
|
+
:novice_applicants, :program
|
30
|
+
# More instance variable definitions.
|
31
|
+
# These make instance variables such as:
|
32
|
+
# @year_2 (up to year 6)
|
33
|
+
# @support_provided_1 (up to 5)
|
34
|
+
# @fiscal_year_1 (up to 6)
|
35
|
+
# @ftes_for_fy_1 (up to 6)
|
36
|
+
# @stem_cell_line_1 (up to 20)
|
37
|
+
1.upto(20) do |x|
|
38
|
+
attr_accessor("year_#{x+1}".to_sym, "support_provided_#{x}".to_sym) if x < 6
|
39
|
+
attr_accessor("fiscal_year_#{x}".to_sym, "ftes_for_fy_#{x}".to_sym) if x < 7
|
40
|
+
attr_accessor("stem_cell_line_#{x}".to_sym)
|
41
|
+
end
|
42
|
+
|
43
|
+
def initialize(browser, opts={})
|
44
|
+
@browser = browser
|
45
|
+
|
46
|
+
# PLEASE NOTE:
|
47
|
+
# This is a unique data object class in that
|
48
|
+
# it breaks the typical model for radio button
|
49
|
+
# methods and their associated class instance variables
|
50
|
+
#
|
51
|
+
# In general, it's not workable to set up radio button elements
|
52
|
+
# to use "Y" and "N" as the instance variables associated with them.
|
53
|
+
defaults = {
|
54
|
+
civil_service: 'N',
|
55
|
+
potential_effects: 'N',
|
56
|
+
international_support: 'N',
|
57
|
+
pi_in_govt: 'N',
|
58
|
+
pi_foreign_employee: 'N',
|
59
|
+
change_in_pi: 'N',
|
60
|
+
change_in_institution: 'N',
|
61
|
+
renewal_application: 'N',
|
62
|
+
disclose_title: 'N',
|
63
|
+
clinical_trial: 'N',
|
64
|
+
human_stem_cells: 'N',
|
65
|
+
pi_new_investigator: 'N',
|
66
|
+
proprietary_info: 'N',
|
67
|
+
environmental_impact: 'N',
|
68
|
+
site_historic: 'N',
|
69
|
+
international_activities: 'N',
|
70
|
+
other_agencies: 'N',
|
71
|
+
subject_to_review: 'N',
|
72
|
+
program: 'Program not covered by EO 12372',
|
73
|
+
novice_applicants: 'X' # Note the X, here. That's for the "N/A" option.
|
74
|
+
}
|
75
|
+
|
76
|
+
set_options(defaults.merge(opts))
|
77
|
+
requires :document_id, :doc_type
|
78
|
+
end
|
79
|
+
|
80
|
+
def create
|
81
|
+
navigate
|
82
|
+
on Questions do |s2s|
|
83
|
+
s2s.expand_all
|
84
|
+
|
85
|
+
# Answers all of the Yes/No questions first (in random order)
|
86
|
+
YN_QUESTIONS.shuffle.each do |q|
|
87
|
+
var = get(q)
|
88
|
+
s2s.send(q, var) if var != nil && s2s.send("#{q}_element".to_sym, var).present?
|
89
|
+
end
|
90
|
+
|
91
|
+
# Next we answer the questions that are conditional, based on the above answers...
|
92
|
+
1.upto(6) do |n|
|
93
|
+
fy = "fiscal_year_#{n}"
|
94
|
+
s2s.send(fy).pick!(get(fy))
|
95
|
+
ftes = "ftes_for_fy_#{n}"
|
96
|
+
s2s.send(ftes).fit get(ftes)
|
97
|
+
yr = "year_#{n+1}"
|
98
|
+
var = get(yr)
|
99
|
+
s2s.send(yr, var) unless var==nil
|
100
|
+
end
|
101
|
+
1.upto(5) do |n|
|
102
|
+
sp = "support_provided_#{n}"
|
103
|
+
s2s.send(sp).pick! get(sp)
|
104
|
+
end
|
105
|
+
1.upto(20) do |n|
|
106
|
+
scl = "stem_cell_line_#{n}"
|
107
|
+
s2s.send(scl).fit get(scl)
|
108
|
+
end
|
109
|
+
fill_out s2s, :explain_potential_effects, :explain_support, :pis_us_govt_agency,
|
110
|
+
:total_amount_requested, :former_pi, :former_institution,
|
111
|
+
:explain_environmental_impact, :explain_exemption, :explain_historic_designation,
|
112
|
+
:identify_countries, :explain_international_activities, :submitted_to_govt_agency,
|
113
|
+
:application_date, :program
|
114
|
+
s2s.save
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# =======
|
119
|
+
private
|
120
|
+
# =======
|
121
|
+
|
122
|
+
# Nav Aids...
|
123
|
+
|
124
|
+
def navigate
|
125
|
+
open_document @doc_type
|
126
|
+
on(Proposal).questions unless on_page?(on(Questions).questions_header)
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
class SpecialReviewObject
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include StringFactory
|
6
|
+
include Navigation
|
7
|
+
|
8
|
+
attr_accessor :type, :approval_status, :document_id, :protocol_number,
|
9
|
+
:application_date, :approval_date, :expiration_date,
|
10
|
+
:exemption_number, :doc_type
|
11
|
+
|
12
|
+
def initialize(browser, opts={})
|
13
|
+
@browser = browser
|
14
|
+
|
15
|
+
defaults = {
|
16
|
+
type: '::random::',
|
17
|
+
approval_status: '::random::'
|
18
|
+
}
|
19
|
+
|
20
|
+
set_options(defaults.merge(opts))
|
21
|
+
requires :document_id, :doc_type
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
navigate
|
26
|
+
on SpecialReview do |add|
|
27
|
+
add.add_type.pick! @type
|
28
|
+
case(@type)
|
29
|
+
when 'Human Subjects'
|
30
|
+
@approval_status='Pending/In Progress'
|
31
|
+
else
|
32
|
+
add.add_approval_status.pick! @approval_status
|
33
|
+
end
|
34
|
+
add.add_protocol_number.fit @protocol_number
|
35
|
+
add.add_application_date.fit @application_date
|
36
|
+
add.add_approval_date.fit @approval_date
|
37
|
+
add.add_expiration_date.fit @expiration_date
|
38
|
+
add.add_exemption_number.fit @exemption_number
|
39
|
+
add.add
|
40
|
+
break if add.error_messages_div.present? # No need to save if we've thrown an error already
|
41
|
+
add.save
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def edit opts={}
|
46
|
+
# TODO
|
47
|
+
set_options(opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
# =======
|
51
|
+
private
|
52
|
+
# =======
|
53
|
+
|
54
|
+
def navigate
|
55
|
+
open_document @doc_type
|
56
|
+
on(Proposal).special_review unless on_page?(on(SpecialReview).type)
|
57
|
+
end
|
58
|
+
|
59
|
+
end # SpecialReviewObject
|
60
|
+
|
61
|
+
class SpecialReviewCollection < Array
|
62
|
+
|
63
|
+
def types
|
64
|
+
self.collect { |s_r| s_r.type }
|
65
|
+
end
|
66
|
+
|
67
|
+
def statuses
|
68
|
+
self.collect { |s_r| s_r.approval_status }
|
69
|
+
end
|
70
|
+
|
71
|
+
# A warning about this method:
|
72
|
+
# it's going to return the FIRST match in the collection,
|
73
|
+
# under the assumption that there won't be multiple
|
74
|
+
# Special Review items of the same type.
|
75
|
+
def type(srtype)
|
76
|
+
self.find { |s_r| s_r.type==srtype}
|
77
|
+
end
|
78
|
+
|
79
|
+
end # SpecialReviewCollection
|
@@ -0,0 +1,209 @@
|
|
1
|
+
class InstituteRateObject
|
2
|
+
|
3
|
+
include Foundry
|
4
|
+
include DataFactory
|
5
|
+
include StringFactory
|
6
|
+
include DateFactory
|
7
|
+
include Navigation
|
8
|
+
|
9
|
+
ACTIVITY_TYPES = {
|
10
|
+
# Description # Code
|
11
|
+
'Research' => '1',
|
12
|
+
'Instruction' => '2',
|
13
|
+
'Public Service' => '3',
|
14
|
+
'Clinical Trial' => '4',
|
15
|
+
'other' => '5',
|
16
|
+
'Fellowship - Pre-Doctoral' => '6',
|
17
|
+
'Fellowship - Post-Doctoral' => '7',
|
18
|
+
'Student Services' => '8',
|
19
|
+
'Construction' => '9'
|
20
|
+
}
|
21
|
+
|
22
|
+
RATE_CLASS_TYPES = {
|
23
|
+
'E' => 'Fringe Benefits',
|
24
|
+
'I' => 'Inflation',
|
25
|
+
'L' => 'Lab Allocation - Other',
|
26
|
+
'O' => 'F & A',
|
27
|
+
'V' => 'Vacation',
|
28
|
+
'X' => 'Other',
|
29
|
+
'Y' => 'Lab Allocation - Salaries'
|
30
|
+
}
|
31
|
+
|
32
|
+
RATE_CLASS_CODES = {
|
33
|
+
'MTDC' => '1',
|
34
|
+
'Lab Allocation - Salaries' => '10',
|
35
|
+
'Lab Allocation - M&S' => '11',
|
36
|
+
'Lab Allocation - Utilities' => '12',
|
37
|
+
'MTDC - AWARD' => '13',
|
38
|
+
'TDC' => '2',
|
39
|
+
'S&W' => '3',
|
40
|
+
'Fund with Transaction Fee (FUNSN)' => '4',
|
41
|
+
'Employee Benefits' => '5',
|
42
|
+
'Inflation' => '7',
|
43
|
+
'Vacation' => '8',
|
44
|
+
'Other' => '9'
|
45
|
+
}
|
46
|
+
|
47
|
+
RATE_TYPES = {
|
48
|
+
'MTDC'=>{class: '1', type: '1'},
|
49
|
+
'Lab Allocation - Salaries'=>{class: '10', type: '1'},
|
50
|
+
'Lab Allocation - M&S'=>{class: '11', type: '1'},
|
51
|
+
'Lab Allocation - Utilities'=>{class: '12', type: '1'},
|
52
|
+
'MTDC - Award'=>{class: '13', type: '1'},
|
53
|
+
'FUNSN'=>{class: '13', type: '10'},
|
54
|
+
'FUNNX'=>{class: '13', type: '11'},
|
55
|
+
'FUNSNX'=>{class: '13', type: '12'},
|
56
|
+
'FUNSAX'=>{class: '13', type: '13'},
|
57
|
+
'FUNNXF'=>{class: '13', type: '14'},
|
58
|
+
'FUNMNX'=>{class: '13', type: '15'},
|
59
|
+
'FUNMFX'=>{class: '13', type: '16'},
|
60
|
+
'SLNSN'=>{class: '13', type: '17'},
|
61
|
+
'SLNMN'=>{class: '13', type: '18'},
|
62
|
+
'SLNMF'=>{class: '13', type: '19'},
|
63
|
+
'TDC - DO NOT USE'=>{class: '13', type: '2'},
|
64
|
+
'GENSN'=>{class: '13', type: '20'},
|
65
|
+
'GENSNF'=>{class: '13', type: '21'},
|
66
|
+
'RESSN'=>{class: '13', type: '22'},
|
67
|
+
'FUNSAN'=>{class: '13', type: '23'},
|
68
|
+
'FUNFN'=>{class: '13', type: '24'},
|
69
|
+
'RESTDC'=>{class: '13', type: '25'},
|
70
|
+
'FUNTDC'=>{class: '13', type: '26'},
|
71
|
+
'RESTG'=>{class: '13', type: '27'},
|
72
|
+
'RESTDE'=>{class: '13', type: '28'},
|
73
|
+
'BIMN'=>{class: '13', type: '29'},
|
74
|
+
'Other'=>{class: '13', type: '3'},
|
75
|
+
'None'=>{class: '13', type: '4'},
|
76
|
+
'RESMN'=>{class: '13', type: '5'},
|
77
|
+
'RESMF'=>{class: '13', type: '6'},
|
78
|
+
'EXCLU'=>{class: '13', type: '7'},
|
79
|
+
'RESEB'=>{class: '13', type: '8'},
|
80
|
+
'RESMFF'=>{class: '13', type: '9'},
|
81
|
+
'TDC'=>{class: '2', type: '1'},
|
82
|
+
'S&W'=>{class: '3', type: '1'},
|
83
|
+
'Salaries'=>{class: '4', type: '1'},
|
84
|
+
'Materials and Services'=>{class: '4', type: '2'},
|
85
|
+
'Research Rate'=>{class: '5', type: '1'},
|
86
|
+
'UROP Rate'=>{class: '5', type: '2'},
|
87
|
+
'EB on LA'=>{class: '5', type: '3'},
|
88
|
+
'another EB rate'=>{class: '5', type: '4'},
|
89
|
+
'eb added in pb'=>{class: '5', type: '5'},
|
90
|
+
'Award Special EB Rate'=>{class: '5', type: '6'},
|
91
|
+
'Faculty Salaries (6/1)'=>{class: '7', type: '1'},
|
92
|
+
'Administrative Salaries (7/1)'=>{class: '7', type: '2'},
|
93
|
+
'Support Staff Salaries (4/1)'=>{class: '7', type: '3'},
|
94
|
+
'Materials and Services'=>{class: '7', type: '4'},
|
95
|
+
'Research Staff (1/1)'=>{class: '7', type: '5'},
|
96
|
+
'Students (6/1)'=>{class: '7', type: '6'},
|
97
|
+
'Vacation'=>{class: '8', type: '1'},
|
98
|
+
'Vacation on LA'=>{class: '8', type: '2'},
|
99
|
+
'Other'=>{class: '9', type: '1'}
|
100
|
+
}
|
101
|
+
|
102
|
+
attr_accessor :activity_type, :activity_type_code, :fiscal_year, :on_off_campus_flag,
|
103
|
+
:rate_type, :rate_class_code, :rate_type_code, :start_date, :unit_number,
|
104
|
+
:rate, :active, :description
|
105
|
+
|
106
|
+
def initialize(browser, opts={})
|
107
|
+
@browser = browser
|
108
|
+
|
109
|
+
defaults = {
|
110
|
+
description: random_alphanums,
|
111
|
+
fiscal_year: right_now[:year],
|
112
|
+
activity_type: 'Instruction',
|
113
|
+
on_off_campus_flag: :set,
|
114
|
+
rate_type: 'Salaries',
|
115
|
+
unit_number: '000001',
|
116
|
+
rate: "#{rand(9)+1}.#{rand(100)}",
|
117
|
+
active: :set
|
118
|
+
}
|
119
|
+
|
120
|
+
set_options(defaults.merge(opts))
|
121
|
+
@start_date ||= "01/01/#{@fiscal_year}"
|
122
|
+
@activity_type_code = ACTIVITY_TYPES[@activity_type]
|
123
|
+
@rate_class_code = RATE_TYPES[@rate_type][:class]
|
124
|
+
@rate_type_code = RATE_TYPES[@rate_type][:type]
|
125
|
+
end
|
126
|
+
|
127
|
+
def create
|
128
|
+
navigate
|
129
|
+
on(InstituteRatesLookup).create_new
|
130
|
+
on InstituteRatesMaintenance do |create|
|
131
|
+
fill_out create, :description, :activity_type_code, :fiscal_year,
|
132
|
+
:rate_class_code, :rate_type_code, :start_date, :unit_number,
|
133
|
+
:rate, :on_off_campus_flag, :active
|
134
|
+
create.blanket_approve
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
def exist?
|
139
|
+
navigate
|
140
|
+
search
|
141
|
+
if on(InstituteRatesLookup).results_table.present?
|
142
|
+
return true
|
143
|
+
else
|
144
|
+
return false
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# This method...
|
149
|
+
# - Breaks the CRUD model and the design pattern, but is necessary because of how the system
|
150
|
+
# restricts creation of rate records
|
151
|
+
# - Assumes it doesn't need to navigate because it's being used
|
152
|
+
# in very specific places
|
153
|
+
def get_current_rate
|
154
|
+
on(InstituteRatesLookup).edit_item "#{@activity_type}.#{@fiscal_year}.+#{@rate_type}"
|
155
|
+
@rate=on(InstituteRatesMaintenance).rate.value
|
156
|
+
end
|
157
|
+
|
158
|
+
# This method...
|
159
|
+
# - Breaks the CRUD model and the design pattern, but is necessary because of how the system
|
160
|
+
# restricts creation of rate records
|
161
|
+
# - Assumes it doesn't need to navigate because it's being used
|
162
|
+
# in very specific places
|
163
|
+
def activate
|
164
|
+
@active=:set
|
165
|
+
on InstituteRatesMaintenance do |edit|
|
166
|
+
edit.active.send(@active)
|
167
|
+
fill_out edit, :description
|
168
|
+
edit.blanket_approve
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def delete
|
173
|
+
navigate
|
174
|
+
search
|
175
|
+
on(InstituteRatesLookup).delete_item "#{@rate_type}"
|
176
|
+
on InstituteRatesMaintenance do |del|
|
177
|
+
del.description.set @description
|
178
|
+
del.blanket_approve
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
def search
|
183
|
+
on InstituteRatesLookup do |look|
|
184
|
+
fill_out look, :activity_type_code, :fiscal_year, :rate_class_code,
|
185
|
+
:rate_type_code, :unit_number
|
186
|
+
look.on_off_campus campus_lookup[@on_off_campus_flag]
|
187
|
+
look.active ''
|
188
|
+
look.search
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
# =========
|
193
|
+
private
|
194
|
+
# =========
|
195
|
+
|
196
|
+
def navigate
|
197
|
+
# TODO: Throw some conditional logic in here so that we don't navigate every time.
|
198
|
+
visit Maintenance do |page|
|
199
|
+
page.close_parents
|
200
|
+
page.institute_rate
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def campus_lookup
|
205
|
+
{ :set=>'Y', :clear=>'N' }
|
206
|
+
end
|
207
|
+
alias_method :active_lookup, :campus_lookup
|
208
|
+
|
209
|
+
end
|