acceptance_test 1.6.0 → 1.6.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWRiYjdjNWFjMTIwNDRlNjU4M2M0ZWM4ODgyYmI3MzZkZjI2MWUyZQ==
4
+ MDQxNTE3ODg3ODZiOGNkYjUwMWI0MzZhNWU5NzZlYmZhOGJlZDE1ZA==
5
5
  data.tar.gz: !binary |-
6
- YjczYjJkOGMxODM0ZWQ3YTY5YmIxNmQ4MmZhZTI2NmRjNmFlOWJiZA==
6
+ OGE3N2Y3ZTg1NDFmYjM3NjE0NTlhMzk1NmU5YWE1MThhMjIwMmRkOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDYxNGE0YWJiNzdiMjBhMjRhMzQyMzQ3ZWRlNTQ1ZmU2MzljZjk1Mzc1NTgw
10
- MGYxN2M3YTU5ZThhZDM4NDUyMzFhZjM4OWQ2YzgyZTQ2OTNiYTNmNmY3NzZm
11
- MTI2ZDlhOTY4YzM4YmVmMTM1NzE3NTJhOWQ5MTcxZWJmNDg2YmM=
9
+ OWZlOWJmMmY4OTNkNzM3NWZjN2UyNWNkMWRiYTFjYThlNzdkMzlkYjMzNTgz
10
+ N2QyN2IyZTdlNTMwNDY5NGI4MjExNTM0ZmIwY2I5YTg3YTJiNTkwMGM2ODc3
11
+ NDc3MGIyMTEwYTcwZDhjYmVjYjk5YTdlZjY5MDlmYzQwZjcwMzA=
12
12
  data.tar.gz: !binary |-
13
- ZmQ2YTQ0NmU0ZDNhMjIyZjFiYmI1YTg1MjI2Y2Y5NzEzODVjMDYzZjliYjdh
14
- ZTZmOWVhNzgzN2E4ZTI4MDYzNTI2NDI5NDU4ZjNjN2Y3Yzk5YWFmMDA5Y2Ix
15
- YWU1NmVkNzE4MWNiMjQxNGQ2YmFiN2I4MjU4ZjcxYmNlNGExM2M=
13
+ MGJmMWVmOGZiOGQzNmEzYzE0ZDZiMTcwMTFlODQ5YzYwYmFhYTdjYzhjMDk3
14
+ YzY3YjI0YWY1YzMwZGEwOGQzZjhjZjg5NDk0MzdmMzliNjRhZmVmNzEwYTIy
15
+ OTllZTg0M2QxY2VmNjA3ZGU1ZTMzOTE5YzE3MGJlYzIxNmIxZmI=
data/CHANGES CHANGED
@@ -139,4 +139,8 @@
139
139
 
140
140
  == Version 1.6.0
141
141
 
142
- * Refactor the code
142
+ * Refactor the code
143
+
144
+ == Version 1.6.1
145
+
146
+ * Bug fixes
data/Gemfile CHANGED
@@ -8,6 +8,8 @@ end
8
8
  group :test do
9
9
  gem "mocha", :require => false
10
10
  gem "rspec"
11
+ gem "turnip_formatter"
12
+ gem "gnawrnip"
11
13
  end
12
14
 
13
15
  group :acceptance_test do
@@ -22,6 +22,7 @@ GEM
22
22
  json
23
23
  childprocess (0.5.5)
24
24
  ffi (~> 1.0, >= 1.0.11)
25
+ chunky_png (1.3.1)
25
26
  cliver (0.3.2)
26
27
  cucumber (1.3.17)
27
28
  builder (>= 2.1.2)
@@ -39,6 +40,10 @@ GEM
39
40
  file_utils
40
41
  gherkin (2.12.2)
41
42
  multi_json (~> 1.3)
43
+ gnawrnip (0.3.1)
44
+ capybara (~> 2.2)
45
+ oily_png
46
+ turnip_formatter (~> 0.3.2)
42
47
  i18n (0.6.11)
43
48
  json (1.8.1)
44
49
  metaclass (0.0.4)
@@ -51,6 +56,8 @@ GEM
51
56
  multi_test (0.1.1)
52
57
  nokogiri (1.6.3.1)
53
58
  mini_portile (= 0.6.0)
59
+ oily_png (1.1.2)
60
+ chunky_png (~> 1.3.1)
54
61
  poltergeist (1.5.1)
55
62
  capybara (~> 2.1)
56
63
  cliver (~> 0.3.1)
@@ -85,10 +92,19 @@ GEM
85
92
  multi_json (~> 1.0)
86
93
  rubyzip (~> 1.0)
87
94
  websocket (~> 1.0)
95
+ slim (2.0.3)
96
+ temple (~> 0.6.6)
97
+ tilt (>= 1.3.3, < 2.1)
98
+ temple (0.6.8)
88
99
  thread_safe (0.3.4)
100
+ tilt (2.0.1)
89
101
  turnip (1.2.4)
90
102
  gherkin (>= 2.5)
91
103
  rspec (>= 2.14.0, < 4.0)
104
+ turnip_formatter (0.3.2)
105
+ rspec (>= 2.14.0, < 4.0)
106
+ slim
107
+ turnip (~> 1.2.4)
92
108
  tzinfo (1.2.2)
93
109
  thread_safe (~> 0.1)
94
110
  websocket (1.2.1)
@@ -108,6 +124,7 @@ DEPENDENCIES
108
124
  debugger-ruby_core_source
109
125
  gemcutter
110
126
  gemspec_deps_gen
127
+ gnawrnip
111
128
  mocha
112
129
  poltergeist (~> 1.5.1)
113
130
  rspec
@@ -116,3 +133,4 @@ DEPENDENCIES
116
133
  ruby-debug-ide (= 0.4.17)
117
134
  selenium-webdriver (~> 2.43.0)
118
135
  turnip (~> 1.2.4)
136
+ turnip_formatter
data/Rakefile CHANGED
@@ -1,8 +1,13 @@
1
1
  #!/usr/bin/env rake
2
2
 
3
+ require "rspec/core/rake_task"
4
+
5
+ include Rake::DSL
6
+
7
+ load "lib/tasks/rspec.rake"
8
+
3
9
  $LOAD_PATH.unshift File.expand_path("lib", File.dirname(__FILE__))
4
10
 
5
- require "rspec/core/rake_task"
6
11
  require "acceptance_test/version"
7
12
  require "gemspec_deps_gen/gemspec_deps_gen"
8
13
 
@@ -14,17 +14,15 @@ class AcceptanceTest
14
14
 
15
15
  def initialize
16
16
  @driver_manager = DriverManager.new
17
- end
18
17
 
19
- def configure config={}
20
- if config
21
- @config = config.kind_of?(HashWithIndifferentAccess) ? config : HashWithIndifferentAccess.new(config)
22
- else
23
- @config = HashWithIndifferentAccess.new
18
+ @config = HashWithIndifferentAccess.new
19
+
20
+ @config[:browser] = 'firefox'
21
+ @config[:screenshot_dir] = File.expand_path('tmp')
24
22
  end
25
23
 
26
- @config[:browser] = 'firefox' unless @config[:browser]
27
- @config[:screenshot_dir] = File.expand_path('tmp') unless @config[:screenshot_dir]
24
+ def configure hash={}
25
+ config.merge!(HashWithIndifferentAccess.new(hash))
28
26
  end
29
27
 
30
28
  def setup
@@ -130,6 +128,24 @@ class AcceptanceTest
130
128
  GherkinExt.enable_external_source data_reader
131
129
  end
132
130
 
131
+ def configure_turnip_formatter report_name
132
+ require 'turnip/rspec'
133
+ require 'turnip_formatter'
134
+ require 'turnip/capybara'
135
+ require 'gnawrnip'
136
+
137
+ RSpec.configure do |config|
138
+ config.add_formatter RSpecTurnipFormatter, report_name
139
+ # config.add_formatter 'progress'
140
+ # config.add_formatter 'documentation'
141
+ end
142
+
143
+ Gnawrnip.configure do |c|
144
+ c.make_animation = true
145
+ c.max_frame_size = 1024 # pixel
146
+ end
147
+ end
148
+
133
149
  def driver metadata
134
150
  driver = ENV['DRIVER'].nil? ? nil : ENV['DRIVER'].to_sym
135
151
 
@@ -43,10 +43,12 @@ class DriverManager
43
43
  Capybara::Poltergeist::Driver.new(app, { debug: false })
44
44
  end
45
45
  else
46
- if driver_name =~ /remote/
46
+ if selenium_url
47
47
  properties[:browser] = :remote
48
48
  properties[:url] = selenium_url
49
- properties[:desired_capabilities] = capabilities if capabilities
49
+ #properties[:desired_capabilities] = capabilities if capabilities
50
+
51
+ driver_name = "#{driver_name}_remote"
50
52
 
51
53
  Capybara.register_driver driver_name do |app|
52
54
  Capybara::Selenium::Driver.new(app, properties)
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
@@ -1,7 +1,20 @@
1
- namespace :spec do
2
- desc 'Run turnip acceptance tests'
3
- RSpec::Core::RakeTask.new :turnip do |t|
4
- t.pattern = './spec{,/*/**}/*.feature'
5
- t.rspec_opts = ['-r turnip/rspec']
1
+ require 'rspec'
2
+ require 'gnawrnip'
3
+
4
+ namespace :rspec do
5
+
6
+ def create_spec_task name, paths
7
+ pattern = paths.collect {|path| "#{path}/**/*.feature" }
8
+
9
+ rspec_opts = "--color -r turnip/rspec "
10
+
11
+ desc 'Run turnip acceptance tests'
12
+ RSpec::Core::RakeTask.new(name) do |t|
13
+ t.pattern = pattern
14
+ t.rspec_opts = rspec_opts
15
+ end
6
16
  end
17
+
18
+ create_spec_task :"acceptance", %w(spec/features)
19
+
7
20
  end
@@ -1,6 +1,7 @@
1
1
  webapp_url: 'http://www.wikipedia.org'
2
2
 
3
- selenium_url: 'http://localhost:4444'
3
+ #selenium_url: 'http://localhost:4444/wd/hub'
4
+ selenium_url: 'http://10.111.74.226:4444/wd/hub'
4
5
 
5
6
  screenshot_dir: 'tmp'
6
7
 
@@ -6,6 +6,11 @@ require 'acceptance_test'
6
6
 
7
7
  require 'test_helper'
8
8
 
9
+ require 'steps/search_with_drivers_steps'
10
+ require 'steps/search_with_pages_steps'
11
+ require 'steps/search_with_examples_from_csv_steps'
12
+ require 'steps/search_with_table_steps'
13
+
9
14
  acceptance_test = AcceptanceTest.instance
10
15
 
11
16
  # enable external source for gherkin
@@ -14,14 +19,10 @@ data_reader = lambda {|source_path| CSV.read(File.expand_path(source_path)) }
14
19
 
15
20
  acceptance_test.enable_external_source data_reader
16
21
 
17
- require 'steps/search_with_drivers_steps'
18
- require 'steps/search_with_pages_steps'
19
- require 'steps/search_with_examples_from_csv_steps'
20
- require 'steps/search_with_table_steps'
22
+ acceptance_test.extend_turnip
23
+ acceptance_test.configure_turnip_formatter 'tmp/report.html'
21
24
 
22
25
  config_name = File.expand_path("spec/acceptance_config.yml")
23
26
  config = HashWithIndifferentAccess.new(YAML.load_file(config_name))
24
27
 
25
28
  acceptance_test.configure config
26
-
27
- acceptance_test.extend_turnip
@@ -2,9 +2,46 @@ require 'test_helper'
2
2
 
3
3
  require 'acceptance_test'
4
4
 
5
- acceptance_test = AcceptanceTest.instance
6
- acceptance_test.configure({webapp_url: "http://www.wikipedia.org", timeout_in_seconds: 10})
7
- acceptance_test.configure_rspec
5
+ # acceptance_test = AcceptanceTest.instance
6
+ # acceptance_test.configure({webapp_url: "http://www.wikipedia.org", timeout_in_seconds: 10})
7
+ # acceptance_test.configure_rspec
8
+
9
+ require "capybara"
10
+ require 'selenium/webdriver'
11
+
12
+ RSpec.configure do |config|
13
+ config.include Capybara::DSL
14
+ end
15
+
16
+ # profile = Selenium::WebDriver::Chrome::Profile.new
17
+ # # profile['download.prompt_for_download'] = false
18
+ # profile['webdriver.chrome.driver'] = "c:\\work\\selenium-server\\chromedriver.exe"
19
+ #
20
+ # # properties[:profile] = profile
21
+ #
22
+ # properties = {}
23
+ # properties[:url] = "http://10.111.74.226:4444/wd/hub"
24
+ # properties[:browser] = :remote
25
+ # properties[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.chrome(:profile => profile)
26
+ #
27
+ #
28
+ # # ENV['webdriver.chrome.driver'] = "c:\work\selenium-server\chromedriver.exe"
29
+ # #properties[:desired_capabilities]['webdriver.chrome.driver'] = "c:\work\selenium-server\chromedriver.exe"
30
+ #
31
+ # Capybara.register_driver :selenium_remote do |app|
32
+ # Capybara::Selenium::Driver.new(app, properties)
33
+ # end
34
+ #
35
+ # Capybara.app_host = "http://www.wikipedia.org"
36
+ # Capybara.default_driver = :selenium_remote
37
+
38
+
39
+ Capybara.register_driver :selenium_chrome do |app|
40
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
41
+ end
42
+
43
+ Capybara.app_host = "http://www.wikipedia.org"
44
+ Capybara.default_driver = :selenium_chrome
8
45
 
9
46
  require 'pages/wikipedia_pages'
10
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acceptance_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-13 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemspec_deps_gen
@@ -97,7 +97,7 @@ files:
97
97
  - spec/wikipedia_search_spec.rb
98
98
  - spec/wikipedia_search_with_config_spec.rb
99
99
  - spec/wikipedia_search_with_pages_spec.rb
100
- - spec/wikipedia_search_with_steps.rb
100
+ - spec/wikipedia_search_with_steps_spec.rb
101
101
  homepage: http://github.com/shvets/acceptance_test
102
102
  licenses:
103
103
  - MIT
@@ -145,4 +145,4 @@ test_files:
145
145
  - spec/wikipedia_search_spec.rb
146
146
  - spec/wikipedia_search_with_config_spec.rb
147
147
  - spec/wikipedia_search_with_pages_spec.rb
148
- - spec/wikipedia_search_with_steps.rb
148
+ - spec/wikipedia_search_with_steps_spec.rb