acceptance_test 1.10.0 → 1.10.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 +8 -8
- data/CHANGES +5 -1
- data/Gemfile +1 -1
- data/acceptance_test.gemspec +1 -1
- data/lib/acceptance_test/acceptance_config.rb +97 -20
- data/lib/acceptance_test/acceptance_test.rb +0 -27
- data/lib/acceptance_test/version.rb +1 -1
- data/spec/spec_helper.rb +4 -49
- data/spec/wikipedia/{data.csv → acceptance_data/data.csv} +0 -0
- data/spec/wikipedia/{data.yml → acceptance_data/data.yml} +0 -0
- data/spec/wikipedia/features/search_with_scenario_outline2.feature +1 -1
- data/spec/wikipedia/features/search_with_scenario_outline3.feature +1 -1
- data/spec/wikipedia/features/search_with_scenario_outline4.feature +1 -1
- data/spec/wikipedia/support/steps/search_with_scenario_outline_steps.rb +0 -16
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWQzODI5MGMwMTNjNWQ5Y2RjY2MyN2QyNjdiZThiZTgwZmFhOWU5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWM5ZTVkMjc1MjQ3OWY2MTc2Nzc4Y2NjODE1MTQxMzcyYmU0OTBmMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWVlNjU1OWU5NmRmOWIwZGNjZDQyMjA5MDM3YTFhZWI3YzY5NDJiZDQwZGM4
|
10
|
+
YWMwOWY3OWMyNTkzMTNiODkzYTViOGY0ZjQ5NjIwODc5YzRmZmVkZGFiZTEw
|
11
|
+
N2FlZWEyZDg5NWIwMzk2ZjcyNjFhNjE5N2NmNjJhYTViOTIwYjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGJlOGQ3OTcyNWY0N2NjOTcyNzQ0Y2QwZWM1NjU3OGZjYjAyZGQ2Y2NhZjg3
|
14
|
+
ZjgyNTExZmE1ZDZhMWMyNTU2ZjFmMjU5YTc4NzUwOWY1OTc4OTE5NDMwYzg3
|
15
|
+
YmMzZjIxOGEwZTE4ZmZjYzM4Njg1Zjc3NWUxM2FjMzY4MGY2MTU=
|
data/CHANGES
CHANGED
data/Gemfile
CHANGED
@@ -7,6 +7,7 @@ end
|
|
7
7
|
|
8
8
|
group :test, :default do
|
9
9
|
gem "rspec"
|
10
|
+
gem "capybara-webkit", "~> 1.4.1"
|
10
11
|
end
|
11
12
|
|
12
13
|
group :default do
|
@@ -25,7 +26,6 @@ group :default do
|
|
25
26
|
|
26
27
|
gem "turnip", "~> 1.2.4"
|
27
28
|
gem "capybara", "~> 2.4.4"
|
28
|
-
gem "capybara-webkit", "~> 1.4.1", platforms: [:ruby]
|
29
29
|
gem "selenium-webdriver", "~> 2.44.0"
|
30
30
|
gem "capybara-firebug", "~> 2.1.0"
|
31
31
|
gem "poltergeist", "~> 1.6.0"
|
data/acceptance_test.gemspec
CHANGED
@@ -17,9 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.license = "MIT"
|
18
18
|
|
19
19
|
spec.add_runtime_dependency "rspec", [">= 0"]
|
20
|
+
spec.add_runtime_dependency "capybara-webkit", ["~> 1.4.1"]
|
20
21
|
spec.add_runtime_dependency "turnip", ["~> 1.2.4"]
|
21
22
|
spec.add_runtime_dependency "capybara", ["~> 2.4.4"]
|
22
|
-
spec.add_runtime_dependency "capybara-webkit", ["~> 1.4.1"]
|
23
23
|
spec.add_runtime_dependency "selenium-webdriver", ["~> 2.44.0"]
|
24
24
|
spec.add_runtime_dependency "capybara-firebug", ["~> 2.1.0"]
|
25
25
|
spec.add_runtime_dependency "poltergeist", ["~> 1.6.0"]
|
@@ -1,31 +1,30 @@
|
|
1
1
|
require 'singleton'
|
2
2
|
require 'yaml'
|
3
3
|
require 'csv'
|
4
|
+
require 'selenium/webdriver'
|
4
5
|
require 'active_support/core_ext/hash'
|
5
6
|
require 'acceptance_test'
|
6
7
|
|
7
|
-
require 'turnip/capybara'
|
8
8
|
require 'gnawrnip'
|
9
9
|
|
10
10
|
class AcceptanceConfig
|
11
11
|
include Singleton
|
12
12
|
|
13
|
-
def configure app_name=nil
|
13
|
+
def configure workspace, app_name=nil
|
14
14
|
@app_name = app_name
|
15
15
|
|
16
|
-
load_support_code
|
16
|
+
load_support_code workspace
|
17
17
|
|
18
18
|
acceptance_test = AcceptanceTest.instance
|
19
19
|
|
20
|
-
|
20
|
+
acceptance_test.enable_external_source data_reader # enable external source for gherkin
|
21
21
|
|
22
|
-
|
23
|
-
config_file = acceptance_config_file(app_name)
|
24
|
-
acceptance_config = config_file ? HashWithIndifferentAccess.new(YAML.load_file(config_file)) : {}
|
22
|
+
acceptance_config = acceptance_config_file ? HashWithIndifferentAccess.new(YAML.load_file(acceptance_config_file)) : {}
|
25
23
|
|
26
|
-
|
24
|
+
acceptance_test.configure(acceptance_config)
|
27
25
|
|
28
|
-
|
26
|
+
RSpec.configure do |config|
|
27
|
+
configure_turnip
|
29
28
|
|
30
29
|
config.before(:type => :feature) do |example|
|
31
30
|
acceptance_test.setup page, example.metadata
|
@@ -49,12 +48,69 @@ class AcceptanceConfig
|
|
49
48
|
ENV['ACCEPTANCE_ENV'].nil? ? "development" : ENV['ACCEPTANCE_ENV']
|
50
49
|
end
|
51
50
|
|
52
|
-
def
|
53
|
-
ENV['
|
51
|
+
def format
|
52
|
+
ENV['FORMAT'].nil? ? "xlsx" : ENV['FORMAT']
|
53
|
+
end
|
54
|
+
|
55
|
+
def acceptance_config_file
|
56
|
+
ENV['CONFIG_FILE'] ? File.expand_path(ENV['CONFIG_FILE']) : detect_file("acceptance_config", "#{app_name}.yml")
|
57
|
+
end
|
58
|
+
|
59
|
+
def acceptance_data_file name="#{app_name}.#{format}"
|
60
|
+
ENV['DATA_DIR'] ? detect_file(ENV['DATA_DIR'], name) : detect_file("acceptance_data", name)
|
61
|
+
end
|
62
|
+
|
63
|
+
def screenshots_dir
|
64
|
+
AcceptanceTest.instance.config[:screenshots_dir]
|
65
|
+
end
|
66
|
+
|
67
|
+
def upload_dir
|
68
|
+
AcceptanceTest.instance.config[:upload_dir]
|
69
|
+
end
|
70
|
+
|
71
|
+
def upload_dev_dir
|
72
|
+
AcceptanceTest.instance.config[:upload_dev_dir]
|
54
73
|
end
|
55
74
|
|
56
75
|
private
|
57
76
|
|
77
|
+
def configure_turnip
|
78
|
+
report_file = turnip_report_file(app_name)
|
79
|
+
|
80
|
+
configure_turnip_formatter report_file, app_name
|
81
|
+
|
82
|
+
configure_gnawrnip
|
83
|
+
end
|
84
|
+
|
85
|
+
def configure_turnip_formatter report_file, report_name
|
86
|
+
require 'turnip_formatter'
|
87
|
+
|
88
|
+
RSpec.configure do |config|
|
89
|
+
config.add_formatter RSpecTurnipFormatter, report_file
|
90
|
+
end
|
91
|
+
|
92
|
+
TurnipFormatter.configure do |config|
|
93
|
+
config.title = "#{report_name[0].upcase+report_name[1..-1]} Acceptance"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def configure_gnawrnip
|
98
|
+
Gnawrnip.configure do |c|
|
99
|
+
c.make_animation = true
|
100
|
+
c.max_frame_size = 1024 # pixel
|
101
|
+
end
|
102
|
+
|
103
|
+
Gnawrnip.ready!
|
104
|
+
end
|
105
|
+
|
106
|
+
def turnip_report_file name=nil
|
107
|
+
name = ENV['TURNIP_REPORT_PREFIX'] if ENV['TURNIP_REPORT_PREFIX']
|
108
|
+
|
109
|
+
file_name = name.nil? ? "acceptance-report.html" : "#{name}-acceptance-report.html"
|
110
|
+
|
111
|
+
File.expand_path("tmp/#{file_name}")
|
112
|
+
end
|
113
|
+
|
58
114
|
def load_support_code basedir
|
59
115
|
target = nil
|
60
116
|
|
@@ -82,26 +138,47 @@ class AcceptanceConfig
|
|
82
138
|
end
|
83
139
|
end
|
84
140
|
|
85
|
-
def detect_file dir,
|
86
|
-
|
87
|
-
|
141
|
+
def detect_file dir, name
|
142
|
+
ext = File.extname(name)
|
143
|
+
basename = File.basename(name)
|
144
|
+
basename = basename[0..basename.size-ext.size-1]
|
145
|
+
|
146
|
+
path1 = "#{dir}/#{basename}-#{environment}#{ext}"
|
147
|
+
path2 = "#{dir}/#{basename}#{ext}"
|
88
148
|
|
89
|
-
|
149
|
+
full_path1 = File.expand_path(path1)
|
150
|
+
full_path2 = File.expand_path(path2)
|
90
151
|
|
91
|
-
File.exist?(
|
152
|
+
File.exist?(full_path1) ? full_path1 : full_path2
|
92
153
|
end
|
93
154
|
|
94
155
|
def data_reader
|
95
156
|
lambda do |source_path|
|
96
|
-
|
157
|
+
path = acceptance_data_file detect_file_from_script(source_path)
|
158
|
+
|
159
|
+
puts "Reading data from: #{path}"
|
160
|
+
|
161
|
+
ext = File.extname(path)
|
97
162
|
|
98
163
|
if ext == '.csv'
|
99
|
-
CSV.read(File.expand_path(
|
164
|
+
CSV.read(File.expand_path(path))
|
100
165
|
elsif ext == '.yml'
|
101
|
-
YAML.load_file(File.expand_path(
|
166
|
+
YAML.load_file(File.expand_path(path))
|
102
167
|
end
|
103
168
|
end
|
104
169
|
end
|
105
170
|
|
106
|
-
|
171
|
+
def detect_file_from_script source_path
|
172
|
+
path = source_path % {acceptance_env: environment, format: format}
|
107
173
|
|
174
|
+
if File.exist? File.expand_path(path)
|
175
|
+
path
|
176
|
+
else
|
177
|
+
dir = File.dirname(source_path)
|
178
|
+
name = File.basename(source_path).gsub("-", '')
|
179
|
+
source_path = (dir == ".") ? name : "#{dir}/#{name}"
|
180
|
+
|
181
|
+
(source_path % {acceptance_env: '', format: format})
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -89,33 +89,6 @@ class AcceptanceTest
|
|
89
89
|
GherkinExt.enable_external_source data_reader
|
90
90
|
end
|
91
91
|
|
92
|
-
def configure_turnip report_file, report_name
|
93
|
-
configure_turnip_formatter report_file, report_name
|
94
|
-
|
95
|
-
configure_gnawrnip
|
96
|
-
end
|
97
|
-
|
98
|
-
def configure_turnip_formatter report_file, report_name
|
99
|
-
require 'turnip_formatter'
|
100
|
-
|
101
|
-
RSpec.configure do |config|
|
102
|
-
config.add_formatter RSpecTurnipFormatter, report_file
|
103
|
-
end
|
104
|
-
|
105
|
-
TurnipFormatter.configure do |config|
|
106
|
-
config.title = "#{report_name[0].upcase+report_name[1..-1]} Acceptance"
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def configure_gnawrnip
|
111
|
-
Gnawrnip.configure do |c|
|
112
|
-
c.make_animation = true
|
113
|
-
c.max_frame_size = 1024 # pixel
|
114
|
-
end
|
115
|
-
|
116
|
-
Gnawrnip.ready!
|
117
|
-
end
|
118
|
-
|
119
92
|
private
|
120
93
|
|
121
94
|
def driver metadata
|
data/spec/spec_helper.rb
CHANGED
@@ -1,51 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
require 'csv'
|
3
|
-
require 'active_support/core_ext/hash'
|
4
|
-
|
5
|
-
$: << File.expand_path('spec/support')
|
6
|
-
$: << File.expand_path('spec/wikipedia/support')
|
7
|
-
|
8
|
-
require 'acceptance_test'
|
9
|
-
|
10
|
-
require 'turnip/capybara'
|
11
|
-
require 'gnawrnip'
|
12
|
-
|
13
|
-
require 'steps/search_with_drivers_steps'
|
14
|
-
require 'steps/search_with_pages_steps'
|
15
|
-
require 'steps/search_with_scenario_outline_steps'
|
16
|
-
require 'steps/search_with_table_steps'
|
17
|
-
|
18
|
-
acceptance_test = AcceptanceTest.instance
|
19
|
-
|
20
|
-
RSpec.configure do |conf|
|
21
|
-
conf.before(:type => :feature) do
|
22
|
-
config_name = File.expand_path("spec/wikipedia/acceptance_config.yml")
|
23
|
-
config = config_name ? HashWithIndifferentAccess.new(YAML.load_file(config_name)) : {}
|
24
|
-
|
25
|
-
acceptance_test.configure(config)
|
26
|
-
|
27
|
-
# acceptance_test.configure(webapp_url: 'http://www.wikipedia.org')
|
28
|
-
# acceptance_test.register_driver(:webkit)
|
29
|
-
# acceptance_test.register_driver(:poltergeist)
|
30
|
-
|
31
|
-
acceptance_test.configure_turnip 'tmp/report.html', "test"
|
32
|
-
|
33
|
-
acceptance_test.setup
|
34
|
-
end
|
35
|
-
|
36
|
-
conf.after(:type => :feature) do
|
37
|
-
acceptance_test.teardown
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# ENV['CONFIG_FILE'] = "spec/wikipedia/acceptance_config.yml"
|
42
|
-
#
|
43
|
-
# require 'acceptance_test/acceptance_config'
|
44
|
-
#
|
45
|
-
# AcceptanceConfig.instance.configure "wikipedia"
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
1
|
+
require 'acceptance_test/acceptance_config'
|
50
2
|
|
3
|
+
ENV['CONFIG_FILE'] = "spec/wikipedia/acceptance_config.yml"
|
4
|
+
ENV['DATA_DIR'] = "spec/wikipedia/acceptance_data"
|
51
5
|
|
6
|
+
AcceptanceConfig.instance.configure "spec", "wikipedia"
|
File without changes
|
File without changes
|
@@ -1,19 +1,3 @@
|
|
1
|
-
require 'csv'
|
2
|
-
|
3
|
-
# enable external source for gherkin
|
4
|
-
|
5
|
-
data_reader = lambda do |source_path|
|
6
|
-
ext = File.extname(source_path)
|
7
|
-
|
8
|
-
if ext == '.csv'
|
9
|
-
CSV.read(File.expand_path(source_path))
|
10
|
-
elsif ext == '.yml'
|
11
|
-
YAML.load_file(File.expand_path(source_path))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
AcceptanceTest.instance.enable_external_source data_reader
|
16
|
-
|
17
1
|
steps_for :search_with_scenario_outline do
|
18
2
|
|
19
3
|
step "I am within wikipedia.com" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acceptance_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
@@ -25,47 +25,47 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: capybara-webkit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.4.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: turnip
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.4
|
47
|
+
version: 1.2.4
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.4
|
54
|
+
version: 1.2.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: capybara
|
56
|
+
name: capybara
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.4.4
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.4.4
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: selenium-webdriver
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -260,8 +260,8 @@ files:
|
|
260
260
|
- spec/wikipedia/acceptance/search_with_pages_spec.rb
|
261
261
|
- spec/wikipedia/acceptance/search_with_steps_spec.rb
|
262
262
|
- spec/wikipedia/acceptance_config.yml
|
263
|
-
- spec/wikipedia/data.csv
|
264
|
-
- spec/wikipedia/data.yml
|
263
|
+
- spec/wikipedia/acceptance_data/data.csv
|
264
|
+
- spec/wikipedia/acceptance_data/data.yml
|
265
265
|
- spec/wikipedia/features/search_with_drivers.feature
|
266
266
|
- spec/wikipedia/features/search_with_pages.feature
|
267
267
|
- spec/wikipedia/features/search_with_scenario_outline1.feature
|
@@ -295,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
295
|
version: '0'
|
296
296
|
requirements: []
|
297
297
|
rubyforge_project:
|
298
|
-
rubygems_version: 2.4.
|
298
|
+
rubygems_version: 2.4.4
|
299
299
|
signing_key:
|
300
300
|
specification_version: 4
|
301
301
|
summary: Simplifies congiguration and run of acceptance tests.
|
@@ -312,8 +312,8 @@ test_files:
|
|
312
312
|
- spec/wikipedia/acceptance/search_with_pages_spec.rb
|
313
313
|
- spec/wikipedia/acceptance/search_with_steps_spec.rb
|
314
314
|
- spec/wikipedia/acceptance_config.yml
|
315
|
-
- spec/wikipedia/data.csv
|
316
|
-
- spec/wikipedia/data.yml
|
315
|
+
- spec/wikipedia/acceptance_data/data.csv
|
316
|
+
- spec/wikipedia/acceptance_data/data.yml
|
317
317
|
- spec/wikipedia/features/search_with_drivers.feature
|
318
318
|
- spec/wikipedia/features/search_with_pages.feature
|
319
319
|
- spec/wikipedia/features/search_with_scenario_outline1.feature
|