kuality-coeus 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/features/proposal_development/create_proposal.feature +1 -1
- data/features/step_definitions/test.rb +12 -1
- data/features/step_definitions/users.rb +1 -3
- data/features/test.feature +6 -13
- data/kuality-coeus.gemspec +1 -1
- data/lib/kuality-coeus/data_objects/identity/group.rb +22 -0
- data/lib/kuality-coeus/data_objects/proposal_development/proposal_development.rb +1 -0
- data/lib/kuality-coeus/data_objects/user.rb +9 -7
- data/lib/kuality-coeus/page_objects/identity/assignee.rb +42 -0
- data/lib/kuality-coeus/page_objects/identity/group.rb +29 -0
- data/lib/kuality-coeus/page_objects/lookup_pages/document_search.rb +1 -0
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                NzNjNDI3MmRjZjFkNDc3MjNhNmNkOTFmYWE1MjdjNTM2MGZkNDA5ZA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                ZDlhYzIzYjllYTc1ZWI2MTcwYTBhNzZjZGNkOTgzMmM1OWRiYWRmOA==
         | 
| 7 7 | 
             
            !binary "U0hBNTEy":
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                YjBhZjM5NzRhMTJlNDlhYWEzMTVjNWIwOTExOTU2MjJlMTgxMGNiNDk5MGMw
         | 
| 10 | 
            +
                NzYwYjExZjcxZTlkNjQ2OTQzODkxMjQ4YTkyNGZiOTNkZDA4MGJhNjY5OGYx
         | 
| 11 | 
            +
                ZmVlZDY5MjVlMjVjMjAyM2NlZGRjM2UxOTI4NjY0YmJkZjk1ZjA=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 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
         | 
| @@ -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 | 
            -
               | 
| 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 |  | 
    
        data/features/test.feature
    CHANGED
    
    | @@ -1,15 +1,8 @@ | |
| 1 | 
            -
            Feature:  | 
| 1 | 
            +
            Feature: test
         | 
| 2 2 |  | 
| 3 | 
            -
              As a  | 
| 4 | 
            -
               | 
| 3 | 
            +
              As a test
         | 
| 4 | 
            +
              I want to test
         | 
| 5 | 
            +
              so I can test
         | 
| 5 6 |  | 
| 6 | 
            -
               | 
| 7 | 
            -
                Given  | 
| 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
         | 
    
        data/kuality-coeus.gemspec
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            spec = Gem::Specification.new do |s|
         | 
| 2 2 | 
             
              s.name = 'kuality-coeus'
         | 
| 3 | 
            -
              s.version = '0.0. | 
| 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
         | 
| @@ -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 | 
            -
               | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 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 | 
            -
                 | 
| 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 | 
            +
              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- | 
| 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
         |