kuality-coeus 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODk5YjMzNTg3YTUzNWM5NTc3NzYxYWFhNTJhM2UyZWE0MzgyOTIzNA==
4
+ NzNjNDI3MmRjZjFkNDc3MjNhNmNkOTFmYWE1MjdjNTM2MGZkNDA5ZA==
5
5
  data.tar.gz: !binary |-
6
- ZmM2YjY1NTc1ZGY3OTMyZmFkYWJhZDdlNzg3M2RhMDRjMjg0MDljNw==
6
+ ZDlhYzIzYjllYTc1ZWI2MTcwYTBhNzZjZGNkOTgzMmM1OWRiYWRmOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjhlODJkODQ4ZWM4NjFkZjEzMTZlZjI1YzBiYzMxZTJhZjM2ZmU0MDQ4Njdl
10
- OTRiZTI5ZjA1Njg4OTEwMDRiYjk5MmVkNGZlOTA0NzliMTkyMzlhNzQxMzU0
11
- ZDA0MTQzZDM5YjMyNTA2YjQ0MDQwNDAyYjgzYTNjMTk1ZDgzYjE=
9
+ YjBhZjM5NzRhMTJlNDlhYWEzMTVjNWIwOTExOTU2MjJlMTgxMGNiNDk5MGMw
10
+ NzYwYjExZjcxZTlkNjQ2OTQzODkxMjQ4YTkyNGZiOTNkZDA4MGJhNjY5OGYx
11
+ ZmVlZDY5MjVlMjVjMjAyM2NlZGRjM2UxOTI4NjY0YmJkZjk1ZjA=
12
12
  data.tar.gz: !binary |-
13
- NzMwMmNlMWJhOGQ5MTk2YzM2ZGI3MjIzMGFiODE3NjZhMDYzZjBlNzBjOTU0
14
- OWU2ZDc4MWRhYWU4YTZmMmI4ZmQ0NmNlMDNkN2RmNTFkNzZiZDNmNTc1YjA5
15
- ZDNkNGNmZWY1N2NlNmQ4ODk2NDZlZTI0ODYwNmRkNDYxZmE3ZDQ=
13
+ NWE0MDkxODJmNzgxODNiN2VjOTA0MGE2OWQ4YzIzOWMyODRlMTJiOWQ5YTFj
14
+ YjYyMzAwYTM2NjUwZTg0NTU2NDQxMGJiZmE5YTY4NWE4NmM5ZjI4NGJmZmJj
15
+ NzcwNzE3NDQ2YTgyYWIxMzY3NWY1NzRiMzA0ZjIyMDc0M2Q4Nzc=
@@ -6,7 +6,7 @@ Feature: Creating proposals
6
6
  Background: Logged in with a proposal creator user
7
7
  Given a user exists with the system role: 'Proposal Creator'
8
8
  And I log in with the Proposal Creator user
9
-
9
+ @test
10
10
  Scenario: Attempt to save a proposal missing a required field
11
11
  When I initiate a proposal but miss a required field
12
12
  Then I should see an error that says the field is required
@@ -1 +1,12 @@
1
-
1
+ Given /^I have a test$/ do
2
+ user = make_user user: 'admin'
3
+ x = 0
4
+ while x = 0 do
5
+ user.sign_in
6
+ visit DocumentSearch do |page|
7
+ page.date_created_from.set '01/01/2012'
8
+ page.search
9
+ end
10
+ user.sign_out
11
+ end
12
+ end
@@ -52,9 +52,7 @@ Given /^users exist with the following roles: (.*)$/ do |roles|
52
52
  end
53
53
 
54
54
  Given /^a user exists that can be a PI for Grants.gov proposals$/ do
55
- # TODO: Make this more robust when we really know what it takes
56
- # to be a grants.gov PI...
57
- @grants_gov_pi = make_user user: UserObject::USERS.era_commons_user('grantsgov')
55
+ @grants_gov_pi = make_user user: UserObject::USERS.grants_gov_pi
58
56
  @grants_gov_pi.create unless @grants_gov_pi.exists?
59
57
  end
60
58
 
@@ -1,15 +1,8 @@
1
- Feature: Submitting Proposals via s2s to Grants.gov
1
+ Feature: test
2
2
 
3
- As a researcher, I want the ability to submit my completed proposals
4
- through to grants.gov
3
+ As a test
4
+ I want to test
5
+ so I can test
5
6
 
6
- Background: Logged in with a proposal creator; have other necessary user
7
- Given a user exists with the system role: 'Proposal Creator'
8
- And I log in with the Proposal Creator user
9
- @test
10
- Scenario: bal
11
- Given I initiate a proposal with NIH as the sponsor
12
- And create a budget version for the proposal
13
- And add an employee to the budget's project personnel
14
- And add a non-employee to the budget's project personnel
15
- And add a to-be-named person to the budget's project personnel
7
+ Scenario: test
8
+ Given I have a test
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kuality-coeus'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
  s.summary = %q{rSmart's test framework for BDD testing of Kuali Coeus}
5
5
  s.description = %q{This gem is used for creating test scripts for Kuali Coeus.}
6
6
  s.files = Dir.glob("**/**/**")
@@ -3,6 +3,7 @@ class GroupObject
3
3
  include Foundry
4
4
  include DataFactory
5
5
  include Navigation
6
+ include StringFactory
6
7
 
7
8
  attr_accessor :id, :namespace, :name, :description, :type,
8
9
  :principal_name, :assignees
@@ -10,10 +11,31 @@ class GroupObject
10
11
  def initialize(browser, opts={})
11
12
  @browser = browser
12
13
 
14
+ defaults = {
15
+ type: 'Default',
16
+ namespace: '::random::',
17
+ name: random_alphanums,
18
+ description: random_alphanums,
19
+ assignees: AssigneesCollection.new
20
+ }
21
+
22
+ set_options(defaults.merge(opts))
13
23
  end
14
24
 
15
25
  def create
16
26
 
17
27
  end
18
28
 
29
+ def add_assignee(opts={})
30
+ assignee = make AssigneeObject, opts
31
+ assignee.create
32
+ @assignees << assignee
33
+ end
34
+
35
+ # =========
36
+ private
37
+ # =========
38
+
39
+
40
+
19
41
  end
@@ -223,6 +223,7 @@ class ProposalDevelopmentObject
223
223
  page.send_fyi
224
224
  end
225
225
  elsif type == :to_s2s
226
+ view :s2s
226
227
  on S2S do |page|
227
228
  @status=page.document_status
228
229
  end
@@ -29,11 +29,12 @@ class UserCollection < Hash
29
29
  self.find_all{|user| user[1][:primary_dept_code]==code }.shuffle
30
30
  end
31
31
 
32
- # This is a short cut to "knowing" which user can be used as a PI for
33
- # a Grants.gov proposal. At some point this should be eliminated--as in,
34
- # when we know better what exactly a grants.gov PI requires.
35
- def era_commons_user(username)
36
- self.find{ |user| user[1][:era_commons_user_name]==username }[0]
32
+ def grants_gov_pi
33
+ self.find_all { |user| !user[1][:primary_department_code].nil? &&
34
+ !user[1][:phones].find{|phone| phone[:type]=='Work'}.nil? &&
35
+ !user[1][:emails].find{|email| email[:type]=='Work'}.nil? &&
36
+ !user[1][:era_commons_user_name].nil?
37
+ }.shuffle[0][0]
37
38
  end
38
39
 
39
40
  end
@@ -99,9 +100,10 @@ class UserObject
99
100
  opts[:user]
100
101
  when opts.key?(:role)
101
102
  USERS.have_role(ROLES[opts[:role]])[0][0]
103
+ else
104
+ :nil
102
105
  end
103
- defaults = USERS[@user_name]
104
- options = defaults.nil? ? opts : defaults.merge(opts)
106
+ options = USERS[@user_name].nil? ? opts : USERS[@user_name].merge(opts)
105
107
  set_options options
106
108
  end
107
109
 
@@ -0,0 +1,42 @@
1
+ class AssigneeObject
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include Navigation
6
+ include StringFactory
7
+
8
+ attr_accessor :type_code, :member_identifier
9
+
10
+ def initialize(browser, opts={})
11
+ @browser = browser
12
+
13
+ defaults = {
14
+ type_code: 'Principal'
15
+ }
16
+
17
+ set_options(defaults.merge(opts))
18
+ requires :member_identifier
19
+ end
20
+
21
+ def create
22
+ on Group do |page|
23
+ page.description.set random_alphanums
24
+ fill_out page, :type_code, :member_identifier
25
+ page.add_member
26
+ page.save
27
+ end
28
+ end
29
+
30
+ # =========
31
+ private
32
+ # =========
33
+
34
+
35
+
36
+ end
37
+
38
+ class AssigneesCollection < Array
39
+
40
+
41
+
42
+ end
@@ -1,7 +1,36 @@
1
1
  class Group < BasePage
2
2
 
3
3
  description_field
4
+ error_messages
5
+ global_buttons
6
+ tab_buttons
4
7
 
8
+ value(:id) { |b| b.overview_tab.table[0][1].text }
5
9
 
10
+ # DANGER!
11
+ # Note: these elements are dynamic, in that they are either
12
+ # editable fields or text strings, depending on whether you're creating
13
+ # or editing the group...
14
+ element(:namespace) { |b| b.gnspc_select.present? ? b.gnspc_select : b.gnsp_ro }
15
+ element(:name) { |b| b.gr_nm.present? b.gr_nm : b.gr_nm.ro }
16
+
17
+ element(:type_code) { |b| b.frm.select(name: 'member.memberTypeCode') }
18
+ element(:member_identifier) { |b| b.frm.text_field(name: 'member.memberId') }
19
+ element(:member_name) { |b| b.frm.text_field(name: 'member.memberName') }
20
+ action(:add_member) { |b| b.frm.button(name: 'methodToCall.addMember.anchorAssignees').click; b.loading }
21
+
22
+ action(inactivate_member) { |member, b| b.assignees_table.row(text: /#{member}/).button(name: /methodToCall.deleteMember/).click; b.loading }
23
+
24
+ # =========
25
+ private
26
+ # =========
27
+
28
+ element(:overview_tab) { |b| b.frm.div(id: 'tab-Overview-div') }
29
+ element(:assignees_tab) { |b| b.frm.div(id: 'tab-Assignees-div') }
30
+ element(:gnspc_select) { |b| b.frm.select(name: 'document.groupNamespace') }
31
+ value(:gnspc_ro) { |b| b.overview_tab.table[1][1].text }
32
+ element(:gr_nm) { |b| b.frm.text_field(name: 'document.groupName') }
33
+ value(:gr_nm_ro) { |b| b.overview_tab.table[1][3].text }
34
+ element(:assignees_table) { |b| b.assignees_tab.div(class: 'tab-container').table(index: 1) }
6
35
 
7
36
  end
@@ -3,6 +3,7 @@ class DocumentSearch < Lookups
3
3
  page_url "#{$base_url}portal.do?channelTitle=Document%20Search&channelUrl=#{$base_url[/^.+com/]+':'+$base_url[/(?<=com)(\/.+\/)$/]}kew/DocumentSearch.do?"
4
4
 
5
5
  element(:document_id) { |b| b.frm.text_field(id: 'documentId') }
6
+ element(:date_created_from) { |b| b.frm.text_field(name: 'rangeLowerBoundKeyPrefix_dateCreated') }
6
7
 
7
8
  action(:open_doc) { |document_id, b| b.frm.link(text: document_id).click; b.use_new_tab }
8
9
  action(:doc_status) { |document_id, b| b.results_table.row(text: /#{document_id}/)[3].text }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuality-coeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abraham Heward
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-27 00:00:00.000000000 Z
12
+ date: 2013-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-factory
@@ -134,6 +134,7 @@ files:
134
134
  - lib/kuality-coeus/page_objects/financial_entities/new_financial_entity.rb
135
135
  - lib/kuality-coeus/page_objects/financial_entities/reporter.rb
136
136
  - lib/kuality-coeus/page_objects/financial_entities.rb
137
+ - lib/kuality-coeus/page_objects/identity/assignee.rb
137
138
  - lib/kuality-coeus/page_objects/identity/group.rb
138
139
  - lib/kuality-coeus/page_objects/identity/person.rb
139
140
  - lib/kuality-coeus/page_objects/institutional_proposal/contacts.rb