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.
data/spec/watir_spec.rb DELETED
@@ -1,59 +0,0 @@
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 +0,0 @@
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
-