watir-performance 0.6.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f070278c72758c5fcae945a5f267a260020e7f3646f809975e290548e700fefe
4
- data.tar.gz: 201e944205306f418e67f17665da261345341c2a8606cfde4d21df33d2d885db
3
+ metadata.gz: d79fe87cb885260f14a74e7c20a679950265b8a59fc9894685700b7e5fc56b8c
4
+ data.tar.gz: 0ca5705bdc1c2574383ea0d8acf2fd3e21186621239f143358d84298cf06223c
5
5
  SHA512:
6
- metadata.gz: 182df6e6267fe6770e28f8ea23fdb2c87914eb3c858d2389e9cb75e829209995b8ae128accc0ef32093d016839b64b7e837949366b920ef5c46c5bdd94df4b16
7
- data.tar.gz: d3c67b2546a2cb28fefaf257f3402271de9ee544556a8c72ce8373382d43c32a91d302d0581b01d88a7ddc1076d604d80986f5eea1564f4064943951e7f2195c
6
+ metadata.gz: dd2dbac50520e5ab04238e09c5bce14ce0f63d075680876393fd820467b16daa830a5c09e0d28589178038a4e425997e96859c39eca86d6ada5590d9a3f2a2dc
7
+ data.tar.gz: be710c24571d1aacb6ac6157513b541baae5ecb8f32c60217446c7cc54fdf651e131572ba9f69021876b9ccc116770c022b2182f1ecff4f8c1db5e20fa455c8d
data/.travis.yml CHANGED
@@ -6,7 +6,7 @@ matrix:
6
6
  # Testing all Available Ruby version from 2.3.7 - 2.6.0-preview1
7
7
  - os: linux
8
8
  rvm:
9
- - 2.6.0-preview1
9
+ - 2.6.0-preview2
10
10
  env:
11
11
  - MOZ_HEADLESS=1
12
12
  addons:
@@ -15,7 +15,7 @@ matrix:
15
15
  before_install:
16
16
  - bash ./spec/support/setup-chromedriver.sh
17
17
  - bash ./spec/support/setup-geckodriver.sh
18
- - gem install bundler -v 1.16.1
18
+ - gem install bundler -v 1.16.2
19
19
 
20
20
  - os: linux
21
21
  rvm: 2.5.1
@@ -27,7 +27,7 @@ matrix:
27
27
  before_install:
28
28
  - bash ./spec/support/setup-chromedriver.sh
29
29
  - bash ./spec/support/setup-geckodriver.sh
30
- - gem install bundler -v 1.16.1
30
+ - gem install bundler -v 1.16.2
31
31
 
32
32
  - os: linux
33
33
  rvm: 2.4.4
@@ -39,7 +39,7 @@ matrix:
39
39
  before_install:
40
40
  - bash ./spec/support/setup-chromedriver.sh
41
41
  - bash ./spec/support/setup-geckodriver.sh
42
- - gem install bundler -v 1.16.1
42
+ - gem install bundler -v 1.16.2
43
43
 
44
44
  - os: linux
45
45
  rvm: 2.3.7
@@ -51,28 +51,28 @@ matrix:
51
51
  before_install:
52
52
  - bash ./spec/support/setup-chromedriver.sh
53
53
  - bash ./spec/support/setup-geckodriver.sh
54
- - gem install bundler -v 1.16.1
54
+ - gem install bundler -v 1.16.2
55
55
 
56
56
  # OSX is only testing unsupported browser safari - all results should be pending
57
57
  - os: osx
58
58
  rvm: 2.5.1
59
59
  before_install:
60
60
  - sudo safaridriver --enable
61
- - gem install bundler -v 1.16.1
61
+ - gem install bundler -v 1.16.2
62
62
  script: bundle exec rake spec SPEC=spec/watir-performance-non-supported-browser_spec.rb
63
63
 
64
64
  - os: osx
65
65
  rvm: 2.4.4
66
66
  before_install:
67
67
  - sudo safaridriver --enable
68
- - gem install bundler -v 1.16.1
68
+ - gem install bundler -v 1.16.2
69
69
  script: bundle exec rake spec SPEC=spec/watir-performance-non-supported-browser_spec.rb
70
70
 
71
71
  - os: osx
72
72
  rvm: 2.3.7
73
73
  before_install:
74
74
  - sudo safaridriver --enable
75
- - gem install bundler -v 1.16.1
75
+ - gem install bundler -v 1.16.2
76
76
  script: bundle exec rake spec SPEC=spec/watir-performance-non-supported-browser_spec.rb
77
77
 
78
78
  #- os: linux with saucelabs to test Edge and IE
@@ -83,7 +83,7 @@ matrix:
83
83
  # addons:
84
84
  # sauce_connect: true
85
85
  # before_install:
86
- # - gem install bundler -v 1.16.1
86
+ # - gem install bundler -v 1.16.2
87
87
  # - echo $SAUCELABS
88
88
 
89
89
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (5.2.0)
4
+ activesupport (5.2.1)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.2)
6
6
  i18n (>= 0.7, < 2)
7
7
  minitest (~> 5.1)
@@ -16,8 +16,8 @@ GEM
16
16
  diff-lcs (1.3)
17
17
  faraday (0.9.2)
18
18
  multipart-post (>= 1.2, < 3)
19
- ffi (1.9.23)
20
- git (1.3.0)
19
+ ffi (1.9.25)
20
+ git (1.5.0)
21
21
  github_api (0.16.0)
22
22
  addressable (~> 2.4.0)
23
23
  descendants_tracker (~> 0.0.4)
@@ -25,9 +25,9 @@ GEM
25
25
  hashie (>= 3.4)
26
26
  mime-types (>= 1.16, < 3.0)
27
27
  oauth2 (~> 1.0)
28
- hashie (3.5.7)
29
- highline (1.7.10)
30
- i18n (1.0.1)
28
+ hashie (3.6.0)
29
+ highline (2.0.0)
30
+ i18n (1.1.0)
31
31
  concurrent-ruby (~> 1.0)
32
32
  jeweler (2.3.9)
33
33
  builder
@@ -47,7 +47,7 @@ GEM
47
47
  multi_json (1.13.1)
48
48
  multi_xml (0.6.0)
49
49
  multipart-post (2.0.0)
50
- nokogiri (1.8.2)
50
+ nokogiri (1.8.4)
51
51
  mini_portile2 (~> 2.3.0)
52
52
  oauth2 (1.4.0)
53
53
  faraday (>= 0.8, < 0.13)
@@ -59,28 +59,28 @@ GEM
59
59
  rack (2.0.5)
60
60
  rake (12.3.1)
61
61
  rdoc (6.0.4)
62
- rspec (3.7.0)
63
- rspec-core (~> 3.7.0)
64
- rspec-expectations (~> 3.7.0)
65
- rspec-mocks (~> 3.7.0)
66
- rspec-core (3.7.1)
67
- rspec-support (~> 3.7.0)
68
- rspec-expectations (3.7.0)
62
+ rspec (3.8.0)
63
+ rspec-core (~> 3.8.0)
64
+ rspec-expectations (~> 3.8.0)
65
+ rspec-mocks (~> 3.8.0)
66
+ rspec-core (3.8.0)
67
+ rspec-support (~> 3.8.0)
68
+ rspec-expectations (3.8.1)
69
69
  diff-lcs (>= 1.2.0, < 2.0)
70
- rspec-support (~> 3.7.0)
71
- rspec-mocks (3.7.0)
70
+ rspec-support (~> 3.8.0)
71
+ rspec-mocks (3.8.0)
72
72
  diff-lcs (>= 1.2.0, < 2.0)
73
- rspec-support (~> 3.7.0)
74
- rspec-support (3.7.1)
73
+ rspec-support (~> 3.8.0)
74
+ rspec-support (3.8.0)
75
75
  rubyzip (1.2.1)
76
- selenium-webdriver (3.12.0)
76
+ selenium-webdriver (3.14.0)
77
77
  childprocess (~> 0.5)
78
78
  rubyzip (~> 1.2)
79
79
  semver2 (3.4.2)
80
80
  thread_safe (0.3.6)
81
81
  tzinfo (1.2.5)
82
82
  thread_safe (~> 0.1)
83
- watir (6.10.3)
83
+ watir (6.12.0)
84
84
  selenium-webdriver (~> 3.4, >= 3.4.1)
85
85
 
86
86
  PLATFORMS
@@ -96,4 +96,4 @@ DEPENDENCIES
96
96
  watir (~> 6.10)
97
97
 
98
98
  BUNDLED WITH
99
- 1.16.1
99
+ 1.16.3
data/README.rdoc CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Successor to 90kts:watir-webdriver-performance[https://github.com/90kts/watir-webdriver-performance] for Watir as opposed to watir-webdriver.
8
8
 
9
- The Watir-Performance aims to provide a set of navigation timing metrics for Watir[https://github.com/watir/watir] actions using a {W3C page performance standard}[http://w3c-test.org/webperf/specs/NavigationTiming/]. This is a perfect solution to capture response time metrics, and it’s very straightforward to do. Works for Chrome, Firefox, Edge and IE9 and up. Currently no Safari support.
9
+ The Watir-Performance aims to provide a set of navigation timing metrics for Watir[https://github.com/watir/watir] actions using a {W3C page performance standard}[https://w3c-test.org/navigation-timing/]. This is a perfect solution to capture response time metrics, and it’s very straightforward to do. Works for Chrome, Firefox, Edge and IE9 and up. Currently no Safari support.
10
10
 
11
11
  This gem collects and summarises metrics speficied in the W3C:Navigation[https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html]
12
12
  web performance specifications when using watir and a compatible browser.
data/Rakefile CHANGED
@@ -4,20 +4,23 @@ begin
4
4
  Bundler.setup(:default, :development)
5
5
  rescue Bundler::BundlerError => e
6
6
  warn e.message
7
- warn "Run `bundle install` to install missing gems"
7
+ warn 'Run `bundle install` to install missing gems'
8
8
  exit e.status_code
9
9
  end
10
- require 'rake'
11
10
 
11
+ require 'rake'
12
12
  require 'jeweler'
13
13
  Jeweler::Tasks.new do |gem|
14
- gem.name = "watir-performance"
15
- gem.homepage = "http://github.com/MacCracken/watir-performance"
16
- gem.license = "MIT"
17
- gem.summary = %Q{A simple helper gem for watir performance metrics}
18
- gem.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 and a compatible browser}
19
- gem.email = ['robert.maccracken@gmail.com', "tim.koops@gmail.com"]
20
- gem.authors = ['Robert MacCracken', "Tim Koopmans"]
14
+ gem.name = 'watir-performance'
15
+ gem.homepage = 'http://github.com/MacCracken/watir-performance'
16
+ gem.license = 'MIT'
17
+ gem.summary = 'A simple helper gem for watir performance metrics'
18
+ gem.description = 'This gem collects and summarises metrics speficied ' \
19
+ 'in the W3C Navigation web performance specifications ' \
20
+ 'at http://w3c-test.org/webperf/specs/NavigationTiming/ ' \
21
+ 'when using watir and a compatible browser'
22
+ gem.email = ['robert.maccracken@gmail.com', 'tim.koops@gmail.com']
23
+ gem.authors = ['Robert MacCracken', 'Tim Koopmans']
21
24
  gem.required_rubygems_version = '~> 2.7'
22
25
  gem.required_ruby_version = '>= 2.3.7'
23
26
  end
@@ -38,8 +41,7 @@ task default: :spec
38
41
 
39
42
  require 'rdoc/task'
40
43
  RDoc::Task.new do |rdoc|
41
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
42
-
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ''
43
45
  rdoc.rdoc_dir = 'rdoc'
44
46
  rdoc.title = "watir-performance #{version}"
45
47
  rdoc.rdoc_files.include('README*')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.3
data/lib/idl_extractor.rb CHANGED
@@ -17,39 +17,41 @@ results = {}
17
17
  results[:class] = 'Performance'
18
18
  results[:interfaces] = {}
19
19
  nodes.each do |node|
20
- interface_name = node.children.first.header.name.gsub("Performance","")
20
+ interface_name = node.children.first.header.name.gsub('Performance', '')
21
21
  results[:interfaces][interface_name] = {}
22
22
  results[:interfaces][interface_name][:attrs] = []
23
23
  results[:interfaces][interface_name][:constants] = {}
24
24
  node.children.first.children.each do |child|
25
25
  case child.class.to_s
26
- when "ZOMG::IDL::Nodes::Attribute"
26
+ when 'ZOMG::IDL::Nodes::Attribute'
27
27
  results[:interfaces][interface_name][:attrs] <<
28
28
  child.children.first.name.underscore
29
- when "ZOMG::IDL::Nodes::Constant"
30
- results[:interfaces][interface_name][:constants][child.name] = child.children.children
29
+ when 'ZOMG::IDL::Nodes::Constant'
30
+ consts = results[:interfaces][interface_name][:constants]
31
+ consts[child.name] = child.children.children
31
32
  end
32
33
  end
33
34
  end
34
35
 
35
- open(File.expand_path(File.dirname(__FILE__)) + "/#{results[:class].underscore}.rb", "w") do |f|
36
- f.puts "# auto-generated by idl_extractor.rb"
36
+ open(File.expand_path(File.dirname(__FILE__)) +
37
+ "/#{results[:class].underscore}.rb", 'w') do |f|
38
+ f.puts '# auto-generated by idl_extractor.rb'
37
39
  f.puts "class #{results[:class]}"
38
40
  results[:interfaces].each_key do |interface_name|
39
- f.puts " " * 2 + "class #{interface_name}"
40
- results[:interfaces][interface_name][:constants].each do |k,v|
41
- f.puts " " * 4 + "#{k} = #{v.to_i}"
41
+ f.puts ' ' * 2 + "class #{interface_name}"
42
+ results[:interfaces][interface_name][:constants].each do |k, v|
43
+ f.puts ' ' * 4 + "#{k} = #{v.to_i}"
42
44
  end
43
- f.puts " " * 4 + "attr_reader " +
45
+ f.puts ' ' * 4 + 'attr_reader ' +
44
46
  results[:interfaces][interface_name][:attrs].collect! {|x| ":"+x}.join(", ")
45
47
  f.puts <<-'eos'
46
- def initialize args
48
+ def initialize(args)
47
49
  args.each do |k,v|
48
50
  instance_variable_set("@#{k}", v) if respond_to?(k.to_sym) unless v.nil?
49
51
  end
50
52
  end
51
53
  eos
52
- f.puts " " * 2 + "end"
54
+ f.puts ' ' * 2 + 'end'
53
55
  end
54
- f.puts "end"
56
+ f.puts 'end'
55
57
  end
data/lib/performance.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # auto-generated by idl_extractor.rb
2
2
  class Performance
3
+ # Navigation Class
3
4
  class Navigation
4
5
  TYPE_RESERVED = 255
5
6
  TYPE_NAVIGATE = 0
@@ -7,15 +8,24 @@ class Performance
7
8
  TYPE_BACK_FORWARD = 2
8
9
  attr_reader :type, :redirect_count
9
10
  def initialize args
10
- args.each do |k,v|
11
+ args.each do |k, v|
11
12
  instance_variable_set("@#{k}", v) if respond_to?(k.to_sym) unless v.nil?
12
13
  end
13
14
  end
14
15
  end
16
+
17
+ # Timing Class
15
18
  class Timing
16
- attr_reader :navigation_start, :unload_event_start, :unload_event_end, :redirect_start, :redirect_end, :fetch_start, :domain_lookup_start, :domain_lookup_end, :connect_start, :connect_end, :secure_connection_start, :request_start, :response_start, :response_end, :dom_loading, :dom_interactive, :dom_content_loaded_event_start, :dom_content_loaded_event_end, :dom_complete, :load_event_start, :load_event_end
19
+ attr_reader :navigation_start, :unload_event_start, :unload_event_end,
20
+ :redirect_start, :redirect_end, :fetch_start,
21
+ :domain_lookup_start, :domain_lookup_end, :connect_start,
22
+ :connect_end, :secure_connection_start, :request_start,
23
+ :response_start, :response_end, :dom_loading,
24
+ :dom_interactive, :dom_content_loaded_event_start,
25
+ :dom_content_loaded_event_end, :dom_complete,
26
+ :load_event_start, :load_event_end
17
27
  def initialize args
18
- args.each do |k,v|
28
+ args.each do |k, v|
19
29
  instance_variable_set("@#{k}", v) if respond_to?(k.to_sym) unless v.nil?
20
30
  end
21
31
  end
@@ -28,10 +28,9 @@ module Watir
28
28
 
29
29
  def summarized_hash(hash)
30
30
  hash[:summary] = {}
31
- hash[:summary][:redirect] = hash[:timing][:redirect_end] -
32
- hash[:timing][:redirect_start] if hash[:timing][:redirect_end] > 0
33
- hash[:summary][:app_cache] = hash[:timing][:domain_lookup_start] -
34
- hash[:timing][:fetch_start] if hash[:timing][:fetch_start] > 0
31
+ timing = hash[:timing]
32
+ hash[:summary][:redirect] = redirect_timer(timing)
33
+ hash[:summary][:app_cache] = app_cache(timing)
35
34
  hash[:summary][:dns] = hash[:timing][:domain_lookup_end] -
36
35
  hash[:timing][:domain_lookup_start] if hash[:timing][:domain_lookup_start] > 0
37
36
  hash[:summary][:tcp_connection] = hash[:timing][:connect_end] -
@@ -72,6 +71,23 @@ module Watir
72
71
  end
73
72
  end
74
73
 
74
+ def timer_summerize(t_start, t_end, standard, hash)
75
+ case standard
76
+ when true
77
+ hash[t_end] - hash[t_start] if hash[t_end] > 0
78
+ else
79
+ hash[t_end] - hash[t_start] if hash[t_start] > 0
80
+ end
81
+ end
82
+
83
+ def redirect_timer(hash)
84
+ hash[:redirect_end] - hash[:redirect_start] if hash[:redirect_end] > 0
85
+ end
86
+
87
+ def app_cache(hash)
88
+ hash[:domain_lookup_start] - hash[:fetch_start] if hash[:fetch_start] > 0
89
+ end
90
+
75
91
  def earliest_timestamp(hash)
76
92
  timers = %i[navigation_start redirect_start redirect_end fetch_start]
77
93
  timer_checks(timers, hash)
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: watir-performance 0.6.1 ruby lib
5
+ # stub: watir-performance 0.6.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "watir-performance".freeze
9
- s.version = "0.6.1"
9
+ s.version = "0.6.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new("~> 2.7".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Robert MacCracken".freeze, "Tim Koopmans".freeze]
14
- s.date = "2018-05-08"
14
+ s.date = "2018-08-15"
15
15
  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 and a compatible browser".freeze
16
16
  s.email = ["robert.maccracken@gmail.com".freeze, "tim.koops@gmail.com".freeze]
17
17
  s.extra_rdoc_files = [
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44
44
  s.homepage = "http://github.com/MacCracken/watir-performance".freeze
45
45
  s.licenses = ["MIT".freeze]
46
46
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.7".freeze)
47
- s.rubygems_version = "2.7.6".freeze
47
+ s.rubygems_version = "2.7.7".freeze
48
48
  s.summary = "A simple helper gem for watir performance metrics".freeze
49
49
 
50
50
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert MacCracken
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-08 00:00:00.000000000 Z
12
+ date: 2018-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '2.7'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.7.6
165
+ rubygems_version: 2.7.7
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: A simple helper gem for watir performance metrics