watirgrid 0.0.7 → 0.0.8.pre

Sign up to get free protection for your applications and to get access to all the features.
data/spec/stub.rb CHANGED
@@ -1,48 +1,48 @@
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
-
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 CHANGED
@@ -1,46 +1,46 @@
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
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
@@ -1,51 +1,51 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe 'WatirGrid Utilities' 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 => 'safari')
13
- provider.start
14
- end
15
- grid = Watir::Grid.new(:ring_server_port => 12351,
16
- :ring_server_host => '127.0.0.1')
17
- grid.start(:read_all => true)
18
- @browser = grid.browsers[0]
19
- end
20
-
21
- it 'should get the logged-in user for the remote provider' do
22
- @browser[:object].get_logged_in_user.should == `whoami`.chomp
23
- end
24
-
25
- it 'should enumerate any running browsers on the remote provider' do
26
- @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
27
- end
28
-
29
- it 'should be able to start a new firefox browser' do
30
- @browser[:object].start_firefox_jssh
31
- sleep 5
32
- @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
33
- end
34
-
35
- it 'should be able to kill all firefox browsers' do
36
- @browser[:object].kill_browser('firefox-bin')
37
- @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
38
- end
39
-
40
- it 'should be able to start a new firefox browser specified by path' do
41
- @browser[:object].start_firefox_jssh
42
- ("/Applications/Firefox.app/Contents/MacOS/firefox-bin")
43
- sleep 5
44
- @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
45
- end
46
-
47
- it 'should be able to kill all browsers' do
48
- @browser[:object].kill_all_browsers
49
- @browser[:object].get_running_browsers.size.should == 0
50
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe 'WatirGrid Utilities' 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 => 'safari')
13
+ provider.start
14
+ end
15
+ grid = Watir::Grid.new(:ring_server_port => 12351,
16
+ :ring_server_host => '127.0.0.1')
17
+ grid.start(:read_all => true)
18
+ @browser = grid.browsers[0]
19
+ end
20
+
21
+ it 'should get the logged-in user for the remote provider' do
22
+ @browser[:object].get_logged_in_user.should == `whoami`.chomp
23
+ end
24
+
25
+ it 'should enumerate any running browsers on the remote provider' do
26
+ @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
27
+ end
28
+
29
+ it 'should be able to start a new firefox browser' do
30
+ @browser[:object].start_firefox_jssh
31
+ sleep 5
32
+ @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
33
+ end
34
+
35
+ it 'should be able to kill all firefox browsers' do
36
+ @browser[:object].kill_browser('firefox-bin')
37
+ @browser[:object].get_running_browsers(['firefox-bin']).size.should == 0
38
+ end
39
+
40
+ it 'should be able to start a new firefox browser specified by path' do
41
+ @browser[:object].start_firefox_jssh
42
+ ("/Applications/Firefox.app/Contents/MacOS/firefox-bin")
43
+ sleep 5
44
+ @browser[:object].get_running_browsers(['firefox-bin']).size.should == 1
45
+ end
46
+
47
+ it 'should be able to kill all browsers' do
48
+ @browser[:object].kill_all_browsers
49
+ @browser[:object].get_running_browsers.size.should == 0
50
+ end
51
51
  end
@@ -0,0 +1,59 @@
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 => 'ie')
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 == 'ie'
41
+ b = browser[:object].new_browser
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,51 +1,51 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Controller do
4
- it 'should start a DRb and Ring Server when specifying NO interface or port' do
5
- controller = Controller.new
6
- controller.start
7
- controller.drb_server_uri.should =~ /druby/
8
- controller.stop
9
- end
10
-
11
- it 'should start a DRb and Ring Server on a specified interface' do
12
- controller = Controller.new(
13
- :drb_server_host => '127.0.0.1',
14
- :ring_server_host => '127.0.0.1')
15
- controller.start
16
- controller.drb_server_uri.should =~ /druby/
17
- controller.stop
18
- end
19
-
20
- it 'should start a DRb and Ring Server on specified ports' do
21
- controller = Controller.new(
22
- :drb_server_port => 11235,
23
- :ring_server_port => 12358)
24
- controller.start
25
- controller.drb_server_uri.should =~ /druby/
26
- controller.stop
27
- end
28
- end
29
-
30
- describe Provider do
31
- before(:all) do
32
- @controller = Controller.new(
33
- :drb_server_host => '127.0.0.1',
34
- :ring_server_host => '127.0.0.1',
35
- :ring_server_port => 12350)
36
- @controller.start
37
- end
38
-
39
- it 'should register a new provider on a specified port' do
40
- provider = Provider.new(
41
- :drb_server_host => '127.0.0.1',
42
- :ring_server_host => '127.0.0.1',
43
- :ring_server_port => 12350)
44
- provider.start
45
- end
46
-
47
- after(:all) do
48
- @controller.stop
49
- end
50
- end
51
-
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Controller do
4
+ it 'should start a DRb and Ring Server when specifying NO interface or port' do
5
+ controller = Controller.new
6
+ controller.start
7
+ controller.drb_server_uri.should =~ /druby/
8
+ controller.stop
9
+ end
10
+
11
+ it 'should start a DRb and Ring Server on a specified interface' do
12
+ controller = Controller.new(
13
+ :drb_server_host => '127.0.0.1',
14
+ :ring_server_host => '127.0.0.1')
15
+ controller.start
16
+ controller.drb_server_uri.should =~ /druby/
17
+ controller.stop
18
+ end
19
+
20
+ it 'should start a DRb and Ring Server on specified ports' do
21
+ controller = Controller.new(
22
+ :drb_server_port => 11235,
23
+ :ring_server_port => 12358)
24
+ controller.start
25
+ controller.drb_server_uri.should =~ /druby/
26
+ controller.stop
27
+ end
28
+ end
29
+
30
+ describe Provider do
31
+ before(:all) do
32
+ @controller = Controller.new(
33
+ :drb_server_host => '127.0.0.1',
34
+ :ring_server_host => '127.0.0.1',
35
+ :ring_server_port => 12350)
36
+ @controller.start
37
+ end
38
+
39
+ it 'should register a new provider on a specified port' do
40
+ provider = Provider.new(
41
+ :drb_server_host => '127.0.0.1',
42
+ :ring_server_host => '127.0.0.1',
43
+ :ring_server_port => 12350)
44
+ provider.start
45
+ end
46
+
47
+ after(:all) do
48
+ @controller.stop
49
+ end
50
+ end
51
+
@@ -0,0 +1,59 @@
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
+
data/watirgrid.gemspec CHANGED
@@ -5,13 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{watirgrid}
8
- s.version = ""
8
+ s.version = "0.0.8.pre"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tim Koopmans"]
12
- s.date = %q{2009-11-05}
12
+ s.date = %q{2010-10-11}
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
+ s.executables = ["controller", "provider"]
15
16
  s.extra_rdoc_files = [
16
17
  "LICENSE",
17
18
  "README.rdoc"
@@ -19,38 +20,56 @@ Gem::Specification.new do |s|
19
20
  s.files = [
20
21
  ".document",
21
22
  ".gitignore",
23
+ "EXAMPLES.rdoc",
24
+ "HISTORY.rdoc",
22
25
  "LICENSE",
23
26
  "README.rdoc",
24
27
  "Rakefile",
28
+ "bin/controller",
29
+ "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",
25
35
  "lib/controller.rb",
26
- "lib/extend.rb",
27
36
  "lib/provider.rb",
28
37
  "lib/watirgrid.rb",
38
+ "spec/grid_spec.rb",
29
39
  "spec/spec.opts",
30
40
  "spec/spec_helper.rb",
31
- "spec/tuple_spec.rb",
41
+ "spec/stub.rb",
42
+ "spec/tuples_spec.rb",
43
+ "spec/utilities_spec.rb",
32
44
  "spec/watirgrid_spec.rb",
33
45
  "watirgrid.gemspec"
34
46
  ]
35
47
  s.homepage = %q{http://github.com/90kts/watirgrid}
36
48
  s.rdoc_options = ["--charset=UTF-8"]
37
49
  s.require_paths = ["lib"]
38
- s.rubygems_version = %q{1.3.5}
50
+ s.rubygems_version = %q{1.3.7}
39
51
  s.summary = %q{WatirGrid: Web Application Testing in Ruby across a grid network.}
40
52
  s.test_files = [
41
- "spec/spec_helper.rb",
42
- "spec/tuple_spec.rb",
43
- "spec/watirgrid_spec.rb"
53
+ "spec/grid_spec.rb",
54
+ "spec/spec_helper.rb",
55
+ "spec/stub.rb",
56
+ "spec/tuples_spec.rb",
57
+ "spec/utilities_spec.rb",
58
+ "spec/watir_spec.rb",
59
+ "spec/watirgrid_spec.rb",
60
+ "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"
44
66
  ]
45
-
46
- s.add_dependency('uuid', '>= 2.2.0')
47
-
48
67
 
49
68
  if s.respond_to? :specification_version then
50
69
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
51
70
  s.specification_version = 3
52
71
 
53
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
72
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
73
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
55
74
  else
56
75
  s.add_dependency(%q<rspec>, [">= 1.2.9"])