grid 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -23,7 +23,7 @@ GEM
23
23
  rspec-expectations (2.3.0)
24
24
  diff-lcs (~> 1.1.2)
25
25
  rspec-mocks (2.3.0)
26
- watirgrid (1.0.4)
26
+ watirgrid (1.0.6)
27
27
 
28
28
  PLATFORMS
29
29
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.3
data/bin/grid CHANGED
@@ -39,6 +39,10 @@ OptionParser.new do |opts|
39
39
  "Optional URI of the Gridinit API, default http://gridin.it/api/v0") do |u|
40
40
  options[:uri] = u || nil
41
41
  end
42
+ opts.on("-a", "--api API", String,
43
+ "Specify the Watir API to use, default webdriver [watir, firewatir, webdriver_performance]}") do |a|
44
+ options[:api] = b || 'webdriver'
45
+ end
42
46
 
43
47
  opts.on_tail("-h", "--help", "Show this message") do
44
48
  puts opts
@@ -52,6 +56,7 @@ helper = Grid::Helper.new(
52
56
  :email => options[:email],
53
57
  :password => options[:password],
54
58
  :uri => options[:uri],
59
+ :api => options[:api],
55
60
  :args => ARGV
56
61
  )
57
62
  helper.send(ARGV[0])
@@ -0,0 +1,11 @@
1
+ @NFR001
2
+ Feature: User logons
3
+ In order to use the web applicaion users must be
4
+ able to logon and access the portal in 3 seconds
5
+
6
+ Scenario: Logon with 50 users in 3 minutes
7
+ Given 200 users open "chrome"
8
+ And navigate to the portal
9
+ When they enter their credentials
10
+ Then they should see their account settings
11
+ And the response time should be less than 3 seconds
@@ -0,0 +1,25 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib'))
3
+ require 'grid'
4
+ require 'rspec/expectations';
5
+
6
+ Given /^(\d+) users open "([^"]*)"$/ do |arg1, arg2|
7
+ pending # express the regexp above with the code you wish you had
8
+ end
9
+
10
+ Given /^navigate to the portal$/ do
11
+ pending # express the regexp above with the code you wish you had
12
+ end
13
+
14
+ When /^they enter their credentials$/ do
15
+ pending # express the regexp above with the code you wish you had
16
+ end
17
+
18
+ Then /^they should see their account settings$/ do
19
+ pending # express the regexp above with the code you wish you had
20
+ end
21
+
22
+ Then /^the response time should be less than (\d+) seconds$/ do |arg1|
23
+ pending # express the regexp above with the code you wish you had
24
+ end
25
+
data/grid.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{grid}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.3"
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-04-17}
12
+ s.date = %q{2011-04-20}
13
13
  s.default_executable = %q{grid}
14
14
  s.description = %q{Gridinit command line utilities to help you use the Gridinit API}
15
15
  s.email = %q{tim.koops@gmail.com}
@@ -28,6 +28,9 @@ Gem::Specification.new do |s|
28
28
  "Rakefile",
29
29
  "VERSION",
30
30
  "bin/grid",
31
+ "examples/cucumber/example.feature",
32
+ "examples/cucumber/step_definitions/.DS_Store",
33
+ "examples/cucumber/step_definitions/example_steps.rb",
31
34
  "grid.gemspec",
32
35
  "lib/grid.rb",
33
36
  "spec/grid_spec.rb",
@@ -39,6 +42,7 @@ Gem::Specification.new do |s|
39
42
  s.rubygems_version = %q{1.4.2}
40
43
  s.summary = %q{Gridinit command line utilities}
41
44
  s.test_files = [
45
+ "examples/cucumber/step_definitions/example_steps.rb",
42
46
  "spec/grid_spec.rb",
43
47
  "spec/spec_helper.rb"
44
48
  ]
data/lib/grid.rb CHANGED
@@ -20,6 +20,9 @@ class Grid
20
20
  log.level = params[:loglevel] || Logger::DEBUG
21
21
  grid = Watir::Grid.new(params)
22
22
  grid.start(:take_all => true)
23
+ if grid.first[:browser_type] =~ /webdriver/
24
+ webdriver_browser_type = ask('What browser type?') { |q| q.default = "firefox" } unless params[:browser]
25
+ end
23
26
  log.debug("Grid size : #{grid.size}")
24
27
  log.debug("Grid rampup : #{rampup(grid.size, params)} secs")
25
28
  threads = []
@@ -32,7 +35,11 @@ class Grid
32
35
  log.debug("Browser #{index+1}##{Thread.current.object_id} architecture : #{browser[:architecture]}")
33
36
  log.debug("Browser #{index+1}##{Thread.current.object_id} type : #{browser[:browser_type]}")
34
37
  log.debug("Browser #{index+1}##{Thread.current.object_id} hostname : #{browser[:hostname]}")
35
- @browser = browser[:object].new_browser
38
+ if browser[:browser_type] =~ /webdriver/
39
+ @browser = browser[:object].new_browser(webdriver_browser_type.to_sym)
40
+ else
41
+ @browser = browser[:object].new_browser
42
+ end
36
43
  yield @browser, "#{index+1}##{Thread.current.object_id}"
37
44
  log.debug("Browser #{index+1}##{Thread.current.object_id} stop : #{::Time.now}")
38
45
  log.debug("Browser #{index+1}##{Thread.current.object_id} elapsed : #{(::Time.now - start).to_i} secs")
@@ -63,6 +70,7 @@ class Grid
63
70
  class Helper
64
71
  def initialize(params = {})
65
72
  @grid_id = params[:grid_id]
73
+ @api = params[:api]
66
74
  @uri = params[:uri] || "http://gridin.it/api/v0"
67
75
  logfile = STDOUT
68
76
  @log = Logger.new(logfile, 'daily')
@@ -159,7 +167,7 @@ class Grid
159
167
  description = ask("Grid description: ") { |q| q.default = "Grid created #{Time.now}" }
160
168
  nodes = ask("Number of nodes: ") { |q| q.default = 5 }
161
169
  location = ask("Location of nodes: ") { |q| q.default = "us-east" }
162
- browser_type = ask("Node type: ") { |q| q.default = "webdriver" }
170
+ browser_type = ask("Node type: ") { |q| q.default = "webdriver" } unless @api
163
171
  @grid_id = create_grid(name, description)
164
172
  create_intranode(@grid_id, browser_type, location, nodes)
165
173
  show
@@ -169,7 +177,7 @@ class Grid
169
177
  @grid_id = ask("Grid ID: ") unless @grid_id
170
178
  nodes = ask("Number of nodes: ") { |q| q.default = 5 }
171
179
  location = ask("Location of nodes: ") { |q| q.default = "us-east" }
172
- browser_type = ask("Node type: ") { |q| q.default = "webdriver" }
180
+ browser_type = ask("Node type: ") { |q| q.default = "webdriver" } unless @api
173
181
  create_intranode(@grid_id, browser_type, location, nodes)
174
182
  show
175
183
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Koopmans
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-17 00:00:00 +10:00
18
+ date: 2011-04-20 00:00:00 +10:00
19
19
  default_executable: grid
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -253,6 +253,9 @@ files:
253
253
  - Rakefile
254
254
  - VERSION
255
255
  - bin/grid
256
+ - examples/cucumber/example.feature
257
+ - examples/cucumber/step_definitions/.DS_Store
258
+ - examples/cucumber/step_definitions/example_steps.rb
256
259
  - grid.gemspec
257
260
  - lib/grid.rb
258
261
  - spec/grid_spec.rb
@@ -292,5 +295,6 @@ signing_key:
292
295
  specification_version: 3
293
296
  summary: Gridinit command line utilities
294
297
  test_files:
298
+ - examples/cucumber/step_definitions/example_steps.rb
295
299
  - spec/grid_spec.rb
296
300
  - spec/spec_helper.rb