watir-webdriver-performance 0.1.2 → 0.1.3

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@watir-webdriver
2
+ rvm --create use ruby-1.9.2@watir-webdriver-performance
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -80,6 +80,15 @@ module Watir
80
80
  raise 'Could not collect performance metrics from your current browser. Please ensure the browser you are using supports collecting performance metrics.' if data.nil?
81
81
  PerformanceHelper.new(data).munge
82
82
  end
83
+
84
+ def performance_supported?
85
+ driver.execute_script("return window.performance || window.webkitPerformance || window.mozPerformance || window.msPerformance;")
86
+ end
87
+ alias performance_data performance_supported?
88
+
89
+ def with_performance
90
+ yield PerformanceHelper.new(performance_data).munge if performance_supported?
91
+ end
83
92
  end
84
93
  end
85
94
 
@@ -17,4 +17,13 @@ describe "WatirWebdriverPerformance-NonSupportedBrowser" do
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
21
+ b.goto "google.com"
22
+ b.should_not be_performance_supported
23
+ end
24
+
25
+ it "should not support performance as block" do
26
+ b.goto "google.com"
27
+ b.with_performance {|performance| performance.should be_nil }
28
+ end
20
29
  end
@@ -44,4 +44,13 @@ describe "WatirWebdriverPerformance" do
44
44
  puts "Page took #{b.performance.summary[:response_time]/1000} seconds to load"
45
45
  end
46
46
 
47
+ it "should return true for chrome supported" do
48
+ b.goto "google.com"
49
+ b.should be_performance_supported
50
+ end
51
+
52
+ it "should support performance as block" do
53
+ b.goto "google.com"
54
+ b.with_performance {|performance| performance.should_not be_nil }
55
+ end
47
56
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{watir-webdriver-performance}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.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-07-21}
12
+ s.date = %q{2011-08-10}
13
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
14
  s.email = %q{tim.koops@gmail.com}
15
15
  s.extra_rdoc_files = [
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.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-21 00:00:00.000000000 +10:00
12
+ date: 2011-08-10 00:00:00.000000000 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: watir-webdriver
17
- requirement: &2158963060 !ruby/object:Gem::Requirement
17
+ requirement: &2161638400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2158963060
25
+ version_requirements: *2161638400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
- requirement: &2158962580 !ruby/object:Gem::Requirement
28
+ requirement: &2161637920 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.3.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2158962580
36
+ version_requirements: *2161637920
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2158962100 !ruby/object:Gem::Requirement
39
+ requirement: &2161637440 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2158962100
47
+ version_requirements: *2161637440
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2158978760 !ruby/object:Gem::Requirement
50
+ requirement: &2161636960 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.5.2
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2158978760
58
+ version_requirements: *2161636960
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2158978280 !ruby/object:Gem::Requirement
61
+ requirement: &2161636480 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2158978280
69
+ version_requirements: *2161636480
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: zomg
72
- requirement: &2158977800 !ruby/object:Gem::Requirement
72
+ requirement: &2161636000 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2158977800
80
+ version_requirements: *2161636000
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rdoc
83
- requirement: &2158977320 !ruby/object:Gem::Requirement
83
+ requirement: &2161635520 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *2158977320
91
+ version_requirements: *2161635520
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: watir-webdriver
94
- requirement: &2158976840 !ruby/object:Gem::Requirement
94
+ requirement: &2161635040 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *2158976840
102
+ version_requirements: *2161635040
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rspec
105
- requirement: &2158976360 !ruby/object:Gem::Requirement
105
+ requirement: &2161634560 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *2158976360
113
+ version_requirements: *2161634560
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: zomg
116
- requirement: &2158975880 !ruby/object:Gem::Requirement
116
+ requirement: &2161634080 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *2158975880
124
+ version_requirements: *2161634080
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: nokogiri
127
- requirement: &2158975400 !ruby/object:Gem::Requirement
127
+ requirement: &2161633600 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ! '>='
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: '0'
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *2158975400
135
+ version_requirements: *2161633600
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: active_support
138
- requirement: &2158974920 !ruby/object:Gem::Requirement
138
+ requirement: &2161633120 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ! '>='
@@ -143,7 +143,7 @@ dependencies:
143
143
  version: '0'
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *2158974920
146
+ version_requirements: *2161633120
147
147
  description: This gem collects and summarises metrics speficied in the W3C Navigation
148
148
  web performance specifications at http://w3c-test.org/webperf/specs/NavigationTiming/
149
149
  when using watir-webdriver and a compatible browser
@@ -187,7 +187,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: 3568797541647563189
190
+ hash: 8569957073962984
191
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  none: false
193
193
  requirements: