watir-webdriver-performance 0.1.3.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1,2 +1,2 @@
1
1
  rvm_install_on_use_flag=1
2
- rvm --create use ruby-1.9.2-p180@watir-webdriver-performance
2
+ rvm --create use ruby-1.9.3-p194@watir-webdriver-performance
data/Gemfile CHANGED
@@ -2,10 +2,9 @@ source "http://rubygems.org"
2
2
  gem "watir-webdriver"
3
3
 
4
4
  group :development do
5
- gem "rspec", "~> 2.3.0"
6
- gem "bundler", "~> 1.0.0"
7
- gem "jeweler", "~> 1.5.2"
8
- gem "rcov", ">= 0"
9
- gem "zomg", ">= 0"
10
- gem "rdoc", ">= 0"
5
+ gem "rspec"
6
+ gem "bundler"
7
+ gem "jeweler"
8
+ gem "zomg"
9
+ gem "rdoc"
11
10
  end
@@ -1,41 +1,46 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- childprocess (0.1.9)
5
- ffi (~> 1.0.6)
6
- diff-lcs (1.1.2)
7
- ffi (1.0.9)
4
+ addressable (2.3.1)
5
+ childprocess (0.3.4)
6
+ ffi (~> 1.0, >= 1.0.6)
7
+ diff-lcs (1.1.3)
8
+ ffi (1.1.0)
8
9
  git (1.2.5)
9
- jeweler (1.5.2)
10
- bundler (~> 1.0.0)
10
+ jeweler (1.8.4)
11
+ bundler (~> 1.0)
11
12
  git (>= 1.2.5)
12
13
  rake
13
- json_pure (1.5.3)
14
- rake (0.9.2)
15
- rcov (0.9.9)
16
- rdoc (3.8)
17
- rspec (2.3.0)
18
- rspec-core (~> 2.3.0)
19
- rspec-expectations (~> 2.3.0)
20
- rspec-mocks (~> 2.3.0)
21
- rspec-core (2.3.1)
22
- rspec-expectations (2.3.0)
23
- diff-lcs (~> 1.1.2)
24
- rspec-mocks (2.3.0)
25
- ruby2ruby (1.2.5)
14
+ rdoc
15
+ json (1.7.3)
16
+ libwebsocket (0.1.4)
17
+ addressable
18
+ multi_json (1.3.6)
19
+ rake (0.9.2.2)
20
+ rdoc (3.12)
21
+ json (~> 1.4)
22
+ rspec (2.11.0)
23
+ rspec-core (~> 2.11.0)
24
+ rspec-expectations (~> 2.11.0)
25
+ rspec-mocks (~> 2.11.0)
26
+ rspec-core (2.11.1)
27
+ rspec-expectations (2.11.1)
28
+ diff-lcs (~> 1.1.3)
29
+ rspec-mocks (2.11.1)
30
+ ruby2ruby (1.3.1)
26
31
  ruby_parser (~> 2.0)
27
32
  sexp_processor (~> 3.0)
28
- ruby_parser (2.0.6)
33
+ ruby_parser (2.3.1)
29
34
  sexp_processor (~> 3.0)
30
- rubyzip (0.9.4)
31
- selenium-webdriver (2.1.0)
32
- childprocess (>= 0.1.9)
33
- ffi (>= 1.0.7)
34
- json_pure
35
+ rubyzip (0.9.9)
36
+ selenium-webdriver (2.25.0)
37
+ childprocess (>= 0.2.5)
38
+ libwebsocket (~> 0.1.3)
39
+ multi_json (~> 1.0)
35
40
  rubyzip
36
- sexp_processor (3.0.5)
37
- watir-webdriver (0.2.6)
38
- selenium-webdriver (>= 0.2.2)
41
+ sexp_processor (3.2.0)
42
+ watir-webdriver (0.6.1)
43
+ selenium-webdriver (>= 2.18.0)
39
44
  zomg (1.0.2)
40
45
  ruby2ruby
41
46
 
@@ -43,10 +48,9 @@ PLATFORMS
43
48
  ruby
44
49
 
45
50
  DEPENDENCIES
46
- bundler (~> 1.0.0)
47
- jeweler (~> 1.5.2)
48
- rcov
51
+ bundler
52
+ jeweler
49
53
  rdoc
50
- rspec (~> 2.3.0)
54
+ rspec
51
55
  watir-webdriver
52
56
  zomg
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3.1
1
+ 0.2.0
@@ -17,6 +17,7 @@ module Watir
17
17
  next
18
18
  end
19
19
  hash[key.to_sym] = {}
20
+ next unless @data[key].respond_to? :each
20
21
  @data[key].each do |k,v|
21
22
  if k == '__fxdriver_unwrapped'
22
23
  next
@@ -85,7 +86,12 @@ module Watir
85
86
 
86
87
  class Browser
87
88
  def performance
88
- data = driver.execute_script("return window.performance || window.webkitPerformance || window.mozPerformance || window.msPerformance;")
89
+ data = case driver.browser
90
+ when :internet_explorer
91
+ JSON.parse(driver.execute_script("return JSON.stringify(window.performance.toJSON());"))
92
+ else
93
+ driver.execute_script("return window.performance || window.webkitPerformance || window.mozPerformance || window.msPerformance;")
94
+ end
89
95
  raise 'Could not collect performance metrics from your current browser. Please ensure the browser you are using supports collecting performance metrics.' if data.nil?
90
96
  PerformanceHelper.new(data).munge
91
97
  end
@@ -5,24 +5,24 @@ describe "WatirWebdriverPerformance-NonSupportedBrowser" do
5
5
  let!(:b) { @b }
6
6
 
7
7
  before(:all) do
8
- @b ||= Watir::Browser.new :firefox
8
+ @b ||= Watir::Browser.new :safari
9
9
  end
10
10
 
11
11
  after(:all) do
12
12
  @b.close
13
13
  end
14
14
 
15
- it "should raise an error when a non supported browser is encountered" do
15
+ pending "should raise an error when a non supported browser is encountered" do
16
16
  b.goto "google.com"
17
17
  lambda { b.performance }.should raise_error RuntimeError, 'Could not collect performance metrics from your current browser. Please ensure the browser you are using supports collecting performance metrics.'
18
18
  end
19
19
 
20
- it "should return false for firefox supported" do
20
+ pending "should return false for supported" do
21
21
  b.goto "google.com"
22
22
  b.should_not be_performance_supported
23
23
  end
24
24
 
25
- it "should not support performance as block" do
25
+ pending "should not support performance as block" do
26
26
  b.goto "google.com"
27
27
  b.with_performance {|performance| performance.should be_nil }
28
28
  end
@@ -5,7 +5,7 @@ describe "WatirWebdriverPerformance" do
5
5
  let!(:b) { @b }
6
6
 
7
7
  before(:all) do
8
- @b ||= Watir::Browser.new :chrome
8
+ @b ||= Watir::Browser.new
9
9
  end
10
10
 
11
11
  after(:all) do
@@ -28,21 +28,10 @@ describe "WatirWebdriverPerformance" do
28
28
  b.performance.summary.should include(:dom_processing)
29
29
  end
30
30
 
31
- pending "should get summary data from the performance metrics for redirects" do
32
- b.goto "http://watirgrid.com"
33
- b.performance.summary.should include(:redirect)
34
- end
35
-
36
- it "should get summary data from the performance metrics for secure connections" do
37
- b.goto "https://github.com/90kts/watirgrid"
38
- b.performance.summary.should include(:tcp_connection_secure)
39
- end
40
-
41
31
  it "should get the summary metrics such as Response Time, TTLB and TTFB" do
42
32
  b.performance.summary.should include(:time_to_first_byte) # aka "server time"
43
33
  b.performance.summary.should include(:time_to_last_byte) # aka "network + server time"
44
34
  b.performance.summary.should include(:response_time)
45
- puts "Page took #{b.performance.summary[:response_time]/1000} seconds to load"
46
35
  end
47
36
 
48
37
  it "should return true for chrome supported" do
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{watir-webdriver-performance}
8
- s.version = "0.1.3.1"
7
+ s.name = "watir-webdriver-performance"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Tim Koopmans}]
12
- s.date = %q{2011-10-03}
13
- s.description = %q{This gem collects and summarises metrics speficied in the W3C Navigation web performance specifications at http://w3c-test.org/webperf/specs/NavigationTiming/ when using watir-webdriver and a compatible browser}
14
- s.email = %q{tim.koops@gmail.com}
11
+ s.authors = ["Tim Koopmans"]
12
+ s.date = "2012-07-24"
13
+ s.description = "This gem collects and summarises metrics speficied in the W3C Navigation web performance specifications at http://w3c-test.org/webperf/specs/NavigationTiming/ when using watir-webdriver and a compatible browser"
14
+ s.email = "tim.koops@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -31,33 +31,24 @@ Gem::Specification.new do |s|
31
31
  "lib/performance.rb",
32
32
  "lib/watir-webdriver-performance.rb",
33
33
  "spec/spec_helper.rb",
34
- "spec/watir-webdriver-performance-browser-ff7_spec.rb",
35
34
  "spec/watir-webdriver-performance-non-supported-browser_spec.rb",
36
35
  "spec/watir-webdriver-performance_spec.rb",
37
36
  "watir-webdriver-performance.gemspec"
38
37
  ]
39
- s.homepage = %q{http://github.com/90kts/watir-webdriver-performance}
40
- s.licenses = [%q{MIT}]
41
- s.require_paths = [%q{lib}]
42
- s.rubygems_version = %q{1.8.6}
43
- s.summary = %q{A simple helper gem for watir-webdriver performance metrics}
44
- s.test_files = [
45
- "examples/basic.rb",
46
- "spec/spec_helper.rb",
47
- "spec/watir-webdriver-performance-browser-ff7_spec.rb",
48
- "spec/watir-webdriver-performance-non-supported-browser_spec.rb",
49
- "spec/watir-webdriver-performance_spec.rb"
50
- ]
38
+ s.homepage = "http://github.com/90kts/watir-webdriver-performance"
39
+ s.licenses = ["MIT"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = "1.8.24"
42
+ s.summary = "A simple helper gem for watir-webdriver performance metrics"
51
43
 
52
44
  if s.respond_to? :specification_version then
53
45
  s.specification_version = 3
54
46
 
55
47
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
56
48
  s.add_runtime_dependency(%q<watir-webdriver>, [">= 0"])
57
- s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
58
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
59
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
60
- s.add_development_dependency(%q<rcov>, [">= 0"])
49
+ s.add_development_dependency(%q<rspec>, [">= 0"])
50
+ s.add_development_dependency(%q<bundler>, [">= 0"])
51
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
61
52
  s.add_development_dependency(%q<zomg>, [">= 0"])
62
53
  s.add_development_dependency(%q<rdoc>, [">= 0"])
63
54
  s.add_runtime_dependency(%q<watir-webdriver>, [">= 0"])
@@ -67,10 +58,9 @@ Gem::Specification.new do |s|
67
58
  s.add_development_dependency(%q<active_support>, [">= 0"])
68
59
  else
69
60
  s.add_dependency(%q<watir-webdriver>, [">= 0"])
70
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
71
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
72
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
73
- s.add_dependency(%q<rcov>, [">= 0"])
61
+ s.add_dependency(%q<rspec>, [">= 0"])
62
+ s.add_dependency(%q<bundler>, [">= 0"])
63
+ s.add_dependency(%q<jeweler>, [">= 0"])
74
64
  s.add_dependency(%q<zomg>, [">= 0"])
75
65
  s.add_dependency(%q<rdoc>, [">= 0"])
76
66
  s.add_dependency(%q<watir-webdriver>, [">= 0"])
@@ -81,10 +71,9 @@ Gem::Specification.new do |s|
81
71
  end
82
72
  else
83
73
  s.add_dependency(%q<watir-webdriver>, [">= 0"])
84
- s.add_dependency(%q<rspec>, ["~> 2.3.0"])
85
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
86
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
87
- s.add_dependency(%q<rcov>, [">= 0"])
74
+ s.add_dependency(%q<rspec>, [">= 0"])
75
+ s.add_dependency(%q<bundler>, [">= 0"])
76
+ s.add_dependency(%q<jeweler>, [">= 0"])
88
77
  s.add_dependency(%q<zomg>, [">= 0"])
89
78
  s.add_dependency(%q<rdoc>, [">= 0"])
90
79
  s.add_dependency(%q<watir-webdriver>, [">= 0"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-03 00:00:00.000000000Z
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir-webdriver
16
- requirement: &70144565168140 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,54 +21,63 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70144565168140
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &70144565169580 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
- - - ~>
35
+ - - ! '>='
31
36
  - !ruby/object:Gem::Version
32
- version: 2.3.0
37
+ version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70144565169580
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: bundler
38
- requirement: &70144565171020 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
- - - ~>
51
+ - - ! '>='
42
52
  - !ruby/object:Gem::Version
43
- version: 1.0.0
53
+ version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70144565171020
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: jeweler
49
- requirement: &70144565185700 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
- - - ~>
67
+ - - ! '>='
53
68
  - !ruby/object:Gem::Version
54
- version: 1.5.2
69
+ version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70144565185700
58
- - !ruby/object:Gem::Dependency
59
- name: rcov
60
- requirement: &70144565189620 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
61
73
  none: false
62
74
  requirements:
63
75
  - - ! '>='
64
76
  - !ruby/object:Gem::Version
65
77
  version: '0'
66
- type: :development
67
- prerelease: false
68
- version_requirements: *70144565189620
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: zomg
71
- requirement: &70144565191060 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
72
81
  none: false
73
82
  requirements:
74
83
  - - ! '>='
@@ -76,10 +85,15 @@ dependencies:
76
85
  version: '0'
77
86
  type: :development
78
87
  prerelease: false
79
- version_requirements: *70144565191060
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
80
94
  - !ruby/object:Gem::Dependency
81
95
  name: rdoc
82
- requirement: &70144565289240 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
83
97
  none: false
84
98
  requirements:
85
99
  - - ! '>='
@@ -87,10 +101,15 @@ dependencies:
87
101
  version: '0'
88
102
  type: :development
89
103
  prerelease: false
90
- version_requirements: *70144565289240
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
91
110
  - !ruby/object:Gem::Dependency
92
111
  name: watir-webdriver
93
- requirement: &70144565397520 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
94
113
  none: false
95
114
  requirements:
96
115
  - - ! '>='
@@ -98,10 +117,15 @@ dependencies:
98
117
  version: '0'
99
118
  type: :runtime
100
119
  prerelease: false
101
- version_requirements: *70144565397520
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
102
126
  - !ruby/object:Gem::Dependency
103
127
  name: rspec
104
- requirement: &70144565437960 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
105
129
  none: false
106
130
  requirements:
107
131
  - - ! '>='
@@ -109,10 +133,15 @@ dependencies:
109
133
  version: '0'
110
134
  type: :development
111
135
  prerelease: false
112
- version_requirements: *70144565437960
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
113
142
  - !ruby/object:Gem::Dependency
114
143
  name: zomg
115
- requirement: &70144565514120 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
116
145
  none: false
117
146
  requirements:
118
147
  - - ! '>='
@@ -120,10 +149,15 @@ dependencies:
120
149
  version: '0'
121
150
  type: :development
122
151
  prerelease: false
123
- version_requirements: *70144565514120
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
124
158
  - !ruby/object:Gem::Dependency
125
159
  name: nokogiri
126
- requirement: &70144565572260 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
127
161
  none: false
128
162
  requirements:
129
163
  - - ! '>='
@@ -131,10 +165,15 @@ dependencies:
131
165
  version: '0'
132
166
  type: :development
133
167
  prerelease: false
134
- version_requirements: *70144565572260
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
135
174
  - !ruby/object:Gem::Dependency
136
175
  name: active_support
137
- requirement: &70144565638320 !ruby/object:Gem::Requirement
176
+ requirement: !ruby/object:Gem::Requirement
138
177
  none: false
139
178
  requirements:
140
179
  - - ! '>='
@@ -142,7 +181,12 @@ dependencies:
142
181
  version: '0'
143
182
  type: :development
144
183
  prerelease: false
145
- version_requirements: *70144565638320
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
146
190
  description: This gem collects and summarises metrics speficied in the W3C Navigation
147
191
  web performance specifications at http://w3c-test.org/webperf/specs/NavigationTiming/
148
192
  when using watir-webdriver and a compatible browser
@@ -167,7 +211,6 @@ files:
167
211
  - lib/performance.rb
168
212
  - lib/watir-webdriver-performance.rb
169
213
  - spec/spec_helper.rb
170
- - spec/watir-webdriver-performance-browser-ff7_spec.rb
171
214
  - spec/watir-webdriver-performance-non-supported-browser_spec.rb
172
215
  - spec/watir-webdriver-performance_spec.rb
173
216
  - watir-webdriver-performance.gemspec
@@ -186,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
229
  version: '0'
187
230
  segments:
188
231
  - 0
189
- hash: -2409606481077121061
232
+ hash: 575132701200813434
190
233
  required_rubygems_version: !ruby/object:Gem::Requirement
191
234
  none: false
192
235
  requirements:
@@ -195,13 +238,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
238
  version: '0'
196
239
  requirements: []
197
240
  rubyforge_project:
198
- rubygems_version: 1.8.6
241
+ rubygems_version: 1.8.24
199
242
  signing_key:
200
243
  specification_version: 3
201
244
  summary: A simple helper gem for watir-webdriver performance metrics
202
- test_files:
203
- - examples/basic.rb
204
- - spec/spec_helper.rb
205
- - spec/watir-webdriver-performance-browser-ff7_spec.rb
206
- - spec/watir-webdriver-performance-non-supported-browser_spec.rb
207
- - spec/watir-webdriver-performance_spec.rb
245
+ test_files: []
@@ -1,20 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "WatirWebdriverPerformance" do
4
-
5
- let!(:b) { @b }
6
-
7
- before(:all) do
8
- @b ||= Watir::Browser.new :chrome
9
- end
10
-
11
- after(:all) do
12
- @b.close
13
- end
14
-
15
- pending "should open and get performance metrics from the FF7 browser" do
16
- b.goto "google.com"
17
- b.performance.should be_an_instance_of(OpenStruct)
18
- end
19
-
20
- end