selenium-connect 1.9.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  *.lock
4
4
  *.swp
5
5
  profiles/
6
- *.jar
7
6
  *.gem
8
7
  *.rbc
9
8
  *.log
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ selenium-connect
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p429
data/CHANGELOG.md CHANGED
@@ -0,0 +1,87 @@
1
+ #2.0.0 (2013-06-27)
2
+ - Added selenium server jar as explicit dependency
3
+ - Updated ruby version
4
+ - Updated logging tests
5
+
6
+ #1.9.3 (2013-06-21)
7
+ - Merge branch 'release/1.9.3'
8
+ - Bumping to 1.9.3 since rubygems is giving me guff about 1.9.2 already existing, even though the upload failed halfway through.
9
+ - Merge branch 'release/1.9.2' into develop
10
+ - Merge branch 'release/1.9.2'
11
+ - Bumped version and description
12
+ - Nefarious. Tests passed running in this dir but failed in the wild. Needed to incorporate Dir.getwd into the mix to capture log output properly.
13
+ - Merge branch 'release/1.9.1'
14
+ - Bumped to 1.9.1
15
+ - Removed the rake task from the repo since it is dynamically generated
16
+ - Refactored the test structure so it is not redundant and assertions are separated.
17
+ - Cleaned up some cruft
18
+ - Added rake tasks to gitignore
19
+ - Removed the default setter for logs since this is covered in the local server runner
20
+ - Added .gem to the gitignore
21
+ - Merge branch 'release/1.9.0'
22
+ - Bumped version number to 1.9.0 and added description
23
+ - Added a build dir with a shadow file so it stays put on github (for future committers to run tests without setup). Broke out the specs into separate files since they were getting a bit long in the tooth. Reworked the PhantomJS runner so it works with the existing Remote pattern matching after adding the requisite phantomjs binary to the project bin dir and adding the necessary capabilities in the runner.
24
+ - removed chromedriver.log
25
+ - started fleshing out a more consolidated log folder and option for such, got the firefox to output its log file to that folder.
26
+ - back merged master into develop to keep inline with git flow, added a blank changelog file and minor tweeks to the docs
27
+ - Merge branch 'master' into develop
28
+ - Merge pull request #4 from arrgyle/feature/headless
29
+ - added a phantomjs browser with spec
30
+ - Set sauce gem version to pre-3 since new version is causing hiccups to do a new dependency, and potentially other lurking breaking changes
31
+
32
+ #1.8.0 (2013-05-28)
33
+ - Bumped to version 1.8.0
34
+ - Added better chrome support by adding the chromedriver to bin. Setting browser to chrome and host to localhost will run things locally now via the remote webdriver.
35
+ - Bumped version to 1.7 for yaml config support
36
+
37
+ #1.7.0 (2013-05-22)
38
+ - Initial pass on adding yaml config file support
39
+
40
+ #1.6.0 (2013-05-15)
41
+ - Bumped version number and updated description
42
+ - Added sauce to support list
43
+ - Removed un-needed require from test
44
+ - Initial assumptions of the location being needed for sauce and localhost were proven false since the sauce gem actually instantiates a driver object. So, backed out the location stuff and added saucelabs as a runner.
45
+ - Chased down a bug where configs were not getting passed properly. This was due to an overzealous find replace made earlier today. Fixed.
46
+ - Things are stubbed -- test has basic config hooks I want to pass, and the code is abstracted and waiting for sauce gem specific bits. Splunkingi through their code now.
47
+ - Abstracted out location checking and execution for easy extension to account for local server runs and sauce labs integration.
48
+ - Removed a rogue puts, and tested logging fix (which was addressed in previous commit). Fixes #3
49
+ - Refactoring complete for browser selection
50
+ - Added missing requires
51
+ - Added Chrome and NoBrowser objects. Initial attempt at refactoring to remove the case statement in runner.
52
+ - Fixed a bug in the firefox binary path setter, and bumped the version to 1.5.1
53
+
54
+ #1.5.0 (2013-05-13)
55
+ - Bumped version to 1.5.0
56
+ - Added firefox binary path as a config parameter for local testing.
57
+
58
+ #1.4.0 (2013-05-10)
59
+ - Added IE support and abstracted the firefox and ie runners into a runner directory.
60
+ - Updated spec for some pending actions
61
+ - *sigh* I always forget the -a
62
+ - Abstracted Firefox functionality out into its own class within Runner. Also added scaffolding for IE support. Lastly, fixed a bug by removing a hard-code dependency to the Remote::Bridge class which was done based on a faulty assumption.
63
+ - Minor tweak to the readme
64
+
65
+ #1.3.0 (2013-05-09)
66
+ - Bumping version to 1.3.0
67
+ - Added a test for logging, and updated the server to properly wrap the logging parameter on rake task creation -- fixes #2. Also caught a bug introduced with the previous profile commit -- fixed with a small nil check.
68
+ - Added profile name selection for firefox and cleaned up the tests a bit. Also fixed the default configuration params setter, fixes #1
69
+ - Ported example.rb into an RSpec spec, and added rspec as a development dependency in the gemspec
70
+ - Removed Gemfile.lock from the repo per recommendations from jwieringa and radar in https://github.com/arrgyle/chemistrykit/pull/14
71
+ - Got schooled by Jim Gay that == returns true or false, so no ternary or then action required. Hella simplified.
72
+ - Switched out the if/then in localhost? to a ternary operator
73
+ - Merge branch 'master' of https://github.com/arrgyle/selenium-connect
74
+ - Simplified the localhost method based on Jim Gay's feedback
75
+ - Bumping badget to the right of the title
76
+ - Adding Code Climate badge.
77
+ - Bumped version for bug fix
78
+ - Moved sensible defaults setting from runner into configuration
79
+ - Renamed all of the bits to selenium-connect
80
+ - Sanitizing.
81
+
82
+ #v.1.2.0 (2013-04-18)
83
+
84
+ #1.1.0 (2013-04-18)
85
+
86
+ #1.0.0 (2013-04-18)
87
+ - Initial Release
data/README.md CHANGED
@@ -19,16 +19,24 @@ SeleniumConnect.finish
19
19
  ## Helpful bits
20
20
 
21
21
  ### Start
22
- If host is set to "localhost", it will download the latest selenium-standalone-server.jar (unless it already has) and run it. Or, you can specify your own jar (if you have one you prefer to use). If no additional parameters are set, it will be exected in the background, with logging disabled. This functionality is driven using the [Selenium Rake Server Task](http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/Rake/ServerTask.html).
22
+ If host is set to "localhost" and no jar file is specified, it will run the version of [selenium-standalone-server.jar](https://code.google.com/p/selenium/downloads/list) that is bundled with the library (currently 2.33.0). Or, you can specify your own jar if you have one you prefer to use. This is done with c.jar = 'path-to-jar-file'.
23
+
24
+ If no additional parameters are set, the Selenium Server will be run in the background with logging disabled. If a logging directory is provided (with c.log = 'path-to-log-dir') then 3 output files will be generated:
25
+ + Selenium Server JSON Wire Protocol output (server.log)
26
+ + Browser output (browser.log) -- currently only available for Firefox
27
+ + Test output (SPEC-testname.xml)
28
+
29
+ This localhost functionality is driven using the [Selenium Rake Server Task](http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/Rake/ServerTask.html).
23
30
 
24
31
  ### Finish
25
- Issues a quit command to the driver (and stops the local server if your host is set to "localhost").
32
+ The finish command issues a quit command to the driver and stops the local server if your host is set to "localhost".
26
33
 
27
34
  ### Support
28
- - Firefox (standard, profile by path, profile by name, browser binary)
29
- - Internet Explorer
30
- - Chrome
31
- - SauceLabs
35
+ - [Firefox](https://github.com/arrgyle/selenium-connect/blob/develop/spec/acceptance/firefox_spec.rb)
36
+ - [Chrome](https://github.com/arrgyle/selenium-connect/blob/develop/spec/acceptance/chrome_spec.rb)
37
+ - [Internet Explorer](https://github.com/arrgyle/selenium-connect/blob/develop/spec/acceptance/ie_spec.rb)
38
+ - [PhantomJS](https://github.com/arrgyle/selenium-connect/blob/develop/spec/acceptance/headless_spec.rb)
39
+ - [SauceLabs](https://github.com/arrgyle/selenium-connect/blob/develop/spec/acceptance/sauce_spec.rb)
32
40
 
33
41
  ## Contributing
34
42
 
@@ -40,4 +48,4 @@ This project conforms to the [neverstopbuilding/craftsmanship](https://github.co
40
48
 
41
49
  ### Run the Tests
42
50
 
43
- bundle exec rspec
51
+ bundle exec rake build
data/Rakefile CHANGED
@@ -4,11 +4,14 @@ require 'rspec/core/rake_task'
4
4
  task :default => [:build]
5
5
 
6
6
  desc 'Runs standard build activities.'
7
- task :build => [:clean, :spec]
7
+ task :build => [:clean, :prepare, :spec]
8
8
 
9
9
  desc 'Removes the build directory.'
10
10
  task :clean do
11
11
  FileUtils.rm_rf('build');
12
12
  end
13
-
13
+ desc 'Adds the build tmp directory for test kit creation.'
14
+ task :prepare do
15
+ FileUtils.mkdir_p('build/tmp')
16
+ end
14
17
  RSpec::Core::RakeTask.new(:spec)
@@ -29,7 +29,7 @@ module SeleniumConnect
29
29
  if configuration.jar
30
30
  "t.jar = '#{configuration.jar}'"
31
31
  else
32
- "t.version = :latest"
32
+ "t.jar = '#{current_dir_path + '/../../bin/selenium-server-standalone-2.33.0.jar'}'"
33
33
  end
34
34
  }
35
35
  t.background
@@ -33,7 +33,11 @@ module SeleniumConnect
33
33
  end
34
34
 
35
35
  def finish
36
- driver.quit
36
+ begin
37
+ driver.quit
38
+ rescue Selenium::WebDriver::Error::WebDriverError
39
+ #no-op
40
+ end
37
41
  if localhost? then server.stop end
38
42
  end
39
43
 
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'selenium-connect'
3
- s.version = '1.9.3'
3
+ s.version = '2.0.0'
4
4
  s.platform = Gem::Platform::RUBY
5
- s.authors = ['Dave Haeffner']
6
- s.email = ['dave@arrgyle.com']
5
+ s.authors = ['Dave Haeffner', 'Jason Fox']
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 = 'Fixed logging bug.'
9
+ s.description = 'Added the latest selenium server jar to the gem, updated documentation, and fixed a performance issue when running against localhost.'
10
10
  s.license = 'MIT'
11
11
 
12
12
  s.files = `git ls-files`.split($/)
@@ -0,0 +1,19 @@
1
+ require 'selenium-connect'
2
+ require_relative 'helper'
3
+
4
+ describe "Chrome" do
5
+
6
+ let(:google) { Google.new(SeleniumConnect.start) }
7
+ let(:quit) { SeleniumConnect.finish }
8
+
9
+ it "localhost" do
10
+ #currently only works on Mac
11
+ SeleniumConnect.configure do |c|
12
+ c.browser = 'chrome'
13
+ end
14
+ google.visit
15
+ google.page_title.should include("Google")
16
+ quit
17
+ end
18
+
19
+ end
@@ -25,7 +25,7 @@ describe "Firefox" do
25
25
  it "local jar file specified" do
26
26
  SeleniumConnect.configure do |c|
27
27
  c.host = "localhost"
28
- c.jar = "#{Dir.pwd}/selenium-server-standalone-2.33.0.jar"
28
+ c.jar = "#{Dir.pwd}/bin/selenium-server-standalone-2.33.0.jar"
29
29
  end
30
30
  google.visit
31
31
  google.page_title.should include("Google")
@@ -2,25 +2,25 @@ require 'selenium-connect'
2
2
  require_relative 'helper'
3
3
 
4
4
  describe "Logging" do
5
- let(:google) { Google.new(SeleniumConnect.start) }
6
- let(:log_dir) { File.join(Dir.pwd, 'build') }
7
5
 
8
6
  before(:all) do
7
+ @log_dir = 'build'
8
+
9
9
  SeleniumConnect.configure do |c|
10
- c.log = log_dir
10
+ c.log = @log_dir
11
11
  end
12
12
 
13
- google.visit
13
+ Google.new(SeleniumConnect.start).visit
14
14
  SeleniumConnect.finish
15
15
  end
16
16
 
17
17
  it "server" do
18
- server_log = File.read(log_dir+'/server.log')
18
+ server_log = File.read(@log_dir+'/server.log')
19
19
  server_log.empty?.should be false
20
20
  end
21
21
 
22
22
  it "browser" do
23
- browser_log = File.read(log_dir+'/firefox.log')
23
+ browser_log = File.read(@log_dir+'/firefox.log')
24
24
  browser_log.empty?.should be false
25
25
  end
26
26
  end
File without changes
data/spec/example.yaml CHANGED
@@ -8,8 +8,8 @@ host: 'localhost'
8
8
  port:
9
9
 
10
10
 
11
- #Browser & Host
12
- browser: 'chrome'
11
+ #Browser
12
+ browser: 'firefox'
13
13
  browser_path:
14
14
  profile_path:
15
15
  profile_name:
@@ -0,0 +1,12 @@
1
+ require 'selenium-connect'
2
+
3
+ describe "Quit and Finish" do
4
+
5
+ it "quit when already finished doesn't blow up" do
6
+ SeleniumConnect.configure do |c| end
7
+ @driver = SeleniumConnect.start
8
+ @driver.quit
9
+ SeleniumConnect.finish
10
+ end
11
+
12
+ end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dave Haeffner
9
+ - Jason Fox
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-06-22 00:00:00.000000000 Z
13
+ date: 2013-06-27 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: selenium-webdriver
@@ -75,22 +76,25 @@ dependencies:
75
76
  - - ! '>='
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
- description: Fixed logging bug.
79
+ description: Added the latest selenium server jar to the gem, updated documentation,
80
+ and fixed a performance issue when running against localhost.
79
81
  email:
80
82
  - dave@arrgyle.com
83
+ - jason@arrgyle.com
81
84
  executables: []
82
85
  extensions: []
83
86
  extra_rdoc_files: []
84
87
  files:
85
88
  - .gitignore
86
- - .rvmrc
89
+ - .ruby-gemset
90
+ - .ruby-version
87
91
  - CHANGELOG.md
88
92
  - Gemfile
89
93
  - README.md
90
94
  - Rakefile
91
95
  - bin/chromedriver
92
96
  - bin/phantomjs
93
- - build/.gitkeep
97
+ - bin/selenium-server-standalone-2.33.0.jar
94
98
  - lib/selenium-connect.rb
95
99
  - lib/selenium-connect/configuration.rb
96
100
  - lib/selenium-connect/runner.rb
@@ -102,14 +106,16 @@ files:
102
106
  - lib/selenium-connect/runners/saucelabs.rb
103
107
  - lib/selenium-connect/server.rb
104
108
  - selenium-connect.gemspec
109
+ - spec/acceptance/chrome_spec.rb
105
110
  - spec/acceptance/firefox_spec.rb
106
111
  - spec/acceptance/headless_spec.rb
107
112
  - spec/acceptance/helper.rb
108
113
  - spec/acceptance/ie_spec.rb
109
114
  - spec/acceptance/logging_spec.rb
115
+ - spec/acceptance/sauce_spec.rb
110
116
  - spec/example.yaml
117
+ - spec/quit_and_finish_spec.rb
111
118
  - spec/runners/phantomjs_spec.rb
112
- - spec/sauce_spec.rb
113
119
  - spec/yaml_spec.rb
114
120
  homepage: https://github.com/arrgyle/selenium-connect
115
121
  licenses:
@@ -132,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
138
  version: '0'
133
139
  requirements: []
134
140
  rubyforge_project:
135
- rubygems_version: 1.8.24
141
+ rubygems_version: 1.8.25
136
142
  signing_key:
137
143
  specification_version: 3
138
144
  summary: A stupid simple way to run your Selenium tests on localhost, against a Selenium
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.3@selenium-connect
data/build/.gitkeep DELETED
File without changes