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,79 @@
1
+ When /^I? ?recall the proposal$/ do
2
+ @proposal.recall
3
+ end
4
+
5
+ When /^I? ?complete a valid simple proposal for a '(.*)' organization$/ do |org|
6
+ @proposal = create ProposalDevelopmentObject, sponsor_type_code: org
7
+ @proposal.add_principal_investigator
8
+ @proposal.set_valid_credit_splits
9
+ @proposal.add_custom_data
10
+ end
11
+
12
+ Then /^The proposal should immediately have a status of '(.*)'$/ do |status|
13
+ @proposal.status.should==status
14
+ end
15
+
16
+ Then /^The proposal route log's 'Actions Taken' should include '(.*)'$/ do |value|
17
+ @proposal.view :proposal_actions
18
+ on ProposalActions do |page|
19
+ page.expand_all
20
+ page.actions_taken.should include value
21
+ end
22
+ end
23
+
24
+ Then /^The proposal route log's 'Pending Action Requests' should include '(.*)'$/ do |action|
25
+ @proposal.view :proposal_actions
26
+ on ProposalActions do |page|
27
+ page.expand_all
28
+ page.action_requests.should include action
29
+ end
30
+ end
31
+
32
+ Then /^The S2S tab should become available$/ do
33
+ @proposal.view :s2s
34
+ on(S2S).s2s_header.should be_present
35
+ end
36
+
37
+ When /^The proposal's 'Future Action Requests' should include 'PENDING APPROVE' for the principal investigator$/ do
38
+ pi = @proposal.key_personnel.principal_investigator
39
+ name = "#{pi.last_name}, #{pi.first_name}"
40
+ @proposal.view :proposal_actions
41
+ on ProposalActions do |page|
42
+ page.expand_all
43
+ page.show_future_action_requests
44
+ page.requested_action_for(name).should=="PENDING\nAPPROVE"
45
+ end
46
+ end
47
+
48
+ When /^I? ?push the proposal's project start date ahead a year$/ do
49
+ new_year=@proposal.project_start_date[/\d+$/].to_i+1
50
+ new_date="#{@proposal.project_start_date[/^\d+\/\d+/]}/#{new_year}"
51
+ @proposal.edit project_start_date: new_date
52
+ end
53
+
54
+ Then /^I can recall the proposal$/ do
55
+ @proposal.view :proposal
56
+ on(Proposal).recall_button.should exist
57
+ end
58
+
59
+ And /^I? ?answer the S2S questions$/ do
60
+ @proposal.complete_s2s_questionnaire
61
+ end
62
+
63
+ Given /^I? ?set the proposal type to '(\w+)'$/ do |type|
64
+ @proposal.edit proposal_type: type
65
+ end
66
+
67
+ When /^I go to the proposal's (.*) page$/ do |page|
68
+ pages = { 'S2S'=>:s2s }
69
+ @proposal.view pages[page]
70
+ end
71
+
72
+ When /^I? ?save the proposal$/ do
73
+ @proposal.save
74
+ end
75
+
76
+ Given /^I? ?set the proposal type to either 'Resubmission', 'Renewal', or 'Continuation'$/ do
77
+ type = %w{Resubmission Renewal Continuation}.sample
78
+ @proposal.edit proposal_type: type
79
+ end
@@ -0,0 +1,21 @@
1
+ Given /^I? ?have (.*)-Campus, (.*) type Institute Rates appropriate for the proposal$/ do |campus, rate_type|
2
+ campus_flags = {'On-and-off'=>[:set,:clear],'On'=>[:set],'Off'=>[:clear]}
3
+ fiscal_years = (@proposal.project_start_date[/\d+$/]..@proposal.project_end_date[/\d+$/]).to_a
4
+ campus_flags[campus].each do |camp|
5
+ fiscal_years.each do |year|
6
+ rate_object = make InstituteRateObject,
7
+ fiscal_year: year,
8
+ on_off_campus_flag: camp,
9
+ activity_type: @proposal.activity_type,
10
+ rate_type: rate_type,
11
+ unit_number: @proposal.lead_unit[/^\w+-*\w+/]
12
+ if rate_object.exist?
13
+ rate_object.get_current_rate
14
+ rate_object.activate
15
+ else
16
+ rate_object.create
17
+ end
18
+ set("rate_#{year}_#{camp}", rate_object)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,74 @@
1
+ And /^I? ?add the (.*) user as an? (.*) to the key personnel proposal roles$/ do |user_role, proposal_role|
2
+ user = get(user_role)
3
+ @proposal.add_key_person first_name: user.first_name, last_name: user.last_name, role: proposal_role
4
+ end
5
+
6
+ When /^I? ?add (.*) as a Key Person with a role of (.*)$/ do |user_name, kp_role|
7
+ user = get(user_name)
8
+ @proposal.add_key_person first_name: user.first_name, last_name: user.last_name, role: 'Key Person', key_person_role: kp_role
9
+ end
10
+
11
+ And /^I? ?add a (.*) with a (.*) credit split of (.*)$/ do |role, cs_type, amount|
12
+ @proposal.add_key_person cs_type.downcase.to_sym=>amount, role: role
13
+ end
14
+
15
+ When /^I? ?try to add two Principal Investigators$/ do
16
+ 2.times { @proposal.add_principal_investigator }
17
+ end
18
+
19
+ When /^I? ?add a key person without a key person role$/ do
20
+ @proposal.add_key_person role: 'Key Person', key_person_role:''
21
+ end
22
+
23
+ When /^I? ?add a co-investigator without a unit$/ do
24
+ @proposal.add_key_person role: 'Co-Investigator'
25
+ @proposal.key_personnel.co_investigator.delete_units
26
+ on(KeyPersonnel).save
27
+ end
28
+
29
+ When /^I? ?add a key person with an invalid unit type$/ do
30
+ @proposal.add_key_person role: 'Key Person', key_person_role: 'king', units: [{number: 'invalid'}]
31
+ end
32
+
33
+ Then /^a key personnel error should say (.*)$/ do |error|
34
+ errors = {'at least one principal investigator is required' => 'There is no Principal Investigator selected. Please enter a Principal Investigator.',
35
+ 'to select a valid unit' => 'Please select a valid Unit.',
36
+ 'a key person role is required' => 'Key Person Role is a required field.',
37
+ 'the credit split is not a valid percentage' => 'Credit Split is not a valid percentage.',
38
+ 'the co-investigator requires at least one unit' => "At least one Unit is required for #{@proposal.key_personnel.co_investigator.full_name}.",
39
+ 'only one PI is allowed' => 'Only one proposal role of Principal Investigator is allowed.'
40
+ }
41
+ on(KeyPersonnel).errors.should include errors[error]
42
+ end
43
+
44
+ When /^I? ?add a principal investigator$/ do
45
+ @proposal.add_principal_investigator
46
+ end
47
+
48
+ Given /^I? ?add the Grants.Gov user as the proposal's PI$/ do
49
+ @proposal.add_principal_investigator last_name: @grants_gov_pi.last_name, first_name: @grants_gov_pi.first_name
50
+ end
51
+
52
+ When /^I? ?set valid credit splits for the proposal$/ do
53
+ @proposal.set_valid_credit_splits
54
+ end
55
+
56
+ Then /^there should be an error that says the (.*) user already holds investigator role$/ do |role|
57
+ on(KeyPersonnel).errors.should include "#{get(role).first_name} #{get(role).last_name} already holds Investigator role."
58
+ end
59
+
60
+ And(/^the (.*) button appears on the Proposal Summary and Proposal Action pages$/) do |action|
61
+ button = "#{action.downcase}_button".to_sym
62
+ on ProposalSummary do |page|
63
+ page.send(button).should exist
64
+ page.proposal_actions
65
+ end
66
+ on(ProposalActions).send(button).should exist
67
+ end
68
+
69
+ When /^the (.*) user approves the proposal$/ do |role|
70
+ get(role).sign_in
71
+ @proposal.open_proposal
72
+ on(ProposalSummary).approve
73
+ on(Confirmation).yes
74
+ end
@@ -0,0 +1,73 @@
1
+ And /^I? ?activate a validation check$/ do
2
+ on(Proposal).proposal_actions
3
+ on ProposalActions do |page|
4
+ page.show_data_validation
5
+ page.turn_on_validation
6
+ end
7
+ end
8
+
9
+ When /^the proposal has no principal investigator$/ do
10
+ #nothing needed for this step
11
+ end
12
+
13
+ Then /^a validation error should say (.*)$/ do |error|
14
+ errors = {'there is no principal investigator' => 'There is no Principal Investigator selected. Please enter a Principal Investigator.',
15
+ 'proposal questions were not answered' => 'Answer is required for Question 1 in group A. Proposal Questions.',
16
+ 'sponsor deadline date not entered' => 'Sponsor deadline date has not been entered.',
17
+ 'questionnaire must be completed' => %|You must complete the questionnaire "S2S FAT & Flat Questionnaire"|,
18
+ 'you must complete the compliance question' => 'Answer is required for Question 1 in group B. Compliance.',
19
+ 'the investigator needs to be certified' => 'The Investigators are not all certified. Please certify Dick COIAdmin.',
20
+ 'the key person needs to be certified' => 'The Investigators are not all certified. Please certify Jeff Covey.'}
21
+ on(ProposalActions).validation_errors_and_warnings.should include errors[error]
22
+ end
23
+
24
+ Then /^one of the validation errors should say that (.*)$/ do |error|
25
+ errors = { 'an original proposal ID is needed'=>'Please provide an original institutional proposal ID that has been previously submitted to Grants.gov for a Change\/Corrected Application.',
26
+ 'the prior award number is required'=>'require the sponsor\'s prior award number in the "sponsor proposal number."'}
27
+ on(ProposalActions).validation_errors_and_warnings.any? { |item| item=~/#{errors[error]}/ }.should be true
28
+ end
29
+
30
+ When /^I? ?do not answer my proposal questions$/ do
31
+ #nothing necessary for this step
32
+ end
33
+
34
+ When /^I? ?initiate a proposal with an un-certified (.*)$/ do |role|
35
+ @role = role
36
+ @proposal = create ProposalDevelopmentObject
37
+ @proposal.add_key_person role: @role, certified: false
38
+ end
39
+
40
+ Given /^I? ?initiate a proposal where the un-certified key person has certification questions$/ do
41
+ @role = 'Key Person'
42
+ @proposal = create ProposalDevelopmentObject
43
+ @proposal.add_key_person role: @role, key_person_role: 'default', certified: false
44
+ on(KeyPersonnel).include_certification_questions @proposal.key_personnel.uncertified_key_person(@role).full_name
45
+ end
46
+
47
+ Then /^checking the key personnel page shows an error that says (.*)$/ do |error|
48
+ on(ProposalActions).key_personnel
49
+ errors = {'there is no principal investigator' => 'There is no Principal Investigator selected. Please enter a Principal Investigator.'
50
+ }
51
+ on(KeyPersonnel).errors.should include errors[error]
52
+ end
53
+
54
+ Then /^checking the proposal page shows an error that says (.*)$/ do |error|
55
+ on(ProposalActions).proposal
56
+ errors = {'sponsor deadline date not entered' => 'Sponsor deadline date has not been entered.'
57
+ }
58
+ on(Proposal).errors.should include errors[error]
59
+ end
60
+
61
+ Then /^checking the questions page shows an error that says (.*)$/ do |error|
62
+ on(Proposal).questions
63
+ errors = {'proposal questions were not answered' => 'Answer is required for Question 1 in group A. Proposal Questions.',
64
+ 'questionnaire must be completed' => %|You must complete the questionnaire "S2S FAT & Flat Questionnaire"|,
65
+ 'you must complete the compliance question' => 'Answer is required for Question 1 in group B. Compliance.'
66
+ }
67
+ on(Questions).errors.should include errors[error]
68
+ end
69
+
70
+ Then /^checking the key personnel page shows a proposal person certification error that says the investigator needs to be certified$/ do
71
+ on(ProposalActions).key_personnel
72
+ on(KeyPersonnel).errors.should include "The Investigators are not all certified. Please certify #{@proposal.key_personnel.uncertified_person(@role).full_name}."
73
+ end
@@ -0,0 +1,141 @@
1
+ When /^I? ?visit the proposal's (.*) page$/ do |page|
2
+ # Ensure we're where we need to be in the system...
3
+ @proposal.open_document
4
+ # Be sure that the page name used in the scenario
5
+ # will be converted to the snake case value of
6
+ # the method that clicks on the proposal's page tab.
7
+ on(Proposal).send(snake_case(page))
8
+ end
9
+
10
+ Then /^the (.*) user is listed as an? (.*) in the proposal permissions$/ do |username, role|
11
+ on(Permissions).assigned_role(get(username).user_name).should include role
12
+ end
13
+
14
+ When /^I? ?assign the (.*) user as an? (.*) in the proposal permissions$/ do |system_role, role|
15
+ set(system_role, (make UserObject, role: system_role))
16
+ @proposal.permissions.send(snake_case(role+'s')) << get(system_role).user_name
17
+ @proposal.permissions.assign
18
+ end
19
+
20
+ Then /^the (.*) user can access the proposal$/ do |role|
21
+ get(role).sign_in
22
+ @proposal.open_proposal
23
+ on(Researcher).error_table.should_not be_present
24
+ end
25
+
26
+ Then /^the proposal is in the (.*) user's action list$/ do |username|
27
+ get(username).sign_in
28
+ visit(ActionList).filter
29
+ on ActionListFilter do |page|
30
+ page.document_title.set @proposal.project_title
31
+ page.filter
32
+ end
33
+ on(ActionList).item_row(@proposal.document_id).should exist
34
+ end
35
+
36
+ And /^their proposal permissions allow them to only update the Abstracts and Attachments page$/ do
37
+ on(Proposal).abstracts_and_attachments
38
+ @proposal.close
39
+ on(Confirmation).yes
40
+ end
41
+
42
+ And /^their proposal permissions allow them to edit all parts of the proposal$/ do
43
+ on Proposal do |page|
44
+ page.save_button.should be_present
45
+ page.abstracts_and_attachments
46
+ end
47
+ on AbstractsAndAttachments do |page|
48
+ page.save_button.should be_present
49
+ page.custom_data
50
+ end
51
+ on PDCustomData do |page|
52
+ page.save_button.should be_present
53
+ page.key_personnel
54
+ end
55
+ on KeyPersonnel do |page|
56
+ page.save_button.should be_present
57
+ page.permissions
58
+ end
59
+ on Permissions do |page|
60
+ page.save_button.should be_present
61
+ page.proposal_actions
62
+ end
63
+ on ProposalActions do |page|
64
+ page.save_button.should be_present
65
+ page.questions
66
+ end
67
+ on Questions do |page|
68
+ page.save_button.should be_present
69
+ page.special_review
70
+ end
71
+ on SpecialReview do |page|
72
+ page.save_button.should be_present
73
+ end
74
+ end
75
+
76
+ And /^their proposal permissions allow them to only update the budget$/ do
77
+ on(Proposal).budget_versions
78
+ @proposal.close
79
+ on(Confirmation).yes
80
+ end
81
+
82
+ And /^their proposal permissions allow them to only read the proposal$/ do
83
+ on Proposal do |page|
84
+ page.save_button.should_not be_present
85
+ page.abstracts_and_attachments
86
+ end
87
+ on AbstractsAndAttachments do |page|
88
+ page.save_button.should_not be_present
89
+ page.custom_data
90
+ end
91
+ on PDCustomData do |page|
92
+ page.save_button.should_not be_present
93
+ page.key_personnel
94
+ end
95
+ on KeyPersonnel do |page|
96
+ page.save_button.should_not be_present
97
+ page.permissions
98
+ end
99
+ on Permissions do |page|
100
+ page.save_button.should_not be_present
101
+ page.proposal_actions
102
+ end
103
+ on ProposalActions do |page|
104
+ page.save_button.should_not be_present
105
+ page.questions
106
+ end
107
+ on Questions do |page|
108
+ page.save_button.should_not be_present
109
+ page.special_review
110
+ end
111
+ on SpecialReview do |page|
112
+ page.save_button.should_not be_present
113
+ end
114
+ end
115
+
116
+ And /^their proposal permissions allow them to delete the proposal$/ do
117
+ on(Proposal).proposal_actions
118
+ @proposal.delete
119
+ end
120
+
121
+ Then /^there should be an error message that says not to select other roles alongside aggregator$/ do
122
+ on(Roles).errors.should include 'Do not select other roles when Aggregator is selected.'
123
+ end
124
+
125
+ When /^I? ?attempt to add an additional proposal role to the (.*) user$/ do |system_role|
126
+ role = [:viewer, :budget_creator, :narrative_writer, :aggregator].sample
127
+ on(Permissions).edit_role.(get(system_role).user_name)
128
+ on Roles do |page|
129
+ page.use_new_tab
130
+ page.send(role).set
131
+ page.save
132
+ end
133
+ end
134
+
135
+ Then /^the (.*) user should not be listed as an? (.*) in the second proposal$/ do |system_role, role|
136
+ user = get(system_role)
137
+ @proposal2.view :permissions
138
+ on Permissions do |page|
139
+ page.assigned_to_role(role).should_not include "#{user.first_name} #{user.last_name}"
140
+ end
141
+ end
@@ -0,0 +1,81 @@
1
+ # This step mentions user roles because it best fits into the context of
2
+ # our 'Given we have users with the roles' step
3
+ When /^I? ?send a notification to the (.*) users?$/ do |role|
4
+ role = role.split(', ')
5
+
6
+ on(PDCustomData).proposal_actions
7
+ role.each do |role|
8
+ user_name = get(role).user_name
9
+
10
+ on ProposalActions do |page|
11
+ page.send_notification
12
+ page.employee_search
13
+ end
14
+ on PersonLookup do |page|
15
+ page.user_name.set user_name
16
+ page.search
17
+ page.return_value user_name
18
+ end
19
+ on(ProposalActions).add
20
+ end
21
+ on(NotificationEditor).send_fyi
22
+ end
23
+
24
+ When /^I? ?recall the proposal for revisions$/ do
25
+ @proposal.recall :revisions
26
+ end
27
+
28
+ When /^I? ?recall and cancel the proposal$/ do
29
+ @proposal.recall :cancel
30
+ end
31
+
32
+ Then /^the proposal status should be (.*)$/ do |status|
33
+ @proposal.status.should == status
34
+ end
35
+
36
+ Then(/^I should receive an action list item with the requested action being: (.*)$/) do |action|
37
+ visit ActionList do |page|
38
+ page.last
39
+ # This code is needed because the list refresh
40
+ # may not happen immediately...
41
+ x = 0
42
+ while x < 4
43
+ break if page.item_row(@proposal.document_id.to_i + 1).exists?
44
+ sleep 1
45
+ # The page refresh is necessary because the proposal
46
+ # may reach the user's action list with delay
47
+ page.refresh
48
+ # After a refresh, you'll need to visit the last page
49
+ # again to view most recent proposals
50
+ page.last
51
+ x += 1
52
+ end
53
+ page.action_requested(@proposal.document_id.to_i + 1).should == action
54
+ end
55
+ end
56
+
57
+ Then /^I can acknowledge the requested action list item$/ do
58
+ on ActionList do |page|
59
+ page.action(@proposal.document_id.to_i + 1).select 'FYI'
60
+ page.take_actions
61
+ end
62
+ end
63
+
64
+ When /^I? ?submit the routed proposal to the sponsor$/ do
65
+
66
+
67
+
68
+ sleep 30
69
+
70
+
71
+
72
+ @proposal.submit :to_sponsor
73
+ end
74
+
75
+ When /^I? ?submit the proposal to S2S$/ do
76
+ @proposal.submit :to_s2s
77
+ end
78
+
79
+ When(/^I? ?blanket approve the proposal$/) do
80
+ @proposal.blanket_approve
81
+ end