kuality-coeus 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rspec"
4
+ gem "cucumber"
5
+ gem "test-factory", ">=0.1.3"
6
+ gem "watir-webdriver", ">=0.6.1"
data/Gemfile.lock ADDED
@@ -0,0 +1,47 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.3.2)
5
+ builder (3.0.4)
6
+ childprocess (0.3.6)
7
+ ffi (~> 1.0, >= 1.0.6)
8
+ cucumber (1.2.1)
9
+ builder (>= 2.1.2)
10
+ diff-lcs (>= 1.1.3)
11
+ gherkin (~> 2.11.0)
12
+ json (>= 1.4.6)
13
+ diff-lcs (1.1.3)
14
+ ffi (1.1.5)
15
+ gherkin (2.11.5)
16
+ json (>= 1.4.6)
17
+ json (1.7.5)
18
+ libwebsocket (0.1.5)
19
+ addressable
20
+ multi_json (1.3.7)
21
+ rspec (2.11.0)
22
+ rspec-core (~> 2.11.0)
23
+ rspec-expectations (~> 2.11.0)
24
+ rspec-mocks (~> 2.11.0)
25
+ rspec-core (2.11.1)
26
+ rspec-expectations (2.11.3)
27
+ diff-lcs (~> 1.1.3)
28
+ rspec-mocks (2.11.3)
29
+ rubyzip (0.9.9)
30
+ selenium-webdriver (2.26.0)
31
+ childprocess (>= 0.2.5)
32
+ libwebsocket (~> 0.1.3)
33
+ multi_json (~> 1.0)
34
+ rubyzip
35
+ test-factory (0.1.3)
36
+ watir-webdriver (>= 0.6.1)
37
+ watir-webdriver (0.6.1)
38
+ selenium-webdriver (>= 2.18.0)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ cucumber
45
+ rspec
46
+ test-factory (>= 0.1.3)
47
+ watir-webdriver (>= 0.6.1)
@@ -0,0 +1,13 @@
1
+ spec = Gem::Specification.new do |s|
2
+ s.name = 'kuality-coeus'
3
+ s.version = '0.0.1'
4
+ s.summary = %q{rSmart's test framework for BDD testing of Kuali Coeus}
5
+ s.description = %q{This gem is used for creating test scripts for Kuali Coeus.}
6
+ s.files = Dir.glob("**/**/**")
7
+ s.files.reject! { |file_name| file_name =~ /.yml$/ }
8
+ s.authors = ["Abraham Heward", "Jon Utter"]
9
+ s.email = %w{"aheward@rsmart.com" "jutter@rsmart.com"}
10
+ s.homepage = 'https://github.com/rSmart'
11
+ s.add_dependency 'test-factory', '>= 0.2.0'
12
+ s.required_ruby_version = '>= 1.9.3'
13
+ end
@@ -0,0 +1,65 @@
1
+ class CommitteeDocumentObject
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include StringFactory
6
+ include Navigation
7
+
8
+ attr_accessor :description, :committee_id, :document_id, :status, :committee_name,
9
+ :home_unit, :min_members_for_quorum, :maximum_protocols,
10
+ :adv_submission_days, :review_type, :last_updated, :updated_user,
11
+ :initiator
12
+
13
+ def initialize(browser, opts={})
14
+ @browser = browser
15
+
16
+ defaults = {
17
+ description: random_alphanums,
18
+ committee_id: random_alphanums,
19
+ home_unit: "000001",
20
+ committee_name: random_alphanums,
21
+ min_members_for_quorum: rand(100).to_s,
22
+ maximum_protocols: rand(100).to_s,
23
+ adv_submission_days: rand(365).to_s,
24
+ review_type: "Full"
25
+ }
26
+ set_options(defaults.merge(opts))
27
+ end
28
+
29
+ def create
30
+ go_to_central_admin
31
+ on(CentralAdmin).add_irb_committee
32
+ on Committee do |comm|
33
+ @document_id=comm.document_id
34
+ @initiator=comm.initiator
35
+ @status=comm.status
36
+ comm.description.set @description
37
+ comm.committee_id.set @committee_id
38
+ comm.committee_name.set @committee_name
39
+ comm.home_unit.set @home_unit
40
+ comm.min_members_for_quorum.set @min_members_for_quorum
41
+ comm.maximum_protocols.set @maximum_protocols
42
+ comm.adv_submission_days
43
+ comm.save
44
+ end
45
+ end
46
+
47
+ def edit opts={}
48
+
49
+ set_options(opts)
50
+ end
51
+
52
+ def submit
53
+ # TODO: Add conditional navigation here
54
+ # Currently this method assumes you're already
55
+ # on the relevant Committee document page.
56
+ on(Committee).submit
57
+ end
58
+
59
+ def view
60
+
61
+ end
62
+
63
+ end
64
+
65
+
@@ -0,0 +1,53 @@
1
+ class ProposalDevelopmentObject
2
+
3
+ include Foundry
4
+ include DataFactory
5
+ include StringFactory
6
+ include DateFactory
7
+ include Navigation
8
+
9
+ attr_accessor :description, :type, :lead_unit, :activity_type, :project_title,
10
+ :sponsor_code, :start_date, :end_date
11
+
12
+ def initialize(browser, opts={})
13
+ @browser = browser
14
+ defaults = {
15
+ description: random_alphanums,
16
+ type: "New",
17
+ lead_unit: :random,
18
+ activity_type: :random,
19
+ project_title: random_alphanums,
20
+ sponsor_code: "000500",
21
+ start_date: next_week[:custom].strftime("%m/%d/%Y"),
22
+ end_date: next_year[:custom].strftime("%m/%d/%Y")
23
+ }
24
+ set_options(defaults.merge(opts))
25
+ end
26
+
27
+ def create
28
+ visit(Researcher).create_proposal
29
+ on Proposal do |doc|
30
+ if @lead_unit==:random
31
+ @lead_unit=doc.lead_unit.select_at_random
32
+ else
33
+ doc.lead_unit.select @lead_unit
34
+ end
35
+ end
36
+ end
37
+
38
+ def edit opts={}
39
+
40
+ set_options(opts)
41
+ end
42
+
43
+ def view
44
+
45
+ end
46
+
47
+ def delete
48
+
49
+ end
50
+
51
+ end
52
+
53
+
@@ -0,0 +1,69 @@
1
+ class UserObject
2
+
3
+ include Foundry
4
+ include DataFactory
5
+
6
+ attr_accessor :name, :username, :email, :password, :role
7
+
8
+ def initialize(browser, opts={})
9
+ @browser = browser
10
+ defaults = {
11
+ #name: "Tester Ten",
12
+ username: "admin",
13
+ #email: "test10@customer1.herokuapp.com",
14
+ #password: "test10"
15
+ }
16
+ set_options defaults.merge(opts)
17
+ end
18
+
19
+ def edit opts={}
20
+
21
+ end
22
+
23
+ def sign_in
24
+ if logged_out?
25
+ user_login
26
+ else # Log the current user out, then log in
27
+ log_out
28
+ user_login
29
+ end
30
+ end
31
+ alias_method :log_in, :sign_in
32
+
33
+ def logged_in?
34
+ if login_info.present?
35
+ login_info.text=~/#{@name}/ ? true : false
36
+ else
37
+ false
38
+ end
39
+ end
40
+
41
+ def logged_out?
42
+ !logged_in?
43
+ end
44
+
45
+ def log_out
46
+ s_o.click if s_o.present?
47
+ end
48
+ alias_method :sign_out, :log_out
49
+
50
+ #========
51
+ private
52
+ #========
53
+
54
+ def user_login
55
+ visit Login do |log_in|
56
+ log_in.username.set @name
57
+ log_in.login
58
+ end
59
+ end
60
+
61
+ def s_o
62
+ @browser.button(value: "Logout")
63
+ end
64
+
65
+ def login_info
66
+ @browser.div(id: "login-info")
67
+ end
68
+
69
+ end
@@ -0,0 +1,3 @@
1
+ module Navigation
2
+
3
+ end
@@ -0,0 +1,35 @@
1
+ class BasePage < PageFactory
2
+
3
+ class << self
4
+
5
+ def frame_element
6
+ element(:frm) { |b| b.frame(id: "iframeportlet") }
7
+ end
8
+
9
+ def document_header_elements
10
+ element(:headerinfo_table) { |b| b.div(class: "headerbox").table(class: "headerinfo") }
11
+
12
+ value(:document_id) { |p| p.headerinfo_table[0][1].text }
13
+ alias_method :doc_nbr, :document_id
14
+ value(:status) { |p| p.headerinfo_table[0][3].text }
15
+ value(:initiator) { |p| p.headerinfo_table[1][1].text }
16
+ value(:last_updated) {|p| p.headerinfo_table[1][3].text }
17
+ alias_method :created, :last_updated
18
+ value(:committee_id) { |p| p.headerinfo_table[2][1].text }
19
+ alias_method :sponsor_name, :committee_id
20
+ value(:committee_name) { |p| p.headerinfo_table[2][3].text }
21
+ alias_method :pi, :committee_name
22
+ end
23
+
24
+ def global_buttons
25
+ action(:expand_all) { |b| b.image(name: "methodToCall.showAllTabs").click } # TODO: Think about moving this into its own element group
26
+ action(:submit) { |b| b.image(class: "globalbuttons", title: "submit").click }
27
+ action(:save) { |b| b.image(class: "globalbuttons", title: "save").click }
28
+ action(:blanket_approve) { |b| b.image(class: "globalbuttons", title: "blanket approve").click }
29
+ action(:close) { |b| b.image(class: "globalbuttons", title: "close").click }
30
+ action(:cancel) { |b| b.image(class: "globalbuttons", title: "cancel").click }
31
+ end
32
+
33
+ end
34
+
35
+ end
@@ -0,0 +1,7 @@
1
+ class CentralAdmin < BasePage
2
+
3
+ page_url "#{$base_url}selectedTab=portalCentralAdminBody"
4
+
5
+ action(:create_committee) { |b| b.frm.link(title: "Create Committeee").click }
6
+
7
+ end
@@ -0,0 +1,21 @@
1
+ class Committee < CommitteeDocument
2
+
3
+ document_header_elements
4
+ committee_header_elements
5
+
6
+ element(:description) { |b| b.frm.text_field(id: "document.documentHeader.documentDescription") }
7
+ element(:committee_id) { |b| b.frm.text_field(id: "document.committeeList[0].committeeId") }
8
+ element(:committee_name) { |b| b.frm.text_field(id: "document.committeeList[0].committeeName") }
9
+ element(:home_unit) { |b| b.frm.text_field(id: "document.committeeList[0].homeUnitNumber") }
10
+ element(:min_members_for_quorum) { |b| b.frm.text_field(id: "document.committeeList[0].minimumMembersRequired") }
11
+ element(:maximum_protocols) { |b| b.frm.text_field(id: "document.committeeList[0].maxProtocols") }
12
+ element(:adv_submission_days) { |b| b.frm.text_field(id: "document.committeeList[0].advancedSubmissionDaysRequired") }
13
+ element(:review_type) { |b| b.frm.select(id: "document.committeeList[0].reviewTypeCode") }
14
+ value(:last_updated) { |p| p.com_table.row(text: /Last Updated:/).cell(index: -1).text }
15
+ value(:updated_user) { |p| p.com_table.row(text: /Updated User:/).cell(index: -1).text }
16
+
17
+ private
18
+
19
+ element(:com_table) { |b| b.frm.div(id: "tab-Committee-div").table }
20
+
21
+ end
@@ -0,0 +1,8 @@
1
+ class Members < CommitteeDocument
2
+
3
+ action(:employee_search) { |b| b.frm.image(name: "methodToCall.performLookup.(!!org.kuali.kra.bo.KcPerson!!).(((personId:committeeHelper.newCommitteeMembership.personId,fullName:committeeHelper.newCommitteeMembership.personName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor").click }
4
+ action(:non_employee_search) { |b| b.frm.image(name: "methodToCall.performLookup.(!!org.kuali.kra.bo.NonOrganizationalRolodex!!).(((rolodexId:committeeHelper.newCommitteeMembership.rolodexId,fullName:committeeHelper.newCommitteeMembership.personName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor").click }
5
+ action(:clear) { |b| b.frm.image(name: "methodToCall.clearCommitteeMembership").click }
6
+ action(:add_member) { |b| b.frm.image(name: "methodToCall.addCommitteeMembership").click }
7
+
8
+ end
@@ -0,0 +1,16 @@
1
+ class CommitteeDocument < BasePage
2
+
3
+ frame_element
4
+ global_buttons
5
+
6
+ class << self
7
+
8
+ def committee_header_elements
9
+ element(:committee) { |b| b.frm.button(value: "Committee") }
10
+ element(:members) { |b| b.frm.button(value: "Members") }
11
+ element(:schedule) { |b| b.frm.button(value: "Schedule") }
12
+ end
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,5 @@
1
+ class MyFinancialEntities < FinancialEntities
2
+
3
+ financial_entities_tabs
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ class NewFinancialEntity < FinancialEntities
2
+
3
+ financial_entities_tabs
4
+
5
+ end
@@ -0,0 +1,11 @@
1
+ class Reporter < FinancialEntities
2
+
3
+ financial_entities_tabs
4
+
5
+ element(:contact_info) { |b| b.frm.table(id: "response-table").table(class: "tab") }
6
+ element(:full_name) { |p| p.contact_info[0][1].text }
7
+
8
+ element(:unit_number) { |b| b.frm.text_field(id: "financialEntityHelper.newFinancialEntityReporterUnit.unitNumber") }
9
+
10
+
11
+ end
@@ -0,0 +1,16 @@
1
+ class FinancialEntities < BasePage
2
+
3
+ frame_element
4
+ global_buttons
5
+
6
+ class << self
7
+
8
+ def financial_entities_tabs
9
+ action(:reporter) { |b| b.frm.button(value: "Reporter").click }
10
+ action(:new_financial_entity) { |b| b.frm.button(value: "New Financial Entity").click }
11
+ action(:my_financial_entities) { |b| b.frm.button(value: "My Financial Entities").click }
12
+ end
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,9 @@
1
+ class Login < PageFactory
2
+
3
+ page_url $base_url
4
+ expected_title "Login"
5
+
6
+ element(:username) { |b| b.text_field(name: "__login_user") }
7
+ button "Login"
8
+
9
+ end
@@ -0,0 +1,12 @@
1
+ class Proposal < ProposalDevelopmentDocument
2
+
3
+ element(:description) { |b| b.frm.text_field(id: "document.documentHeader.documentDescription") }
4
+ element(:sponsor_code) { |b| b.frm.text_field(id: "document.developmentProposalList[0].sponsorCode") }
5
+ element(:proposal_type) { |b| b.frm.select(id: "document.developmentProposalList[0].proposalTypeCode") }
6
+ element(:lead_unit) { |b| b.frm.select(id: "document.developmentProposalList[0].ownedByUnitNumber") }
7
+ element(:project_start_date) { |b| b.frm.text_field(id: "document.developmentProposalList[0].requestedStartDateInitial") }
8
+ element(:project_end_date) { |b| b.frm.text_field(id: "document.developmentProposalList[0].requestedEndDateInitial") }
9
+ element(:activity_type) { |b| b.frm.select(id: "document.developmentProposalList[0].activityTypeCode") }
10
+ element(:project_title) { |b| b.frm.text_field(id: "document.developmentProposalList[0].title") }
11
+
12
+ end
@@ -0,0 +1,13 @@
1
+ class ProposalDevelopmentDocument < BasePage
2
+
3
+ frame_element
4
+
5
+ class << self
6
+
7
+ def proposal_header_elements
8
+
9
+ end
10
+
11
+ end
12
+
13
+ end
@@ -0,0 +1,7 @@
1
+ class Researcher < BasePage
2
+
3
+ page_url "#{$base_url}selectedTab=portalResearcherBody"
4
+
5
+ action(:create_proposal) { |b| b.frm.link(text: "Create Proposal").click }
6
+
7
+ end
@@ -0,0 +1,9 @@
1
+ class Unit < BasePage
2
+
3
+ page_url "#{$base_url}selectedTab=portalUnitBody"
4
+
5
+ frame_element
6
+
7
+ action(:add_proposal_development) { |b| b.frm.link(title: "Proposal Development", index: 0).click }
8
+
9
+ end
@@ -0,0 +1,30 @@
1
+ require 'test-factory'
2
+ Dir["#{File.dirname(__FILE__)}/kuality-coeus/*.rb"].each {|f| require f }
3
+ Dir["#{File.dirname(__FILE__)}/kuality-coeus/page_objects/*.rb"].each {|f| require f }
4
+ Dir["#{File.dirname(__FILE__)}/kuality-coeus/page_objects/*/*.rb"].each {|f| require f }
5
+ Dir["#{File.dirname(__FILE__)}/kuality-coeus/data_objects/*.rb"].each {|f| require f }
6
+
7
+ # Initialize this class at the start of your test cases to
8
+ # open the specified test browser at the specified Sakai welcome page URL.
9
+ #
10
+ # The initialization will
11
+ # create the @browser variable used throughout the page classes
12
+ class Kuality
13
+
14
+ attr_reader :browser
15
+
16
+ def initialize(web_browser)
17
+ if web_browser == :saucelabs
18
+ @browser = Watir::Browser.new(
19
+ :remote,
20
+ :url => "http://#{ENV['username']}:#{ENV['api_key']}@ondemand.saucelabs.com:80/wd/hub",
21
+ :desired_capabilities => $environment
22
+ )
23
+ else
24
+ @browser = Watir::Browser.new web_browser
25
+ @browser.window.resize_to(1400,900)
26
+ end
27
+ @browser.goto $base_url
28
+ end
29
+
30
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kuality-coeus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Abraham Heward
9
+ - Jon Utter
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-02-07 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: test-factory
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.2.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.2.0
31
+ description: This gem is used for creating test scripts for Kuali Coeus.
32
+ email:
33
+ - ! '"aheward@rsmart.com"'
34
+ - ! '"jutter@rsmart.com"'
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - Gemfile
40
+ - Gemfile.lock
41
+ - kuality-coeus.gemspec
42
+ - lib/kuality-coeus/data_objects/committee_document.rb
43
+ - lib/kuality-coeus/data_objects/proposal_development.rb
44
+ - lib/kuality-coeus/data_objects/user.rb
45
+ - lib/kuality-coeus/navigation.rb
46
+ - lib/kuality-coeus/page_objects/000_base_page.rb
47
+ - lib/kuality-coeus/page_objects/central_admin.rb
48
+ - lib/kuality-coeus/page_objects/committee/committee.rb
49
+ - lib/kuality-coeus/page_objects/committee/members.rb
50
+ - lib/kuality-coeus/page_objects/committee_document.rb
51
+ - lib/kuality-coeus/page_objects/financial_entities/my_financial_entities.rb
52
+ - lib/kuality-coeus/page_objects/financial_entities/new_financial_entity.rb
53
+ - lib/kuality-coeus/page_objects/financial_entities/reporter.rb
54
+ - lib/kuality-coeus/page_objects/financial_entities.rb
55
+ - lib/kuality-coeus/page_objects/login.rb
56
+ - lib/kuality-coeus/page_objects/proposal_development/proposal.rb
57
+ - lib/kuality-coeus/page_objects/proposal_development.rb
58
+ - lib/kuality-coeus/page_objects/researcher.rb
59
+ - lib/kuality-coeus/page_objects/unit.rb
60
+ - lib/kuality-coeus.rb
61
+ homepage: https://github.com/rSmart
62
+ licenses: []
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 1.9.3
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 1.8.24
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: rSmart's test framework for BDD testing of Kuali Coeus
85
+ test_files: []