watirgrid 0.0.8.pre → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,26 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
- describe 'WatirGrid Utilities' do
3
+ describe 'Utility Functions for the Grid' do
4
4
  before(:all) do
5
- controller = Controller.new(
6
- :ring_server_port => 12351,
5
+ @controller = Controller.new(
6
+ :ring_server_port => 12353,
7
7
  :loglevel => Logger::ERROR)
8
- controller.start
8
+ @controller.start
9
9
  1.upto(1) do
10
10
  provider = Provider.new(
11
- :ring_server_port => 12351,
11
+ :ring_server_port => 12353,
12
12
  :loglevel => Logger::ERROR, :browser_type => 'safari')
13
13
  provider.start
14
14
  end
15
- grid = Watir::Grid.new(:ring_server_port => 12351,
16
- :ring_server_host => '127.0.0.1')
15
+ grid = Watir::Grid.new(:ring_server_port => 12353)
17
16
  grid.start(:read_all => true)
18
17
  @browser = grid.browsers[0]
19
18
  end
20
19
 
20
+ after(:all) do
21
+ @controller.stop
22
+ end
23
+
21
24
  it 'should get the logged-in user for the remote provider' do
22
25
  @browser[:object].get_logged_in_user.should == `whoami`.chomp
23
26
  end
@@ -48,4 +51,4 @@ describe 'WatirGrid Utilities' do
48
51
  @browser[:object].kill_all_browsers
49
52
  @browser[:object].get_running_browsers.size.should == 0
50
53
  end
51
- end
54
+ end
@@ -0,0 +1,35 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
3
+ require 'extensions/remote'
4
+
5
+ describe 'Using the Grid with WebDriver Remote' do
6
+ before(:all) do
7
+ @controller = Controller.new(
8
+ :loglevel => Logger::ERROR)
9
+ @controller.start
10
+ provider = Provider.new(
11
+ :loglevel => Logger::ERROR, :browser_type => 'webdriver_remote')
12
+ provider.start
13
+ end
14
+
15
+ after(:all) do
16
+ @controller.stop
17
+ end
18
+
19
+ it 'should take the last provider on the grid and execute some Watir code in WebDriver with HtmlUnit' do
20
+ grid = Watir::Grid.new
21
+ grid.start(:quantity => 1, :take_all => true)
22
+ threads = []
23
+ grid.browsers.each do |browser|
24
+ threads << Thread.new do
25
+ b = browser[:object].new_browser(:htmlunit)
26
+ b.goto("http://www.google.com")
27
+ b.text_field(:name, 'q').set("watirgrid")
28
+ b.button(:name, "btnI").click
29
+ b.close
30
+ end
31
+ end
32
+ threads.each {|thread| thread.join}
33
+ grid.size.should == 1
34
+ end
35
+ end
@@ -1,59 +1,45 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe 'WatirGrid' do
4
- before(:all) do
5
- controller = Controller.new(
6
- :ring_server_port => 12351,
7
- :loglevel => Logger::ERROR)
8
- controller.start
9
- 1.upto(1) do
10
- provider = Provider.new(
11
- :ring_server_port => 12351,
12
- :loglevel => Logger::ERROR, :browser_type => 'webdriver')
13
- provider.start
14
- end
15
- end
16
-
17
- it 'should return how many grid are available in the tuplespace' do
18
- grid = Watir::Grid.new(:ring_server_port => 12351,
19
- :ring_server_host => '127.0.0.1')
20
- grid.start(:read_all => true)
21
- grid.size.should == 1
22
- end
23
-
24
- it 'should find at least one browser in the tuplespace' do
25
- grid = Watir::Grid.new(:ring_server_port => 12351,
26
- :ring_server_host => '127.0.0.1')
27
- grid.start(:quantity => 1, :read_all => true)
28
- grid.size.should == 1
29
- end
30
-
31
- it 'should take the first (and last) browser and execute some watir commands' do
32
- grid = Watir::Grid.new(:ring_server_port => 12351,
33
- :ring_server_host => '127.0.0.1')
34
- grid.start(:quantity => 1, :take_all => true)
35
- threads = []
36
- grid.browsers.each do |browser|
37
- threads << Thread.new do
38
- browser[:hostname].should == `hostname`.strip
39
- browser[:architecture].should == Config::CONFIG['arch']
40
- browser[:browser_type].should == 'webdriver'
41
- b = browser[:object].new_browser(:ie)
42
- b.goto("http://www.google.com")
43
- b.text_field(:name, 'q').set("watirgrid")
44
- b.button(:name, "btnI").click
45
- end
46
- end
47
- threads.each {|thread| thread.join}
48
- grid.size.should == 1
49
- end
50
-
51
- it 'should find no more tuples in the tuplespace' do
52
- grid = Watir::Grid.new(:ring_server_port => 12351,
53
- :ring_server_host => '127.0.0.1')
54
- grid.start(:read_all => true)
55
- grid.size.should == 0
56
- end
57
-
58
- end
59
-
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 => 'webdriver')
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 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 == 'webdriver'
29
+ b = browser[:object].new_browser(:firefox)
30
+ b.goto("http://www.google.com")
31
+ b.text_field(:name, 'q').set("watirgrid")
32
+ b.button(:name, "btnI").click
33
+ b.close
34
+ end
35
+ end
36
+ threads.each {|thread| thread.join}
37
+ grid.size.should == 1
38
+ end
39
+
40
+ it 'should find no more providers on the grid' do
41
+ grid = Watir::Grid.new(:ring_server_port => 12356)
42
+ grid.start(:read_all => true)
43
+ grid.size.should == 0
44
+ end
45
+ end
data/watirgrid.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{watirgrid}
8
- s.version = "0.0.8.pre"
8
+ s.version = "0.0.9"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tim Koopmans"]
12
- s.date = %q{2010-10-11}
12
+ s.date = %q{2011-02-16}
13
13
  s.description = %q{WatirGrid allows for distributed testing across a grid network using Watir.}
14
14
  s.email = %q{tim.koops@gmail.com}
15
15
  s.executables = ["controller", "provider"]
@@ -21,61 +21,53 @@ Gem::Specification.new do |s|
21
21
  ".document",
22
22
  ".gitignore",
23
23
  "EXAMPLES.rdoc",
24
- "HISTORY.rdoc",
25
24
  "LICENSE",
26
25
  "README.rdoc",
27
26
  "Rakefile",
28
27
  "bin/controller",
29
28
  "bin/provider",
30
- "examples/find_by_uuid.rb",
31
- "examples/google.rb",
32
- "examples/info.rb",
33
- "examples/restart_firefox.rb",
34
- "examples/simple.rb",
29
+ "examples/basic/example_safariwatir.rb",
30
+ "examples/basic/example_webdriver.rb",
31
+ "examples/basic/example_webdriver_remote.rb",
32
+ "examples/cucumber/example.feature",
33
+ "examples/cucumber/step_definitions/example_steps.rb",
35
34
  "lib/controller.rb",
35
+ "lib/extensions/remote.rb",
36
+ "lib/extensions/selenium-server-standalone-2.0b1.jar",
36
37
  "lib/provider.rb",
37
38
  "lib/watirgrid.rb",
39
+ "logo.png",
38
40
  "spec/grid_spec.rb",
39
- "spec/spec.opts",
40
41
  "spec/spec_helper.rb",
41
- "spec/stub.rb",
42
- "spec/tuples_spec.rb",
43
42
  "spec/utilities_spec.rb",
44
- "spec/watirgrid_spec.rb",
43
+ "spec/webdriver_remote_spec.rb",
44
+ "spec/webdriver_spec.rb",
45
45
  "watirgrid.gemspec"
46
46
  ]
47
47
  s.homepage = %q{http://github.com/90kts/watirgrid}
48
48
  s.rdoc_options = ["--charset=UTF-8"]
49
49
  s.require_paths = ["lib"]
50
- s.rubygems_version = %q{1.3.7}
50
+ s.rubygems_version = %q{1.4.2}
51
51
  s.summary = %q{WatirGrid: Web Application Testing in Ruby across a grid network.}
52
52
  s.test_files = [
53
53
  "spec/grid_spec.rb",
54
54
  "spec/spec_helper.rb",
55
- "spec/stub.rb",
56
- "spec/tuples_spec.rb",
57
55
  "spec/utilities_spec.rb",
58
- "spec/watir_spec.rb",
59
- "spec/watirgrid_spec.rb",
56
+ "spec/webdriver_remote_spec.rb",
60
57
  "spec/webdriver_spec.rb",
61
- "examples/find_by_uuid.rb",
62
- "examples/google.rb",
63
- "examples/info.rb",
64
- "examples/restart_firefox.rb",
65
- "examples/simple.rb"
58
+ "examples/basic/example_safariwatir.rb",
59
+ "examples/basic/example_webdriver.rb",
60
+ "examples/basic/example_webdriver_remote.rb",
61
+ "examples/cucumber/step_definitions/example_steps.rb"
66
62
  ]
67
63
 
68
64
  if s.respond_to? :specification_version then
69
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
70
65
  s.specification_version = 3
71
66
 
72
67
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
73
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
74
68
  else
75
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
76
69
  end
77
70
  else
78
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
79
71
  end
80
72
  end
81
73
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watirgrid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961916004
5
- prerelease: true
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- - pre
11
- version: 0.0.8.pre
9
+ - 9
10
+ version: 0.0.9
12
11
  platform: ruby
13
12
  authors:
14
13
  - Tim Koopmans
@@ -16,25 +15,10 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-10-11 00:00:00 +11:00
18
+ date: 2011-02-16 00:00:00 +11:00
20
19
  default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- name: rspec
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 13
31
- segments:
32
- - 1
33
- - 2
34
- - 9
35
- version: 1.2.9
36
- type: :development
37
- version_requirements: *id001
20
+ dependencies: []
21
+
38
22
  description: WatirGrid allows for distributed testing across a grid network using Watir.
39
23
  email: tim.koops@gmail.com
40
24
  executables:
@@ -49,30 +33,28 @@ files:
49
33
  - .document
50
34
  - .gitignore
51
35
  - EXAMPLES.rdoc
52
- - HISTORY.rdoc
53
36
  - LICENSE
54
37
  - README.rdoc
55
38
  - Rakefile
56
39
  - bin/controller
57
40
  - bin/provider
58
- - examples/find_by_uuid.rb
59
- - examples/google.rb
60
- - examples/info.rb
61
- - examples/restart_firefox.rb
62
- - examples/simple.rb
41
+ - examples/basic/example_safariwatir.rb
42
+ - examples/basic/example_webdriver.rb
43
+ - examples/basic/example_webdriver_remote.rb
44
+ - examples/cucumber/example.feature
45
+ - examples/cucumber/step_definitions/example_steps.rb
63
46
  - lib/controller.rb
47
+ - lib/extensions/remote.rb
48
+ - lib/extensions/selenium-server-standalone-2.0b1.jar
64
49
  - lib/provider.rb
65
50
  - lib/watirgrid.rb
51
+ - logo.png
66
52
  - spec/grid_spec.rb
67
- - spec/spec.opts
68
53
  - spec/spec_helper.rb
69
- - spec/stub.rb
70
- - spec/tuples_spec.rb
71
54
  - spec/utilities_spec.rb
72
- - spec/watirgrid_spec.rb
73
- - watirgrid.gemspec
74
- - spec/watir_spec.rb
55
+ - spec/webdriver_remote_spec.rb
75
56
  - spec/webdriver_spec.rb
57
+ - watirgrid.gemspec
76
58
  has_rdoc: true
77
59
  homepage: http://github.com/90kts/watirgrid
78
60
  licenses: []
@@ -94,32 +76,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
76
  required_rubygems_version: !ruby/object:Gem::Requirement
95
77
  none: false
96
78
  requirements:
97
- - - ">"
79
+ - - ">="
98
80
  - !ruby/object:Gem::Version
99
- hash: 25
81
+ hash: 3
100
82
  segments:
101
- - 1
102
- - 3
103
- - 1
104
- version: 1.3.1
83
+ - 0
84
+ version: "0"
105
85
  requirements: []
106
86
 
107
87
  rubyforge_project:
108
- rubygems_version: 1.3.7
88
+ rubygems_version: 1.4.2
109
89
  signing_key:
110
90
  specification_version: 3
111
91
  summary: "WatirGrid: Web Application Testing in Ruby across a grid network."
112
92
  test_files:
113
93
  - spec/grid_spec.rb
114
94
  - spec/spec_helper.rb
115
- - spec/stub.rb
116
- - spec/tuples_spec.rb
117
95
  - spec/utilities_spec.rb
118
- - spec/watir_spec.rb
119
- - spec/watirgrid_spec.rb
96
+ - spec/webdriver_remote_spec.rb
120
97
  - spec/webdriver_spec.rb
121
- - examples/find_by_uuid.rb
122
- - examples/google.rb
123
- - examples/info.rb
124
- - examples/restart_firefox.rb
125
- - examples/simple.rb
98
+ - examples/basic/example_safariwatir.rb
99
+ - examples/basic/example_webdriver.rb
100
+ - examples/basic/example_webdriver_remote.rb
101
+ - examples/cucumber/step_definitions/example_steps.rb
data/HISTORY.rdoc DELETED
@@ -1,18 +0,0 @@
1
- == Release Notes
2
- === 0.0.1
3
- Added access control lists for the controller and provider. This lets the user specify ACLs by way of simple white/blacklist security similar to that used by the Unix /etc/hosts.allow and /etc/hosts.deny files. The ACL constructor takes an array of strings. The first string of a pair is always “allow” or “deny”, and it’s followed by the address or addresses to allow or deny access.
4
-
5
- e.g.
6
- provider.rb -a deny,all,allow,127.0.0.1
7
- This would deny all access to this provider by default and allow access only from the localhost (127.0.0.1). This is the default setting if no ACLs are specified from the command line. This would affect all connectivity from the controller to the providers.
8
-
9
- e.g.
10
- controller -a deny,all,allow,192.168.1.*
11
- This would deny all access to the controller by default with access allowed from any host in the 192.168.1.* subnet. This would affect all connectivity from the providers to the controller.
12
-
13
- Added startup bin scripts for the provider and controller. Ruby Gems will automatically deploy these on installation.
14
-
15
- ---
16
- === 0.0.2
17
- Allowed specification of remote host for ring server with -h option on provider.
18
-
@@ -1,28 +0,0 @@
1
- require 'rubygems'
2
- require '../lib/watirgrid'
3
-
4
- grid = Watir::Grid.new(:ring_server_port => 12358,
5
- :ring_server_host => '192.168.1.102',
6
- :loglevel => Logger::DEBUG)
7
- grid.start(:read_all => true)
8
-
9
- threads = []
10
- grid.browsers.each do |browser|
11
- threads << Thread.new do
12
- @uuid = browser[:uuid]
13
- p @uuid
14
- end
15
- end
16
- threads.each {|thread| thread.join}
17
-
18
- grid.start(:read_all => true, :uuid => @uuid)
19
-
20
- threads = []
21
- grid.browsers.each do |browser|
22
- threads << Thread.new do
23
- @uuid = browser[:uuid]
24
- p @uuid
25
- end
26
- end
27
- threads.each {|thread| thread.join}
28
-
data/examples/google.rb DELETED
@@ -1,19 +0,0 @@
1
- require 'rubygems'
2
- require '../lib/watirgrid'
3
-
4
- grid = Watir::Grid.new(:ring_server_port => 12358,
5
- :ring_server_host => '192.168.1.102',
6
- :loglevel => Logger::DEBUG)
7
- grid.start(:read_all => true)
8
-
9
- threads = []
10
- grid.browsers.each do |browser|
11
- threads << Thread.new do
12
- b = browser[:object].new_browser
13
- b.goto("http://google.com.au/")
14
- b.text_field(:name, 'q').set("performance & test automation specialists")
15
- sleep 1
16
- b.button(:name, 'btnI').click
17
- end
18
- end
19
- threads.each {|thread| thread.join}
data/examples/info.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'rubygems'
2
- require '../lib/watirgrid'
3
-
4
- grid = Watir::Grid.new(:ring_server_port => 12358,
5
- :ring_server_host => '192.168.1.102', :loglevel => Logger::DEBUG)
6
- grid.start(:read_all => true)
7
-
8
- threads = []
9
- grid.browsers.each do |browser|
10
- threads << Thread.new do
11
- p browser
12
- end
13
- end
14
- threads.each {|thread| thread.join}
@@ -1,14 +0,0 @@
1
- require 'rubygems'
2
- require '../lib/watirgrid'
3
-
4
- grid = Watir::Grid.new(:ring_server_port => 12358,
5
- :ring_server_host => '192.168.1.102', :loglevel => Logger::DEBUG)
6
- grid.start(:read_all => true)
7
-
8
- threads = []
9
- grid.browsers.each do |browser|
10
- threads << Thread.new do
11
- p browser
12
- end
13
- end
14
- threads.each {|thread| thread.join}
data/examples/simple.rb DELETED
@@ -1,19 +0,0 @@
1
- require 'rubygems'
2
- require '../lib/watirgrid'
3
-
4
- grid = Watir::Grid.new(:ring_server_port => 12358,
5
- :ring_server_host => '192.168.1.102',
6
- :loglevel => Logger::DEBUG)
7
- grid.start(:read_all => true)
8
-
9
- threads = []
10
- grid.browsers.each do |browser|
11
- threads << Thread.new do
12
- b = browser[:object].new_browser
13
- b.goto("http://192.168.1.102:4567/")
14
- b.text_field(:name, 'username').set("I am robot")
15
- sleep 1
16
- b.button(:id, 'go').click
17
- end
18
- end
19
- threads.each {|thread| thread.join}
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --color
data/spec/stub.rb DELETED
@@ -1,48 +0,0 @@
1
- require 'rubygems'
2
- require 'sinatra'
3
- require 'haml'
4
-
5
- get '/load/:browser_id/:browser_object_id' do
6
- params[:browser_object_id]
7
- end
8
-
9
- get '/' do
10
- haml :example
11
- end
12
-
13
- post '/' do
14
- "Congratulations #{params[:username]}, you hit the button!"
15
- end
16
-
17
- __END__
18
-
19
- @@ layout
20
- %html
21
- = yield
22
-
23
- @@ example
24
- %style{:type=>"text/css"}
25
- :plain
26
- input {
27
- border-bottom-style: inset;
28
- border-bottom-width: 2px;
29
- border-left-style: inset;
30
- border-left-width: 2px;
31
- border-right-style: inset;
32
- border-right-width: 2px;
33
- border-top-style: inset;
34
- border-top-width: 2px;
35
- font-family: arial, sans-serif;
36
- font-size: 30px;
37
- font-style: normal;
38
- font-variant: normal;
39
- font-weight: normal;
40
- height: 40px;
41
- width: 200px;
42
- }
43
- %form{:action=>'/', :method=>'POST'}
44
- %input{:name=>'username', :value=>'username'}
45
- %button{:id=>'go', :type=>'submit'} GO
46
-
47
-
48
-
data/spec/tuples_spec.rb DELETED
@@ -1,46 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe 'When taking tuples from the grid' do
4
- before(:all) do
5
- controller = Controller.new(
6
- :ring_server_port => 12351,
7
- :loglevel => Logger::ERROR)
8
- controller.start
9
- 1.upto(5) do
10
- provider = Provider.new(
11
- :ring_server_port => 12351,
12
- :loglevel => Logger::ERROR, :browser_type => 'safari')
13
- provider.start
14
- end
15
- end
16
-
17
- it 'should start 1st grid and take all tuples' do
18
- grid1 = Watir::Grid.new(:ring_server_port => 12351,
19
- :ring_server_host => '127.0.0.1')
20
- grid1.start(:take_all => true)
21
- grid1.size.should == 5
22
-
23
- describe 'Then for subsequent grids' do
24
- it 'should start 2nd grid and confirm there are no more tuples' do
25
- grid2 = Watir::Grid.new(:ring_server_port => 12351,
26
- :ring_server_host => '127.0.0.1')
27
- grid2.start(:take_all => true)
28
- grid2.size.should == 0
29
- end
30
-
31
- it 'should release the tuples taken by the 1st grid' do
32
- grid1.release_tuples
33
- end
34
-
35
- it 'should start 3rd grid and confirm there are tuples available' do
36
- grid3 = Watir::Grid.new(:ring_server_port => 12351,
37
- :ring_server_host => '127.0.0.1')
38
- grid3.start(:take_all => true)
39
- grid3.size.should == 5
40
- end
41
-
42
- end
43
-
44
- end
45
-
46
- end