watirgrid 1.1.2 → 1.1.3.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/bin/provider +1 -1
- data/examples/cucumber/example.feature +1 -2
- data/examples/cucumber/step_definitions/example_steps.rb +2 -30
- data/examples/cucumber/support/env.rb +72 -0
- data/examples/parallel/cucumber/example.feature +13 -0
- data/examples/parallel/cucumber/step_definitions/example_steps.rb +17 -0
- data/examples/parallel/cucumber/support/env.rb +28 -0
- data/lib/provider.rb +3 -0
- data/watirgrid.gemspec +2 -2
- metadata +19 -9
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.1.
|
12
|
+
gem.version = "1.1.3.pre"
|
13
13
|
end
|
14
14
|
rescue LoadError
|
15
15
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
data/bin/provider
CHANGED
@@ -10,7 +10,7 @@ optparse = OptionParser.new do |opts|
|
|
10
10
|
opts.separator ""
|
11
11
|
opts.separator "Specific options:"
|
12
12
|
opts.on("-b", "--browser-type TYPE",
|
13
|
-
"Specify browser type to register {
|
13
|
+
"Specify driver for browser type to register {watir|firewatir|safariwatir|webdriver|zombie}") do |b|
|
14
14
|
options[:browser_type] = b
|
15
15
|
end
|
16
16
|
opts.on("-c", "--controller-uri [URI]",
|
@@ -4,8 +4,7 @@ Feature: User logons
|
|
4
4
|
able to logon and access the portal in 3 seconds
|
5
5
|
|
6
6
|
Scenario: Logon with 50 users in 1 minute
|
7
|
-
Given
|
8
|
-
And navigate to the portal
|
7
|
+
Given users navigate to the portal
|
9
8
|
When they enter their credentials
|
10
9
|
Then they should see their account settings
|
11
10
|
And the response time should be less than 3 seconds
|
@@ -1,32 +1,4 @@
|
|
1
|
-
|
2
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
|
3
|
-
require 'watirgrid'
|
4
|
-
require 'rspec/expectations';
|
5
|
-
require 'watir-webdriver-performance'
|
6
|
-
|
7
|
-
controller = Controller.new(
|
8
|
-
:ring_server_port => 12357,
|
9
|
-
:loglevel => Logger::ERROR)
|
10
|
-
controller.start
|
11
|
-
|
12
|
-
provider = Provider.new(
|
13
|
-
:ring_server_port => 12357,
|
14
|
-
:loglevel => Logger::ERROR, :browser_type => 'webdriver')
|
15
|
-
provider.start
|
16
|
-
|
17
|
-
Given /^(\d+) users open "([^"]*)"$/ do |quantity, browser|
|
18
|
-
params={}
|
19
|
-
params[:ring_server_port] = 12357
|
20
|
-
# optionall connect via a controller_uri environment variable
|
21
|
-
# params[:controller_uri] = ENV["controller_uri"]
|
22
|
-
params[:browser] = browser # type of webdriver browser to spawn
|
23
|
-
params[:quantity] = quantity.to_i # max number of browsers to use
|
24
|
-
params[:rampup] = 10 # seconds
|
25
|
-
@grid = Watir::Grid.new(params)
|
26
|
-
@grid.start(:initiate => true)
|
27
|
-
end
|
28
|
-
|
29
|
-
Given /^navigate to the portal$/ do
|
1
|
+
Given /^users navigate to the portal$/ do
|
30
2
|
@grid.iterate {|browser| browser.goto "http://gridinit.com/examples/logon.html" }
|
31
3
|
end
|
32
4
|
|
@@ -44,7 +16,7 @@ Then /^they should see their account settings$/ do
|
|
44
16
|
end
|
45
17
|
end
|
46
18
|
|
47
|
-
Then /^the response time should be less than (d+) seconds$/ do |response_time|
|
19
|
+
Then /^the response time should be less than (\d+) seconds$/ do |response_time|
|
48
20
|
@grid.iterate do |browser|
|
49
21
|
browser.performance.summary[:response_time].should < response_time.to_i * 1000
|
50
22
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
|
3
|
+
require 'watirgrid'
|
4
|
+
require 'rspec/expectations';
|
5
|
+
require 'watir-webdriver-performance'
|
6
|
+
|
7
|
+
# Setup a grid network, normally this is done outside of env.rb
|
8
|
+
controller = Controller.new(
|
9
|
+
:ring_server_port => 12357,
|
10
|
+
:loglevel => Logger::ERROR)
|
11
|
+
controller.start
|
12
|
+
|
13
|
+
1.times do
|
14
|
+
provider = Provider.new(
|
15
|
+
:ring_server_port => 12357,
|
16
|
+
:loglevel => Logger::ERROR, :browser_type => 'webdriver')
|
17
|
+
provider.start
|
18
|
+
end
|
19
|
+
|
20
|
+
ENV["GRID"] = 'true'
|
21
|
+
|
22
|
+
if ENV["GRID"] then
|
23
|
+
params = {}
|
24
|
+
# discover controller via ring server broadcast on UDP port
|
25
|
+
params[:ring_server_port] = 12357
|
26
|
+
|
27
|
+
# OR
|
28
|
+
# optionally connect via a controller_uri environment variable
|
29
|
+
# params[:controller_uri] = ENV["controller_uri"]
|
30
|
+
|
31
|
+
# Now for the other params
|
32
|
+
params[:browser] = 'chrome' # type of webdriver browser to spawn
|
33
|
+
params[:quantity] = 20 # max number of browsers to use
|
34
|
+
params[:rampup] = 10 # seconds
|
35
|
+
grid ||= Watir::Grid.new(params)
|
36
|
+
grid.start(:initiate => true)
|
37
|
+
else
|
38
|
+
grid = []
|
39
|
+
##
|
40
|
+
# Creating a dummy class when we're not using WatirGrid
|
41
|
+
# so that the design steps can still call an iterate method.
|
42
|
+
class Grid
|
43
|
+
def initialize
|
44
|
+
@browser ||= Watir::Browser.new :chrome
|
45
|
+
end
|
46
|
+
def iterate
|
47
|
+
yield @browser
|
48
|
+
end
|
49
|
+
end
|
50
|
+
grid = Grid.new
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# This would be cool if I could modify the instance variable
|
55
|
+
# @browser within the proc block created... Then I could get
|
56
|
+
# rid of the @grid.iterate method from the design steps ...
|
57
|
+
#Around do |scenario, block|
|
58
|
+
#grid.iterate do |browser|
|
59
|
+
#@browser = browser # this doesn't work =(
|
60
|
+
#block.call
|
61
|
+
#end
|
62
|
+
#end
|
63
|
+
|
64
|
+
Before do
|
65
|
+
@grid = grid
|
66
|
+
end
|
67
|
+
|
68
|
+
at_exit do
|
69
|
+
grid.iterate do |browser|
|
70
|
+
browser.close
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
@NFR-001
|
2
|
+
Feature: User logons
|
3
|
+
In order to use the web application users must be
|
4
|
+
able to logon and access the portal in 3 seconds
|
5
|
+
|
6
|
+
Scenario: Logon with 50 users in 1 minute
|
7
|
+
Given users navigate to the portal
|
8
|
+
When they enter their credentials
|
9
|
+
Then they should see their account settings
|
10
|
+
|
11
|
+
Scenario: Bypass logon
|
12
|
+
Given users navigate to the portal
|
13
|
+
When they enter a direct url
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Given /^users navigate to the portal$/ do
|
2
|
+
@browser.goto "http://localhost:4567/examples/logon.html"
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^they enter their credentials$/ do
|
6
|
+
@browser.text_field(:name => "email").set "tim@mahenterprize.com"
|
7
|
+
@browser.text_field(:name => "password").set "mahsecretz"
|
8
|
+
@browser.button(:type => "submit").click
|
9
|
+
end
|
10
|
+
|
11
|
+
Then /^they should see their account settings$/ do
|
12
|
+
@browser.text.should =~ /Maybe I should get a real Gridinit account/
|
13
|
+
end
|
14
|
+
|
15
|
+
When /^they enter a direct url$/ do
|
16
|
+
@browser.goto "http://localhost:4567/"
|
17
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'lib'))
|
3
|
+
require 'watirgrid'
|
4
|
+
require 'rspec/expectations';
|
5
|
+
|
6
|
+
ENV["GRID"] = 'true'
|
7
|
+
ENV["controller_uri"] = "druby://10.0.1.3:11235"
|
8
|
+
|
9
|
+
if ENV["GRID"] then
|
10
|
+
params = {}
|
11
|
+
params[:controller_uri] = ENV["controller_uri"]
|
12
|
+
params[:browser] = 'chrome' # type of webdriver browser to spawn
|
13
|
+
grid ||= Watir::Grid.new(params)
|
14
|
+
grid.start(:initiate => true, :quantity => 1, :take_all => true)
|
15
|
+
else
|
16
|
+
@browser ||= Watir::Browser.new :chrome
|
17
|
+
end
|
18
|
+
|
19
|
+
Before do |scenario|
|
20
|
+
@browser = grid.providers.first
|
21
|
+
end
|
22
|
+
|
23
|
+
at_exit do
|
24
|
+
grid.iterate do |browser|
|
25
|
+
browser.close
|
26
|
+
end
|
27
|
+
grid.release_tuples
|
28
|
+
end
|
data/lib/provider.rb
CHANGED
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 = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
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{2011-05-
|
12
|
+
s.date = %q{2011-05-06}
|
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 = ["listener", "controller", "provider"]
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watirgrid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 961915984
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
9
|
+
- 3
|
10
|
+
- pre
|
11
|
+
version: 1.1.3.pre
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Tim Koopmans
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2011-05-
|
19
|
+
date: 2011-05-16 00:00:00 +10:00
|
19
20
|
default_executable:
|
20
21
|
dependencies: []
|
21
22
|
|
@@ -44,6 +45,10 @@ files:
|
|
44
45
|
- examples/basic/example_webdriver_remote.rb
|
45
46
|
- examples/cucumber/example.feature
|
46
47
|
- examples/cucumber/step_definitions/example_steps.rb
|
48
|
+
- examples/cucumber/support/env.rb
|
49
|
+
- examples/parallel/cucumber/example.feature
|
50
|
+
- examples/parallel/cucumber/step_definitions/example_steps.rb
|
51
|
+
- examples/parallel/cucumber/support/env.rb
|
47
52
|
- lib/controller.rb
|
48
53
|
- lib/listener.rb
|
49
54
|
- lib/provider.rb
|
@@ -79,12 +84,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
85
|
none: false
|
81
86
|
requirements:
|
82
|
-
- - "
|
87
|
+
- - ">"
|
83
88
|
- !ruby/object:Gem::Version
|
84
|
-
hash:
|
89
|
+
hash: 25
|
85
90
|
segments:
|
86
|
-
-
|
87
|
-
|
91
|
+
- 1
|
92
|
+
- 3
|
93
|
+
- 1
|
94
|
+
version: 1.3.1
|
88
95
|
requirements: []
|
89
96
|
|
90
97
|
rubyforge_project:
|
@@ -97,6 +104,9 @@ test_files:
|
|
97
104
|
- examples/basic/example_webdriver.rb
|
98
105
|
- examples/basic/example_webdriver_remote.rb
|
99
106
|
- examples/cucumber/step_definitions/example_steps.rb
|
107
|
+
- examples/cucumber/support/env.rb
|
108
|
+
- examples/parallel/cucumber/step_definitions/example_steps.rb
|
109
|
+
- examples/parallel/cucumber/support/env.rb
|
100
110
|
- spec/control_spec.rb
|
101
111
|
- spec/grid_spec.rb
|
102
112
|
- spec/memory_spec.rb
|