watir_testlink_framework 0.0.1
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 +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +66 -0
- data/Rakefile +2 -0
- data/Rakefile.yml.sample +5 -0
- data/config.yml.sample +10 -0
- data/lib/tasks/rspec.rake +5 -0
- data/lib/tasks/testlink.rake +49 -0
- data/lib/watir_testlink_framework/version.rb +3 -0
- data/lib/watir_testlink_framework.rb +41 -0
- data/watir_testlink_framework.gemspec +29 -0
- metadata +156 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b34ca40bd580b3b6796acb10d683f20377d27e10
|
4
|
+
data.tar.gz: 2998596d8a2d01356f251f54f03094a3ae5bffc7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0f19fd6c5d194906310b36af97710534e00bf2e295546f55bf1f90708f1a078c4129b1bd54fac9084512d41f4962276ba3babb8f7649a0282ec9cbb4b2eddff4
|
7
|
+
data.tar.gz: 1b1cf88307bab383a89fdbbc1bad09a143ae16f65f4ae22347fe6d2061eb68c15480fb79d4813795728d833c6ea02ada6a8bb2d40eb8a7a40269af06d5e9fbdd
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Pim Snel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Watir TestLink Framework
|
2
|
+
|
3
|
+
This is a test framework organically grew in the Lingewoud software
|
4
|
+
lab. It combines a lot of other fine software like Watir, TestLink,
|
5
|
+
Rspec, Rake, Junit etc.. to make it easy to run large sets of test
|
6
|
+
cases on different stages of sites.
|
7
|
+
|
8
|
+
The Watir TestLink Framework can be used be a developer on his
|
9
|
+
desktop but can also be easily integrated in a CI server like
|
10
|
+
Jenkins. (see: https://github.com/mipmip/jenkins-workflow-typo3)
|
11
|
+
|
12
|
+
Use it in your web project testing project.
|
13
|
+
|
14
|
+
Major Features:
|
15
|
+
- Provides TestLink RPC connection
|
16
|
+
- Run test plans from testlink
|
17
|
+
- Implements the Watir Page Object Pattern
|
18
|
+
|
19
|
+
Minor Features
|
20
|
+
- Web page screenshots
|
21
|
+
- Convert testlink requirements to rspec cases
|
22
|
+
- Export rspec cases to a testlink testcase xml file
|
23
|
+
|
24
|
+
## Compatibility
|
25
|
+
|
26
|
+
* Only tested with TestLink 1.9.13
|
27
|
+
|
28
|
+
## Installation
|
29
|
+
|
30
|
+
Add these lines to your application's Gemfile:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
# This is needed as long as turboladen didn't merge
|
34
|
+
gem 'test_linker', :git => 'https://github.com/mipmip/test_linker.git'
|
35
|
+
gem 'watir_testlink_framework'
|
36
|
+
```
|
37
|
+
|
38
|
+
And then execute:
|
39
|
+
|
40
|
+
$ bundle
|
41
|
+
|
42
|
+
## Usage
|
43
|
+
|
44
|
+
Copy Rakefile.sample and config.yml.sample to your project dir.
|
45
|
+
|
46
|
+
Create a spec dir with naming like ```myfile_spec.rb```
|
47
|
+
|
48
|
+
Type ./bin/rake -T to list all rake commands. ATOW:
|
49
|
+
|
50
|
+
```bash
|
51
|
+
rake spec # Run all specs with doc output
|
52
|
+
rake testlink:cases_import # Run all specs with xml output for cases import in testlink
|
53
|
+
rake testlink:plan[testplan] # run plan by testplan name
|
54
|
+
rake testlink:plan_ci # run continuious intergration plan
|
55
|
+
rake testlink:plan_production # run production testplan
|
56
|
+
rake testlink:req2spec[requirements_file] # Creates a spec file with all cases from TestLink requirements export
|
57
|
+
rake testlink:spec # Run spec(s) with junit output
|
58
|
+
```
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
1. Fork it ( https://github.com/Lingewoud/watir_testlink_framework/fork )
|
63
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
65
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
66
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/Rakefile.yml.sample
ADDED
data/config.yml.sample
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
application: 'your site project name'
|
3
|
+
testlink:
|
4
|
+
xmlrpc_url: 'http://your.testlink.url/lib/api/xmlrpc/v1/xmlrpc.php'
|
5
|
+
apikey: 'testlink dev key'
|
6
|
+
project: 'project-name-in-testlink'
|
7
|
+
testplan_ci: 'continuous'
|
8
|
+
url_ci: 'http://ci-version.website.com'
|
9
|
+
testplan_production: 'production'
|
10
|
+
url_production: 'http://www.website.com'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
namespace :testlink do
|
2
|
+
desc 'run continuious intergration plan'
|
3
|
+
task :plan_ci do
|
4
|
+
WatirTestlinkFramework::TestLinkPlan::run_plan_cases $config['testlink']['testplan_ci']
|
5
|
+
end
|
6
|
+
|
7
|
+
desc 'run production testplan'
|
8
|
+
task :plan_production do
|
9
|
+
WatirTestlinkFramework::TestLinkPlan::run_plan_cases $config['testlink']['testplan_production']
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'run plan by testplan name'
|
13
|
+
task :plan,[:testplan] do |t, args|
|
14
|
+
WatirTestlinkFramework::TestLinkPlan::run_plan_cases args[:testplan]
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Creates a spec file with all cases from TestLink requirements export'
|
18
|
+
task :req2spec,[:requirements_file] do |t, args|
|
19
|
+
|
20
|
+
STDOUT.puts "Enter Project Code e.g.: linge-0666 intranet"
|
21
|
+
project = STDIN.gets.strip
|
22
|
+
|
23
|
+
fileout = $config['application']+project+"_spec.rb"
|
24
|
+
fileout = fileout.gsub(/[^\w\.\-]/,"_")
|
25
|
+
|
26
|
+
convert = TestlinkRspecUtils::Convert.new
|
27
|
+
convert.requirements_to_cases($config['application'],project, args[:requirements_file], 'spec/'+fileout)
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Run all specs with xml output for cases import in testlink'
|
31
|
+
RSpec::Core::RakeTask.new(:cases_import) do |t|
|
32
|
+
t.rspec_opts = "--format RspecTestlinkExportCases -r rspec_testlink_formatters --out tc-testlink.xml"
|
33
|
+
t.pattern = '**/*_spec.rb'
|
34
|
+
|
35
|
+
print "\nwrote output to tc-testlink.xml\n\n"
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'Run spec(s) with junit output'
|
39
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
40
|
+
|
41
|
+
d = DateTime.now
|
42
|
+
newTarget = d.strftime("%Y%m%dT%H%M%S")
|
43
|
+
|
44
|
+
Dir.mkdir 'reports' unless File.exists?('reports')
|
45
|
+
|
46
|
+
t.rspec_opts = "--format RspecTestlinkJunitformatter -r rspec_testlink_formatters --out reports/SPEC#{newTarget}-out.xml"
|
47
|
+
t.pattern = '**/*_spec.rb'
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require "watir_testlink_framework/version"
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'date'
|
4
|
+
require 'yaml'
|
5
|
+
require 'testlink_rspec_utils'
|
6
|
+
require 'rspec_testlink_formatters'
|
7
|
+
require 'test_linker'
|
8
|
+
|
9
|
+
spec = Gem::Specification.find_by_name 'watir_testlink_framework'
|
10
|
+
Dir.glob("#{spec.gem_dir}/lib/tasks/*.rake").each { |r| import r }
|
11
|
+
|
12
|
+
raise "Fatal: config.yml is missing." unless File.exists?('config.yml')
|
13
|
+
|
14
|
+
$config = YAML.load_file('config.yml')
|
15
|
+
|
16
|
+
module WatirTestlinkFramework
|
17
|
+
class TestLinkPlan
|
18
|
+
|
19
|
+
def self.run_plan_cases(plan)
|
20
|
+
#TL URL to test
|
21
|
+
#TL BuildPrefixName
|
22
|
+
# report back
|
23
|
+
server = $config['testlink']['xmlrpc_url']
|
24
|
+
dev_key = $config['testlink']['apikey']
|
25
|
+
tl_project = $config['testlink']['project']
|
26
|
+
|
27
|
+
tl = TestLinker.new(server, dev_key)
|
28
|
+
|
29
|
+
project_id = tl.project_id tl_project
|
30
|
+
plan_id = tl.test_plan_by_name(tl_project, plan)
|
31
|
+
|
32
|
+
test_cases = tl.test_cases_for_test_plan(plan_id[0][:id])
|
33
|
+
test_cases.each do |tc|
|
34
|
+
tc_customfield = tl.test_case_custom_field_design_value(project_id, tc[1][0]['full_external_id'], tc[1][0]['version'].to_i, 'RSPEC CASE ID',{:details=>''})
|
35
|
+
|
36
|
+
#TODO exit 1 when failing
|
37
|
+
system("bundle exec rake testlink:spec SPEC_OPTS=\"-e #{tc_customfield}\"")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'watir_testlink_framework/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "watir_testlink_framework"
|
8
|
+
spec.version = WatirTestlinkFramework::VERSION
|
9
|
+
spec.authors = ["Pim Snel"]
|
10
|
+
spec.email = ["pim@lingewoud.nl"]
|
11
|
+
spec.summary = %q{Framework for testing website with Watir & TestLink}
|
12
|
+
spec.description = %q{Watir TestLink Framework combines a lot of fine software like Watir, TestLink, Rspec, Rake, Junit to make it easy to run large sets of watir test cases on different stages of sites.}
|
13
|
+
spec.homepage = "https://github.com/Lingewoud/watir_testlink_framework"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
|
23
|
+
spec.add_runtime_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_runtime_dependency "rspec", "~> 3.1"
|
25
|
+
spec.add_runtime_dependency "rspec_testlink_formatters", "~> 0"
|
26
|
+
spec.add_runtime_dependency "testlink_rspec_utils", "~> 0"
|
27
|
+
spec.add_runtime_dependency "watir", "~> 5.0"
|
28
|
+
spec.add_runtime_dependency "headless", "~> 1.0"
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: watir_testlink_framework
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pim Snel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_testlink_formatters
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: testlink_rspec_utils
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: watir
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: headless
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
description: Watir TestLink Framework combines a lot of fine software like Watir,
|
112
|
+
TestLink, Rspec, Rake, Junit to make it easy to run large sets of watir test cases
|
113
|
+
on different stages of sites.
|
114
|
+
email:
|
115
|
+
- pim@lingewoud.nl
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".gitignore"
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- Rakefile.yml.sample
|
126
|
+
- config.yml.sample
|
127
|
+
- lib/tasks/rspec.rake
|
128
|
+
- lib/tasks/testlink.rake
|
129
|
+
- lib/watir_testlink_framework.rb
|
130
|
+
- lib/watir_testlink_framework/version.rb
|
131
|
+
- watir_testlink_framework.gemspec
|
132
|
+
homepage: https://github.com/Lingewoud/watir_testlink_framework
|
133
|
+
licenses:
|
134
|
+
- MIT
|
135
|
+
metadata: {}
|
136
|
+
post_install_message:
|
137
|
+
rdoc_options: []
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
requirements: []
|
151
|
+
rubyforge_project:
|
152
|
+
rubygems_version: 2.4.3
|
153
|
+
signing_key:
|
154
|
+
specification_version: 4
|
155
|
+
summary: Framework for testing website with Watir & TestLink
|
156
|
+
test_files: []
|