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.
Files changed (161) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +16 -18
  3. data/chromedriver.log +46 -0
  4. data/features/grants_gov/grants_gov_forms/code_and_form_mapping.feature +26 -0
  5. data/features/grants_gov/grants_gov_forms/forms_validation.feature +1 -0
  6. data/features/grants_gov/grants_gov_forms/s2s_questionnaire.feature +19 -0
  7. data/features/grants_gov/s2s_submission.feature +30 -0
  8. data/features/grants_gov/s2s_validation.feature +36 -0
  9. data/features/proposal_development/create_budget_versions.feature +31 -0
  10. data/features/proposal_development/create_proposal.feature +25 -0
  11. data/features/proposal_development/key_personnel_validations.feature +41 -0
  12. data/features/proposal_development/proposal_actions_validations.feature +46 -0
  13. data/features/proposal_development/proposal_permissions.feature +73 -0
  14. data/features/proposal_development/proposal_workflow.feature +105 -0
  15. data/features/proposal_development/special_review_validations.feature +12 -0
  16. data/features/step_definitions/action_list.rb +12 -0
  17. data/features/step_definitions/awards/create_award.rb +3 -0
  18. data/features/step_definitions/grants_gov/forms.rb +34 -0
  19. data/features/step_definitions/grants_gov/s2s_submission.rb +51 -0
  20. data/features/step_definitions/institutional_proposals/create_institutional_proposal.rb +3 -0
  21. data/features/step_definitions/proposal_development/budget_versions.rb +102 -0
  22. data/features/step_definitions/proposal_development/create_proposal.rb +157 -0
  23. data/features/step_definitions/proposal_development/edit_proposal.rb +79 -0
  24. data/features/step_definitions/proposal_development/institute_rates.rb +21 -0
  25. data/features/step_definitions/proposal_development/key_personnel_validations.rb +74 -0
  26. data/features/step_definitions/proposal_development/proposal_actions_validations.rb +73 -0
  27. data/features/step_definitions/proposal_development/proposal_permissions.rb +141 -0
  28. data/features/step_definitions/proposal_development/proposal_workflow.rb +81 -0
  29. data/features/step_definitions/proposal_development/s2s_validation.rb +30 -0
  30. data/features/step_definitions/proposal_development/special_review_validations.rb +7 -0
  31. data/features/step_definitions/test.rb +3 -0
  32. data/features/step_definitions/users.rb +65 -0
  33. data/features/support/env.rb +35 -0
  34. data/features/test.feature +13 -0
  35. data/kuality-coeus.gemspec +1 -1
  36. data/lib/chromedriver.log +4483 -0
  37. data/lib/kuality-coeus.rb +5 -2
  38. data/lib/kuality-coeus/core_extensions.rb +10 -0
  39. data/lib/kuality-coeus/data_objects/award/award.rb +126 -0
  40. data/lib/kuality-coeus/data_objects/award/award_transaction.rb +57 -0
  41. data/lib/kuality-coeus/data_objects/budget/budget_periods.rb +114 -0
  42. data/lib/kuality-coeus/data_objects/budget/budget_versions.rb +221 -0
  43. data/lib/kuality-coeus/data_objects/budget/subaward_budget.rb +65 -0
  44. data/lib/kuality-coeus/data_objects/committee_document/committee_document.rb +65 -0
  45. data/lib/kuality-coeus/data_objects/committee_document/committee_members.rb +30 -0
  46. data/lib/kuality-coeus/data_objects/committee_document/committee_schedule.rb +27 -0
  47. data/lib/kuality-coeus/data_objects/committee_document/member_roles.rb +28 -0
  48. data/lib/kuality-coeus/data_objects/conflict_of_interest/financial_entity.rb +48 -0
  49. data/lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb +90 -0
  50. data/lib/kuality-coeus/data_objects/grants_gov/phs_training_budget_questionnaire.rb +5 -0
  51. data/lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb +20 -0
  52. data/lib/kuality-coeus/data_objects/institutional_proposal/intellectual_property_review.rb +62 -0
  53. data/lib/kuality-coeus/data_objects/navigation.rb +64 -0
  54. data/lib/kuality-coeus/data_objects/proposal_development/compliance_questions.rb +47 -0
  55. data/lib/kuality-coeus/data_objects/proposal_development/custom_data.rb +41 -0
  56. data/lib/kuality-coeus/data_objects/proposal_development/degrees.rb +40 -0
  57. data/lib/kuality-coeus/data_objects/proposal_development/key_personnel.rb +299 -0
  58. data/lib/kuality-coeus/data_objects/proposal_development/kuali_university_questions.rb +58 -0
  59. data/lib/kuality-coeus/data_objects/proposal_development/permissions.rb +107 -0
  60. data/lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.rb +46 -0
  61. data/lib/kuality-coeus/data_objects/proposal_development/proposal_attachments.rb +41 -0
  62. data/lib/kuality-coeus/data_objects/proposal_development/proposal_development.rb +301 -0
  63. data/lib/kuality-coeus/data_objects/proposal_development/proposal_questions.rb +52 -0
  64. data/lib/kuality-coeus/data_objects/proposal_development/s2s_questionnaire.rb +129 -0
  65. data/lib/kuality-coeus/data_objects/proposal_development/special_review.rb +79 -0
  66. data/lib/kuality-coeus/data_objects/rates/institute_rate.rb +209 -0
  67. data/lib/kuality-coeus/data_objects/user.rb +303 -33
  68. data/lib/kuality-coeus/gem_extensions.rb +26 -0
  69. data/lib/kuality-coeus/page_objects/000_base_page.rb +196 -14
  70. data/lib/kuality-coeus/page_objects/action_list.rb +32 -0
  71. data/lib/kuality-coeus/page_objects/award/award.rb +25 -0
  72. data/lib/kuality-coeus/page_objects/award/award_actions.rb +7 -0
  73. data/lib/kuality-coeus/page_objects/award/award_budget_versions.rb +9 -0
  74. data/lib/kuality-coeus/page_objects/award/commitments.rb +27 -0
  75. data/lib/kuality-coeus/page_objects/award/contacts.rb +19 -0
  76. data/lib/kuality-coeus/page_objects/award/custom_data.rb +6 -0
  77. data/lib/kuality-coeus/page_objects/award/payment_reports_terms.rb +26 -0
  78. data/lib/kuality-coeus/page_objects/award/special_review.rb +7 -0
  79. data/lib/kuality-coeus/page_objects/award/time_and_money.rb +36 -0
  80. data/lib/kuality-coeus/page_objects/budget/budget_actions.rb +31 -0
  81. data/lib/kuality-coeus/page_objects/budget/budget_versions.rb +13 -0
  82. data/lib/kuality-coeus/page_objects/budget/modular_budget.rb +16 -0
  83. data/lib/kuality-coeus/page_objects/budget/non-personnel.rb +11 -0
  84. data/lib/kuality-coeus/page_objects/budget/parameters.rb +65 -0
  85. data/lib/kuality-coeus/page_objects/budget/personnel.rb +56 -0
  86. data/lib/kuality-coeus/page_objects/budget/rates.rb +7 -0
  87. data/lib/kuality-coeus/page_objects/budget/summary.rb +5 -0
  88. data/lib/kuality-coeus/page_objects/budget_document.rb +19 -0
  89. data/lib/kuality-coeus/page_objects/central_admin.rb +4 -2
  90. data/lib/kuality-coeus/page_objects/committee/committee.rb +10 -10
  91. data/lib/kuality-coeus/page_objects/committee/members.rb +4 -4
  92. data/lib/kuality-coeus/page_objects/committee_document.rb +1 -6
  93. data/lib/kuality-coeus/page_objects/confirmation.rb +16 -0
  94. data/lib/kuality-coeus/page_objects/disclosure/disclosure.rb +56 -0
  95. data/lib/kuality-coeus/page_objects/disclosure/disclosure_actions.rb +9 -0
  96. data/lib/kuality-coeus/page_objects/document_header.rb +5 -0
  97. data/lib/kuality-coeus/page_objects/financial_entities.rb +1 -4
  98. data/lib/kuality-coeus/page_objects/financial_entities/my_financial_entities.rb +6 -0
  99. data/lib/kuality-coeus/page_objects/financial_entities/new_financial_entity.rb +11 -0
  100. data/lib/kuality-coeus/page_objects/financial_entities/reporter.rb +5 -3
  101. data/lib/kuality-coeus/page_objects/identity/person.rb +57 -0
  102. data/lib/kuality-coeus/page_objects/institute_rates_maintenance.rb +18 -0
  103. data/lib/kuality-coeus/page_objects/institutional_proposal.rb +18 -0
  104. data/lib/kuality-coeus/page_objects/institutional_proposal/contacts.rb +32 -0
  105. data/lib/kuality-coeus/page_objects/institutional_proposal/custom_data.rb +6 -0
  106. data/lib/kuality-coeus/page_objects/institutional_proposal/distribution.rb +20 -0
  107. data/lib/kuality-coeus/page_objects/institutional_proposal/institutional_proposal.rb +27 -0
  108. data/lib/kuality-coeus/page_objects/institutional_proposal/institutional_proposal_actions.rb +7 -0
  109. data/lib/kuality-coeus/page_objects/institutional_proposal/intellectual_property_review.rb +20 -0
  110. data/lib/kuality-coeus/page_objects/institutional_proposal/special_review.rb +6 -0
  111. data/lib/kuality-coeus/page_objects/kc_awards.rb +48 -0
  112. data/lib/kuality-coeus/page_objects/kc_protocol.rb +15 -0
  113. data/lib/kuality-coeus/page_objects/login.rb +4 -5
  114. data/lib/kuality-coeus/page_objects/lookup_pages/000_lookups.rb +10 -0
  115. data/lib/kuality-coeus/page_objects/lookup_pages/action_list_filter.rb +6 -0
  116. data/lib/kuality-coeus/page_objects/lookup_pages/address_book_lookup.rb +4 -0
  117. data/lib/kuality-coeus/page_objects/lookup_pages/development_proposal_lookup.rb +3 -0
  118. data/lib/kuality-coeus/page_objects/lookup_pages/document_search.rb +10 -0
  119. data/lib/kuality-coeus/page_objects/lookup_pages/group_lookup.rb +3 -0
  120. data/lib/kuality-coeus/page_objects/lookup_pages/institute_rates_lookup.rb +12 -0
  121. data/lib/kuality-coeus/page_objects/lookup_pages/opportunity_lookup.rb +6 -0
  122. data/lib/kuality-coeus/page_objects/lookup_pages/organization_lookup.rb +5 -0
  123. data/lib/kuality-coeus/page_objects/lookup_pages/person_extended_attributes.rb +5 -0
  124. data/lib/kuality-coeus/page_objects/lookup_pages/person_lookup.rb +10 -0
  125. data/lib/kuality-coeus/page_objects/lookup_pages/role_lookup.rb +6 -0
  126. data/lib/kuality-coeus/page_objects/lookup_pages/sponsor_lookup.rb +9 -0
  127. data/lib/kuality-coeus/page_objects/lookup_pages/unit_admin_lookup.rb +3 -0
  128. data/lib/kuality-coeus/page_objects/lookup_pages/unit_lookup.rb +3 -0
  129. data/lib/kuality-coeus/page_objects/maintenance.rb +7 -0
  130. data/lib/kuality-coeus/page_objects/notification_editor.rb +6 -0
  131. data/lib/kuality-coeus/page_objects/proposal_development.rb +7 -2
  132. data/lib/kuality-coeus/page_objects/proposal_development/abstracts_and_attachments.rb +54 -0
  133. data/lib/kuality-coeus/page_objects/proposal_development/key_personnel.rb +126 -0
  134. data/lib/kuality-coeus/page_objects/proposal_development/pd_custom_data.rb +6 -0
  135. data/lib/kuality-coeus/page_objects/proposal_development/permissions.rb +44 -0
  136. data/lib/kuality-coeus/page_objects/proposal_development/phs_fellowship_questionnaire.rb +44 -0
  137. data/lib/kuality-coeus/page_objects/proposal_development/phs_training_budget_questionnaire.rb +50 -0
  138. data/lib/kuality-coeus/page_objects/proposal_development/proposal.rb +47 -8
  139. data/lib/kuality-coeus/page_objects/proposal_development/proposal_actions.rb +62 -0
  140. data/lib/kuality-coeus/page_objects/proposal_development/proposal_summary.rb +9 -0
  141. data/lib/kuality-coeus/page_objects/proposal_development/questions.rb +111 -0
  142. data/lib/kuality-coeus/page_objects/proposal_development/s2s.rb +35 -0
  143. data/lib/kuality-coeus/page_objects/proposal_development/special_review.rb +6 -0
  144. data/lib/kuality-coeus/page_objects/protocol/custom_data.rb +6 -0
  145. data/lib/kuality-coeus/page_objects/protocol/permissions.rb +5 -0
  146. data/lib/kuality-coeus/page_objects/protocol/personnel.rb +5 -0
  147. data/lib/kuality-coeus/page_objects/protocol/protocol.rb +11 -0
  148. data/lib/kuality-coeus/page_objects/protocol/questionnaire.rb +5 -0
  149. data/lib/kuality-coeus/page_objects/protocol/special_review.rb +6 -0
  150. data/lib/kuality-coeus/page_objects/rejection_confirmation.rb +5 -0
  151. data/lib/kuality-coeus/page_objects/researcher.rb +4 -2
  152. data/lib/kuality-coeus/page_objects/shared/unit_administrator.rb +13 -0
  153. data/lib/kuality-coeus/page_objects/system/person_extended_attributes.rb +18 -0
  154. data/lib/kuality-coeus/page_objects/system_admin.rb +7 -0
  155. data/lib/kuality-coeus/page_objects/unit.rb +2 -4
  156. data/lib/kuality-coeus/utilities.rb +39 -0
  157. data/libpeerconnection.log +0 -0
  158. metadata +140 -5
  159. data/lib/kuality-coeus/data_objects/committee_document.rb +0 -65
  160. data/lib/kuality-coeus/data_objects/proposal_development.rb +0 -53
  161. data/lib/kuality-coeus/navigation.rb +0 -3
@@ -0,0 +1,105 @@
1
+ Feature: Proposal Workflows and Routing
2
+
3
+ As system user with the appropriate roles and permissions, I want the ability to
4
+ take actions against a proposal that will navigate it through various routes
5
+ in workflow.
6
+
7
+ #=================
8
+ # Proposal Actions -- As proposals navigate through workflow, specific users are asked to take actions
9
+ #=================
10
+
11
+ Scenario Outline: Proposal is successfully routed to PI for action
12
+ Given users exist with the following roles: OSPApprover, Proposal Creator, Unassigned
13
+ And I log in with the Proposal Creator user
14
+ And initiate a proposal
15
+ And add the Unassigned user as a Principal Investigator to the key personnel proposal roles
16
+ And complete the required custom fields on the proposal
17
+ And submit the proposal
18
+ When the OSPApprover user approves the proposal
19
+ And I log in with the Unassigned user
20
+ Then I can access the proposal from my action list
21
+ And the <Action> button appears on the Proposal Summary and Proposal Action pages
22
+
23
+ Examples:
24
+ | Action |
25
+ | Approve |
26
+ | Disapprove |
27
+ | Reject |
28
+
29
+ Scenario Outline: Proposal is successfully routed to OSP Approver for action
30
+ Given users exist with the following roles: Proposal Creator, OSPApprover
31
+ And I log in with the Proposal Creator user
32
+ And I initiate a proposal
33
+ And I complete the proposal
34
+ And I submit the proposal
35
+ When I log in with the OSPApprover user
36
+ Then I can access the proposal from my action list
37
+ And the <Action> button appears on the Proposal Summary and Proposal Action pages
38
+
39
+ Examples:
40
+ | Action |
41
+ | Approve |
42
+ | Disapprove |
43
+ | Reject |
44
+
45
+ Scenario: Aggregator successfully submits a proposal into routing
46
+ Given a user exists with the system role: 'Proposal Creator'
47
+ And I initiate a proposal
48
+ And I complete the proposal
49
+ When I submit the proposal
50
+ Then the proposal status should be Approval Pending
51
+
52
+ Scenario: Aggregator successfully blanket approves a routed proposal
53
+ Given a user exists with the system role: 'Proposal Creator'
54
+ And I log in with the Proposal Creator user
55
+ And I submit a new development proposal into routing
56
+ When I blanket approve the proposal
57
+ Then the proposal status should be Approval Granted
58
+
59
+ Scenario: OSP Approver successfully submits a routed proposal to the sponsor
60
+ Given users exist with the following roles: Proposal Creator, OSPApprover
61
+ And I log in with the Proposal Creator user
62
+ And I submit a new development proposal into routing
63
+ When I log in with the OSPApprover user
64
+ And I submit the routed proposal to the sponsor
65
+ Then the proposal status should be Approval Pending - Submitted
66
+
67
+ #TODO: Scenario: An OSP Approver takes the 'Submit to sponsor' action against a routed proposal and an institutional proposal is created
68
+
69
+ Scenario: Aggregator successfully recalls a routed proposal for cancellation
70
+ Given a user exists with the system role: 'Proposal Creator'
71
+ And I log in with the Proposal Creator user
72
+ And I submit a new development proposal into routing
73
+ When I recall and cancel the proposal
74
+ Then the proposal status should be Document Error Occurred
75
+
76
+ Scenario: Aggregator successfully recalls proposal for revisions
77
+ Given a user exists with the system role: 'Proposal Creator'
78
+ And I log in with the Proposal Creator user
79
+ And I submit a new development proposal into routing
80
+ When I recall the proposal for revisions
81
+ Then the proposal status should be Revisions Requested
82
+
83
+ #=================
84
+ # Notifications -- Notifications are sent are FYIs to select users.
85
+ #=================
86
+ Scenario: Successful delivery of an FYI from a development proposal
87
+ Given users exist with the following roles: Proposal Creator, OSPApprover
88
+ And I log in with the Proposal Creator user
89
+ And I initiate a proposal
90
+ When I send a notification to the OSPApprover user
91
+ And I log in with the OSPApprover user
92
+ Then I should receive an action list item with the requested action being: FYI
93
+ And I can acknowledge the requested action list item
94
+
95
+ #TODO: Scenario: An OSPApprover user can filter all of their FYIs and acknowledge them at once
96
+
97
+ #=================
98
+ # Action List -- Routed proposals appear in select user's action lists with requested actions
99
+ #=================
100
+
101
+ #TODO: Think about this scenario... Think of a new way to write this
102
+ Scenario: Successful receipt of a routed proposal by an OSP Approver
103
+ Given a user exists with the system role: 'OSPApprover'
104
+ When I submit a new development proposal into routing
105
+ Then the proposal is in the OSPApprover user's action list
@@ -0,0 +1,12 @@
1
+ Feature: Special Review Validations
2
+
3
+ As a researcher I want to know if there are problems
4
+ with my proposal's key personnel so that I can fix them
5
+ before I submit the proposal
6
+
7
+ Background: Necessary users exist in the system
8
+ Given I'm logged in with admin
9
+
10
+ Scenario: The application date must be prior to the approval date
11
+ When I add a special review item that has an approval date earlier than the application date
12
+ Then I should see an error that the approval should occur later than the application
@@ -0,0 +1,12 @@
1
+ When /^I visit the action list outbox$/ do
2
+ visit(ActionList).outbox
3
+ end
4
+
5
+ Then /^I can access the proposal from my action list$/ do
6
+ visit(ActionList).filter
7
+ on ActionListFilter do |page|
8
+ page.document_title.set @proposal.project_title
9
+ page.filter
10
+ end
11
+ on(ActionList).open_item(@proposal.document_id)
12
+ end
@@ -0,0 +1,3 @@
1
+ When /^I? ?create an award for the institutional_proposal$/ do
2
+ @award = create AwardObject, funding_proposal: @institutional_proposal.proposal_number
3
+ end
@@ -0,0 +1,34 @@
1
+ Then(/^the s2s form attachment options should be appropriate to the opportunity$/) do
2
+ forms = {
3
+ 'RR-FORMFAMILY-004-2010' =>
4
+ %w{RR_SF424_1_2-V1.2
5
+ FaithBased_SurveyOnEEO-V1.2
6
+ NASA_OtherProjectInformation-V1.0
7
+ Nasa_PIandAORSupplementalDataSheet-V1.0
8
+ NASA_SeniorKeyPersonSupplementalDataSheet-V1.0
9
+ HHS_CheckList_2_1-V2.1},
10
+ 'RR-FORMFAMILY-009-2010' =>
11
+ %w{RR_KeyPersonExpanded_1_2-V1.2
12
+ RR_OtherProjectInfo_1_3-V1.3},
13
+ 'CSS-120809-SF424RR-V12' =>
14
+ %w{RR_Budget-V1.1
15
+ RR_Budget10-V1.1
16
+ RR_SubawardBudget-V1.2
17
+ RR_SubawardBudget30-V1.2
18
+ RR_SubawardBudget10_10-V1.2
19
+ RR_SubawardBudget10_30-V1.2
20
+ RR_FedNonFedBudget-V1.1
21
+ RR_FedNonFedBudget10-V1.1
22
+ RR_FedNonFed_SubawardBudget-V1.2
23
+ RR_FedNonFedSubawardBudget10_10-V1.2
24
+ RR_FedNonFed_SubawardBudget30-V1.2
25
+ RR_FedNonFed_SubawardBudget10_30-V1.2},
26
+ 'SK07132010SCR9020-2' =>
27
+ %w{PHS_Fellowship_Supplemental_1_2-V1.2},
28
+ 'PA-B1-K08' =>
29
+ %w{PHS398_CareerDevelopmentAwardSup_1_2-V1.2}
30
+ }
31
+ on S2S do |page|
32
+ forms[@proposal.opportunity_id].each { |form_name| page.form_names.should include form_name }
33
+ end
34
+ end
@@ -0,0 +1,51 @@
1
+ Then /^the S2S tab's submission details will say the proposal is submitted$/ do
2
+ # Note that there's no navigation here currently because
3
+ # this step def comes after the submission step, which
4
+ # should automatically switch the user to the S2S page.
5
+ on S2S do |page|
6
+ page.expand_all
7
+ page.submission_details_table.should be_present
8
+ page.submission_status.should=='Submitted to S2S'
9
+ end
10
+ end
11
+
12
+ Then /^within a couple minutes the submission status will be updated$/ do
13
+ on S2S do |page|
14
+ x = 0
15
+ while page.submission_status=='Submitted to S2S'
16
+ sleep 5
17
+ page.refresh_submission_details
18
+ x += 1
19
+ break if x == 24
20
+ end
21
+ # We don't care what it is. Only that it's updated...
22
+ page.submission_status.should_not == 'Submitted to S2S'
23
+ end
24
+ end
25
+
26
+ When(/^I attach the PHS training and fellowship forms to the proposal$/) do
27
+ on S2S do |page|
28
+ %w{PHS_Fellowship_Supplemental_1_2-V1.2
29
+ PHS398_TrainingBudget-V1.0}.each { |form| page.include_form(form).set }
30
+ end
31
+ end
32
+
33
+ Then /^the PHS training and fellowship questionnaires should appear in the proposal$/ do
34
+ on(S2S).questions
35
+ on Questions do |page|
36
+ %w{'PHS398 Training Budget V1-0',
37
+ 'PHS Fellowship Form V1-2'}.each { |title| page.form_tab(title).should be_present }
38
+ end
39
+ end
40
+
41
+ When /^I? ?complete their respective questionnaires$/ do
42
+ #on(PHS398TrainingBudgetQuestionnaire).complete_phs_training_questionnaire
43
+ @proposal.complete_phs_fellowship_questionnaire
44
+ end
45
+
46
+ Then /^the questionnaire titles should indicate that the questionnaires have been completed$/ do
47
+ on Questions do |page|
48
+ %w{PHS398 Training Budget V1-0
49
+ PHS Fellowship Form V1-2}.each { |form_tab| page.form_status(form_tab).should=='Complete'}
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ When /^pending$/ do
2
+ pending
3
+ end
@@ -0,0 +1,102 @@
1
+ When /^I? ?create a budget version for the proposal$/ do
2
+ @proposal.add_budget_version
3
+ @budget_version = @proposal.budget_versions[0]
4
+ end
5
+
6
+ When /^I? ?add a subaward budget to the budget version$/ do
7
+ @budget_version.add_subaward_budget
8
+ end
9
+
10
+ Then /^opening the Budget Version will display a warning about the date change$/ do
11
+ @budget_version.open_budget
12
+ on(Parameters).warnings.should include 'The Project Start and/or End Dates have changed from the previous version of this budget. Please update the Project Start and/or End Dates.'
13
+ end
14
+
15
+ When /^correcting the Budget Version date will remove the warning$/ do
16
+ @budget_version.default_periods
17
+ on(Parameters).warnings.size.should be 0
18
+ end
19
+
20
+ Given /^I? ?create, finalize, and mark complete a budget version for the proposal$/ do
21
+ @proposal.add_budget_version(status: 'Complete', final: :set)
22
+ end
23
+
24
+ When /^I? ?copy the budget version \(all periods\)$/ do
25
+ @copied_budget_version = @proposal.budget_versions.copy_all_periods(@budget_version.name, random_alphanums)
26
+ end
27
+
28
+ When /^I? ?enter dollar amounts for all the budget periods$/ do
29
+ @budget_version.budget_periods.each do |p|
30
+ randomized_values = {}
31
+ p.dollar_fields[1..-1].each { |f| randomized_values.store(f, random_dollar_value(500000)) }
32
+ p.edit randomized_values
33
+ end
34
+ end
35
+
36
+ Then /^the copied budget's values are all as expected$/ do
37
+ @copied_budget_version.open_budget
38
+ @copied_budget_version.budget_periods.each do |period|
39
+ on Parameters do |page|
40
+ page.start_date_period(period.number).value.should==period.start_date
41
+ page.end_date_period(period.number).value.should==period.end_date
42
+ page.total_sponsor_cost_period(period.number).value.should==(period.direct_cost+period.f_and_a_cost).commas
43
+ page.direct_cost_period(period.number).value.should==period.direct_cost.commas
44
+ page.fa_cost_period(period.number).value.should==period.f_and_a_cost.commas
45
+ page.unrecovered_fa_period(period.number).value.should==period.unrecovered_f_and_a.commas
46
+ page.cost_sharing_period(period.number).value.should==period.cost_sharing.commas
47
+ page.cost_limit_period(period.number).value.should==period.cost_limit.commas
48
+ page.direct_cost_limit_period(period.number).value.should==period.direct_cost_limit.commas
49
+ end
50
+ end
51
+ end
52
+
53
+ When /^I? ?delete one of the budget periods$/ do
54
+ @budget_version.delete_period(rand(@budget_version.budget_periods.size)+1)
55
+ end
56
+
57
+ When /^I? ?change the date range for one of the periods$/ do
58
+ period = @budget_version.budget_periods.sample
59
+ new_start_date = '03'+period.start_date[/\/\d+\/\d+$/]
60
+ new_end_date = '10'+period.end_date[/\/\d+\/\d+$/]
61
+ period.edit start_date: new_start_date, end_date: new_end_date
62
+ on(Confirmation).yes
63
+ end
64
+
65
+ When /^I? ?select the default periods for the budget version$/ do
66
+ @budget_version.default_periods
67
+ end
68
+
69
+ Then /^all budget periods get recreated, zeroed, and given default date ranges$/ do
70
+ default_start_dates={1=>@proposal.project_start_date}
71
+ default_end_dates={@years=>@proposal.project_end_date}
72
+ 1.upto(@years-1) do |i|
73
+ default_start_dates.store(i+1, "01/01/#{@proposal.project_start_date[/\d+$/].to_i+i}")
74
+ default_end_dates.store(@years-i, "12/31/#{@proposal.project_end_date[/\d+$/].to_i-i}")
75
+ end
76
+ on(Parameters).period_count.should==@years
77
+ on Parameters do |page|
78
+ 1.upto(@years) do |x|
79
+ page.start_date_period(x).value.should==default_start_dates[x]
80
+ page.end_date_period(x).value.should==default_end_dates[x]
81
+ page.total_sponsor_cost_period(x).value.should=='0.00'
82
+ page.direct_cost_period(x).value.should=='0.00'
83
+ page.fa_cost_period(x).value.should=='0.00'
84
+ page.unrecovered_fa_period(x).value.should=='0.00'
85
+ page.cost_sharing_period(x).value.should=='0.00'
86
+ page.cost_limit_period(x).value.should=='0.00'
87
+ page.direct_cost_limit_period(x).value.should=='0.00'
88
+ end
89
+ end
90
+ end
91
+
92
+ When /^I? ?finalize the budget version$/ do
93
+ @budget_version.edit final: :set
94
+ end
95
+
96
+ When /^I? ?mark the budget version complete$/ do
97
+ @budget_version.edit status: 'Complete'
98
+ end
99
+
100
+ Then /^I see an error that only one version can be final$/ do
101
+ on(BudgetVersions).errors.should include 'Only one Budget Version can be marked "Final".'
102
+ end
@@ -0,0 +1,157 @@
1
+ Given /^I? ?initiate a proposal$/ do
2
+ @proposal = create ProposalDevelopmentObject
3
+ end
4
+
5
+ Given /^I? ?initiate a second proposal$/ do
6
+ @proposal2 = create ProposalDevelopmentObject
7
+ end
8
+
9
+ Given /^I? ?initiate a (\d+)-year project proposal$/ do |year_count|
10
+ @years=year_count.to_i
11
+ @proposal =create ProposalDevelopmentObject,
12
+ project_start_date: "01/01/#{next_year[:year]}",
13
+ project_end_date: "12/31/#{next_year[:year].to_i+(@years-1)}"
14
+ end
15
+
16
+ Given /^I? ?initiate a (\d+)-year, '(.*)' proposal$/ do |year_count, activity_type|
17
+ @years=year_count.to_i
18
+ @proposal =create ProposalDevelopmentObject,
19
+ project_start_date: "01/01/#{next_year[:year]}",
20
+ project_end_date: "12/31/#{next_year[:year].to_i+(@years-1)}",
21
+ activity_type: activity_type
22
+ end
23
+
24
+ When /^I? ?initiate a proposal but miss a required field$/ do
25
+ # Pick a field at random for the test...
26
+ @required_field = ['Description', 'Proposal Type', 'Lead Unit', 'Activity Type',
27
+ 'Project Title', 'Sponsor Code', 'Project Start Date', 'Project End Date'
28
+ ].sample
29
+ # Properly set the nil value depending on the field type...
30
+ @required_field=~/Type/ || @required_field=='Lead Unit' ? value='select' : value=''
31
+ # Transform the field name to the appropriate symbol...
32
+ field = snake_case(@required_field)
33
+ @proposal = create ProposalDevelopmentObject, field=>value
34
+ end
35
+
36
+ When /^I? ?initiate a proposal with an? '(.*)' sponsor type$/ do |type|
37
+ @proposal = create ProposalDevelopmentObject, sponsor_type_code: type
38
+ end
39
+
40
+ Given /^I? ?initiate a proposal with (\D+) as the sponsor$/ do |sponsor_name|
41
+ # First, we have to get the sponsor ID based on the sponsor_name string...
42
+ visit(Maintenance).sponsor
43
+ sponsor_code=''
44
+ on SponsorLookup do |search|
45
+ search.sponsor_name.set sponsor_name
46
+ search.search
47
+ sponsor_code = search.get_sponsor_code(sponsor_name)
48
+ end
49
+ # Now we can create the proposal with the proper sponsor ID...
50
+ @proposal = create ProposalDevelopmentObject, sponsor_code: sponsor_code
51
+ end
52
+
53
+ Given /^I initiate a proposal with a type of '(.*)'$/ do |type|
54
+ @proposal = create ProposalDevelopmentObject, proposal_type: type
55
+ end
56
+
57
+ When /^I? ?initiate a proposal with an invalid sponsor code$/ do
58
+ @proposal = create ProposalDevelopmentObject, :sponsor_code=>'000000'
59
+ end
60
+
61
+ Given /^I? ?initiate a proposal without a sponsor deadline date$/ do
62
+ @proposal = create ProposalDevelopmentObject, sponsor_deadline_date: ''
63
+ end
64
+
65
+ Then /^I should see an error that says a valid sponsor code is required$/ do
66
+ on(Proposal).errors.should include 'A valid Sponsor Code (Sponsor) must be selected.'
67
+ end
68
+
69
+ When /^I? ?submit the proposal$/ do
70
+ @proposal.submit
71
+ end
72
+
73
+ When /^I? ?complete the proposal$/ do
74
+ @proposal.add_principal_investigator
75
+ @proposal.set_valid_credit_splits
76
+ @proposal.add_custom_data
77
+ end
78
+
79
+ When /^I? ?complete the required custom fields on the proposal$/ do
80
+ @proposal.add_custom_data
81
+ end
82
+
83
+ When /^I? ?add (.*) as an? (.*) to the proposal permissions$/ do |username, role|
84
+ @proposal.permissions.send("#{snake_case(role)}s") << username
85
+ @proposal.permissions.assign
86
+ end
87
+
88
+ When /^I? ?save and close the proposal document$/ do
89
+ @proposal.close
90
+ on(Confirmation).yes
91
+ end
92
+
93
+ And /^I? ?submit a new development proposal into routing$/ do
94
+ @proposal = create ProposalDevelopmentObject
95
+ @proposal.add_principal_investigator
96
+ @proposal.set_valid_credit_splits
97
+ @proposal.add_custom_data
98
+ @proposal.submit
99
+ end
100
+
101
+ And /^I? ?add the (Grants.Gov|Research.Gov) opportunity id of (.*) to the proposal$/ do |type, op_id|
102
+ @proposal.edit opportunity_id: op_id
103
+ on(Proposal).s2s
104
+ on S2S do |page|
105
+ page.expand_all
106
+ page.s2s_lookup
107
+ end
108
+ on OpportunityLookup do |look|
109
+ look.s2s_provider.select type
110
+ look.search
111
+ look.return_value op_id
112
+ end
113
+ on(S2S).save
114
+ end
115
+
116
+ And /^I? ?add the (Grants.Gov|Research.Gov) opportunity, id: (.*), competition id: (.*)$/ do |type, op_id, comp_id|
117
+ @proposal.edit opportunity_id: op_id
118
+ on(Proposal).s2s
119
+ on S2S do |page|
120
+ page.expand_all
121
+ page.s2s_lookup
122
+ end
123
+ on OpportunityLookup do |look|
124
+ look.s2s_provider.select type
125
+ look.search
126
+ look.return_value comp_id
127
+ end
128
+ on(S2S).save
129
+ end
130
+
131
+ And /^I? ?add and mark complete all the required attachments for an NSF proposal$/ do
132
+ %w{Equipment Bibliography BudgetJustification ProjectSummary Narrative}.shuffle.each do |type|
133
+ @proposal.add_proposal_attachment type: type, file_name: 'test.pdf', status: 'Complete'
134
+ end
135
+ @proposal.add_proposal_attachment type: 'Other', file_name: 'NSF_DATA_MANAGEMENT_PLAN.pdf', status: 'Complete', description: random_alphanums
136
+ @proposal.key_personnel.each do |person|
137
+ %w{Biosketch Currentpending}.each do |type|
138
+ @proposal.add_personnel_attachment person: person.full_name, type: type, file_name: 'test.pdf'
139
+ end
140
+ end
141
+ end
142
+
143
+ When /^I? ?add and mark complete all the required attachments for an NIH proposal$/ do
144
+ %w{Equipment Bibliography BudgetJustification ProjectSummary Narrative Facilities
145
+ PHS_ResearchPlan_SpecificAims PHS_ResearchPlan_ResearchStrategy}
146
+ .shuffle.each { |type| @proposal.add_proposal_attachment type: type, file_name: 'test.pdf', status: 'Complete' }
147
+ @proposal.key_personnel.each { |person| @proposal.add_personnel_attachment person: person.full_name, type: 'Biosketch', file_name: 'test.pdf' }
148
+ end
149
+
150
+ Then /^I should see an error that says the field is required$/ do
151
+ text="#{@required_field} is a required field."
152
+ @required_field=='Description' ? error='Document '+text : error=text
153
+ on(Proposal) do |page|
154
+ page.error_summary.wait_until_present(5)
155
+ page.errors.should include error
156
+ end
157
+ end