selenium-connect 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ #3.6.0 (2013-08-18)
2
+ upgraded selenium version and improved chrome log storage
3
+
4
+ - Bumped version to 3.6.0 to prepare for release.
5
+ - more code quality fixes
6
+ - code quality fixes
7
+ - cleaned up the server class a little and added sensible chrome log file saving to the jar so we don\'t move files around
8
+ - upgraded to newer version of jar file
9
+
1
10
  #3.5.0 (2013-08-12)
2
11
  updated selenium server jar and sauce version default plus screenshots and dom html for everyone
3
12
 
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- #selenium-connect 3.5.0 (2013-08-12)
1
+ #selenium-connect 3.6.0 (2013-08-18)
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/selenium-connect.png)](http://badge.fury.io/rb/selenium-connect) [![Build Status](https://travis-ci.org/arrgyle/selenium-connect.png?branch=develop)](https://travis-ci.org/arrgyle/selenium-connect) [![Code Climate](https://codeclimate.com/github/arrgyle/selenium-connect.png)](https://codeclimate.com/github/arrgyle/selenium-connect) [![Coverage Status](https://coveralls.io/repos/arrgyle/selenium-connect/badge.png?branch=develop)](https://coveralls.io/r/arrgyle/selenium-connect?branch=develop)
4
4
 
@@ -48,7 +48,7 @@ class SeleniumConnect
48
48
  end
49
49
 
50
50
  def populate_with_yaml(file)
51
- populate_with_hash YAML.load_file file
51
+ populate_with_hash YAML.load_file file
52
52
  end
53
53
 
54
54
  # The below methods are setters for the explicitly defined sauce and browser
@@ -37,7 +37,6 @@ class SeleniumConnect
37
37
  @driver.quit
38
38
  @data = { assets: {} }
39
39
  process_sauce_logs(opts) if @config.host == 'saucelabs'
40
- process_chrome_logs(opts) if @config.browser == 'chrome'
41
40
  # rubocop:disable HandleExceptions
42
41
  rescue Selenium::WebDriver::Error::WebDriverError
43
42
  # rubocop:enable HandleExceptions
@@ -56,19 +55,6 @@ class SeleniumConnect
56
55
  save_asset('dom.html', @driver.page_source)
57
56
  end
58
57
 
59
- # if a log path is configured move the logs, otherwise delete them
60
- def process_chrome_logs(opts = {})
61
- ['chromedriver.log', 'libpeerconnection.log'].each do |log_file|
62
- path = File.join(Dir.getwd, log_file)
63
-
64
- if @config.log
65
- FileUtils.mv(path, File.join(Dir.getwd, @config.log)) if File.exist? path
66
- else
67
- FileUtils.rm path if File.exist? path
68
- end
69
- end
70
- end
71
-
72
58
  def process_sauce_logs(opts = {})
73
59
  job_id = @driver.session_id
74
60
  @sauce_facade.job_id = job_id
@@ -76,7 +62,7 @@ class SeleniumConnect
76
62
  status = 'failed'
77
63
  @sauce_facade.fail_job
78
64
  if opts.has_key?(:failshot) && opts[:failshot]
79
- screenshot = @sauce_facade.fetch_last_screenshot
65
+ screenshot = @sauce_facade.fetch_last_screenshot
80
66
  @data[:assets][:failshot] = save_asset('failshot.png', screenshot) if screenshot
81
67
  end
82
68
  end
@@ -25,41 +25,35 @@ class SeleniumConnect
25
25
 
26
26
  private
27
27
 
28
- def generate_rake_task
29
- "require 'selenium/rake/server_task'
30
-
31
- Selenium::Rake::ServerTask.new(:server) do |t|
32
- #{
33
- if configuration.jar
34
- "t.jar = '#{configuration.jar}'"
35
- else
36
- "t.jar = '#{current_dir_path + '/../../bin/selenium-server-standalone-2.34.0.jar'}'"
37
- end
38
- }
39
- t.background
40
- #{
28
+ def get_rake_file
29
+ rake_file_path = current_dir_path + '/rake.task'
30
+ File.open(rake_file_path, 'w') do |file|
31
+ file.puts "require 'selenium/rake/server_task'"
32
+ file.puts 'Selenium::Rake::ServerTask.new(:server) do |t|'
33
+ if configuration.jar
34
+ file.puts "t.jar = '#{configuration.jar}'"
35
+ else
36
+ file.puts "t.jar = '#{current_dir_path + '/../../bin/selenium-server-standalone-2.35.0.jar'}'"
37
+ end
38
+ file.puts 't.background'
41
39
  if configuration.log
42
- "t.log = '#{File.join(Dir.getwd, configuration.log, 'server.log')}'"
40
+ file.puts "t.log = '#{File.join(Dir.getwd, configuration.log, 'server.log')}'"
43
41
  else
44
- "t.log = false"
42
+ file.puts 't.log = false'
45
43
  end
46
- }
47
- t.port = #{configuration.port}
48
- #{
49
- if configuration.browser == 'chrome'
50
- "t.opts = '-Dwebdriver.chrome.driver=#{current_dir_path + '/../../bin/chromedriver'}'"
44
+ file.puts "t.port = #{configuration.port}"
45
+ opts = ''
46
+ if configuration.browser == 'chrome'
47
+ opts += '-Dwebdriver.chrome.driver=' + current_dir_path + '/../../bin/chromedriver'
48
+ if configuration.log
49
+ opts += ' -Dwebdriver.chrome.logfile=' + File.join(Dir.getwd, configuration.log, 'chrome.log')
51
50
  end
52
- }
53
- end"
54
- end
55
-
56
- def get_rake_file
57
- rake_file_path = current_dir_path + '/rake.task'
58
- rake_file = File.open(rake_file_path, 'w')
59
- rake_file << generate_rake_task
60
- rake_file.close
61
- rake_file_path
62
- end
51
+ file.puts "t.opts = %w[#{opts}]"
52
+ end
53
+ file.puts 'end'
54
+ end
55
+ rake_file_path
56
+ end
63
57
 
64
58
  def rake(task)
65
59
  system "rake -f #{get_rake_file} server:#{task}"
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'selenium-connect'
3
- s.version = '3.5.0'
3
+ s.version = '3.6.0'
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ['Dave Haeffner', 'Jason Fox']
6
6
  s.email = ['dave@arrgyle.com', 'jason@arrgyle.com']
7
7
  s.homepage = 'https://github.com/arrgyle/selenium-connect'
8
8
  s.summary = 'A stupid simple way to run your Selenium tests on localhost, against a Selenium Grid, or in the cloud (e.g. SauceLabs).'
9
- s.description = 'updated selenium server jar and sauce version default plus screenshots and dom html for everyone'
9
+ s.description = 'upgraded selenium version and improved chrome log storage'
10
10
  s.license = 'MIT'
11
11
 
12
12
  s.files = `git ls-files`.split($/)
@@ -29,8 +29,7 @@ describe 'Chrome', selenium: true do
29
29
  job.finish failshot: true
30
30
  sc.finish
31
31
 
32
- File.exist?(File.join(ENV['BUILD_PATH'], 'tmp', 'chromedriver.log')).should be_true
33
- File.exist?(File.join(ENV['BUILD_PATH'], 'tmp', 'libpeerconnection.log')).should be_true
32
+ File.exist?(File.join(ENV['BUILD_PATH'], 'tmp', 'chrome.log')).should be_true
34
33
  File.exist?(File.join(ENV['BUILD_PATH'], 'tmp', 'dom.html')).should be_true
35
34
  File.exist?(File.join(ENV['BUILD_PATH'], 'tmp', 'failshot.png')).should be_true
36
35
  end
@@ -33,7 +33,7 @@ describe 'Firefox', selenium: true do
33
33
  it 'local jar file specified' do
34
34
  opts = {
35
35
  host: 'localhost',
36
- jar: "#{Dir.pwd}/bin/selenium-server-standalone-2.34.0.jar"
36
+ jar: "#{Dir.pwd}/bin/selenium-server-standalone-2.35.0.jar"
37
37
  }
38
38
  @config = SeleniumConnect::Configuration.new opts
39
39
  sc = SeleniumConnect.start @config
@@ -9,14 +9,14 @@ describe 'Headless', selenium: true do
9
9
  let(:quit) { SeleniumConnect.finish }
10
10
 
11
11
  before(:each) do
12
- config = SeleniumConnect::Configuration.new browser: 'phantomjs'
13
- @sc = SeleniumConnect.start config
14
- @job = @sc.create_job
15
- @driver = @job.start
12
+ config = SeleniumConnect::Configuration.new browser: 'phantomjs'
13
+ @sc = SeleniumConnect.start config
14
+ @job = @sc.create_job
15
+ @driver = @job.start
16
16
  end
17
17
 
18
18
  it 'should run a basic test with phantom js' do
19
- execute_simple_test @driver
19
+ execute_simple_test @driver
20
20
  end
21
21
 
22
22
  it 'should not find something on a page' do
@@ -26,8 +26,8 @@ describe 'Headless', selenium: true do
26
26
  end
27
27
 
28
28
  after(:each) do
29
- @job.finish
30
- @sc.finish
29
+ @job.finish
30
+ @sc.finish
31
31
  end
32
32
 
33
33
  end
@@ -14,8 +14,8 @@ describe 'Sauce Labs', selenium: true do
14
14
  os: 'windows',
15
15
  browser: 'iexplore',
16
16
  browser_version: '7',
17
- description: 'test description',
18
- sauce_opts: { selenium_version: '2.32.0' }
17
+ sauce_opts: { selenium_version: '2.32.0' },
18
+ description: 'test description'
19
19
  }
20
20
  config = SeleniumConnect::Configuration.new opts
21
21
  @sc = SeleniumConnect.start config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-12 00:00:00.000000000 Z
13
+ date: 2013-08-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: selenium-webdriver
@@ -76,8 +76,7 @@ dependencies:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
78
  version: 0.0.8
79
- description: updated selenium server jar and sauce version default plus screenshots
80
- and dom html for everyone
79
+ description: upgraded selenium version and improved chrome log storage
81
80
  email:
82
81
  - dave@arrgyle.com
83
82
  - jason@arrgyle.com
@@ -99,7 +98,7 @@ files:
99
98
  - Rakefile
100
99
  - bin/chromedriver
101
100
  - bin/phantomjs
102
- - bin/selenium-server-standalone-2.34.0.jar
101
+ - bin/selenium-server-standalone-2.35.0.jar
103
102
  - lib/sauce/sauce_facade.rb
104
103
  - lib/selenium-connect.rb
105
104
  - lib/selenium_connect.rb
@@ -159,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
158
  version: '0'
160
159
  segments:
161
160
  - 0
162
- hash: -540631903920495411
161
+ hash: -2907860851704269908
163
162
  requirements: []
164
163
  rubyforge_project:
165
164
  rubygems_version: 1.8.25