watirgrid 1.0.4 → 1.0.5

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.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gem.email = "tim.koops@gmail.com"
10
10
  gem.homepage = "http://github.com/90kts/watirgrid"
11
11
  gem.authors = ["Tim Koopmans"]
12
- gem.version = "1.0.4"
12
+ gem.version = "1.0.5"
13
13
  end
14
14
  rescue LoadError
15
15
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
data/lib/provider.rb CHANGED
@@ -33,12 +33,24 @@ module Watir
33
33
  when :webdriver
34
34
  require 'watir-webdriver'
35
35
  @browser = Watir::Browser
36
+ when :selenium
37
+ require 'selenium-webdriver'
38
+ @browser = Selenium::WebDriver
36
39
  end
37
40
  end
38
41
 
39
42
  def new_browser(webdriver_browser_type = nil)
40
- if webdriver_browser_type
41
- @browser.new(webdriver_browser_type)
43
+ case @browser.inspect
44
+ when "Selenium::WebDriver"
45
+ @browser.for webdriver_browser_type
46
+ when "Watir::Browser"
47
+ @browser.new webdriver_browser_type
48
+ when "Watir::Safari"
49
+ @browser.new
50
+ when "FireWatir::Firefox"
51
+ @browser.new
52
+ when "Watir::IE"
53
+ @browser.new
42
54
  else
43
55
  @browser.new
44
56
  end
@@ -0,0 +1,47 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ describe 'Using the Grid with WebDriver' do
3
+ before(:all) do
4
+ @controller = Controller.new(
5
+ :ring_server_port => 12356,
6
+ :loglevel => Logger::ERROR)
7
+ @controller.start
8
+ 1.upto(1) do
9
+ provider = Provider.new(
10
+ :ring_server_port => 12356,
11
+ :loglevel => Logger::ERROR, :browser_type => 'selenium')
12
+ provider.start
13
+ end
14
+ end
15
+
16
+ after(:all) do
17
+ @controller.stop
18
+ end
19
+
20
+ it 'should take the last provider on the grid and execute some Watir code in Selenium::WebDriver with Firefox' do
21
+ grid = Watir::Grid.new(:ring_server_port => 12356)
22
+ grid.start(:quantity => 1, :take_all => true)
23
+ threads = []
24
+ grid.browsers.each do |browser|
25
+ threads << Thread.new do
26
+ browser[:hostname].should == `hostname`.strip
27
+ browser[:architecture].should == Config::CONFIG['arch']
28
+ browser[:browser_type].should == 'selenium'
29
+ driver = browser[:object].new_browser(:firefox)
30
+ driver.navigate.to "http://google.com"
31
+ element = driver.find_element(:name, 'q')
32
+ element.send_keys "Hello WebDriver!"
33
+ element.submit
34
+ driver.quit
35
+ end
36
+ end
37
+ threads.each {|thread| thread.join}
38
+ grid.size.should == 1
39
+ end
40
+
41
+ it 'should find no more providers on the grid' do
42
+ grid = Watir::Grid.new(:ring_server_port => 12356)
43
+ grid.start(:read_all => true)
44
+ grid.size.should == 0
45
+ end
46
+ end
47
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirgrid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Koopmans
@@ -15,15 +15,15 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-09 00:00:00 -07:00
18
+ date: 2011-04-19 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
22
22
  description: WatirGrid allows for distributed testing across a grid network using Watir.
23
23
  email: tim.koops@gmail.com
24
24
  executables:
25
- - controller
26
25
  - listener
26
+ - controller
27
27
  - provider
28
28
  extensions: []
29
29
 
@@ -32,7 +32,6 @@ extra_rdoc_files:
32
32
  - README.rdoc
33
33
  files:
34
34
  - .document
35
- - .gitignore
36
35
  - EXAMPLES.rdoc
37
36
  - LICENSE
38
37
  - README.rdoc
@@ -59,13 +58,14 @@ files:
59
58
  - spec/webdriver_remote_spec.rb
60
59
  - spec/webdriver_spec.rb
61
60
  - watirgrid.gemspec
61
+ - spec/selenium_webdriver_spec.rb
62
62
  has_rdoc: true
63
63
  homepage: http://github.com/90kts/watirgrid
64
64
  licenses: []
65
65
 
66
66
  post_install_message:
67
- rdoc_options:
68
- - --charset=UTF-8
67
+ rdoc_options: []
68
+
69
69
  require_paths:
70
70
  - lib
71
71
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -94,14 +94,15 @@ signing_key:
94
94
  specification_version: 3
95
95
  summary: "WatirGrid: Web Application Testing in Ruby across a grid network."
96
96
  test_files:
97
+ - examples/basic/example_safariwatir.rb
98
+ - examples/basic/example_webdriver.rb
99
+ - examples/basic/example_webdriver_remote.rb
100
+ - examples/cucumber/step_definitions/example_steps.rb
97
101
  - spec/grid_spec.rb
98
102
  - spec/gridinit_spec.rb
99
103
  - spec/memory_spec.rb
104
+ - spec/selenium_webdriver_spec.rb
100
105
  - spec/spec_helper.rb
101
106
  - spec/utilities_spec.rb
102
107
  - spec/webdriver_remote_spec.rb
103
108
  - spec/webdriver_spec.rb
104
- - examples/basic/example_safariwatir.rb
105
- - examples/basic/example_webdriver.rb
106
- - examples/basic/example_webdriver_remote.rb
107
- - examples/cucumber/step_definitions/example_steps.rb
data/.gitignore DELETED
@@ -1,22 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- doc
20
- pkg
21
-
22
- ## PROJECT::SPECIFIC