watir 6.16.5 → 6.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +32 -107
  3. data/.travis.yml +24 -21
  4. data/CHANGES.md +16 -0
  5. data/Gemfile +3 -1
  6. data/Rakefile +3 -3
  7. data/appveyor.yml +2 -1
  8. data/lib/watir-webdriver.rb +1 -1
  9. data/lib/watir.rb +0 -1
  10. data/lib/watir/adjacent.rb +8 -10
  11. data/lib/watir/after_hooks.rb +4 -4
  12. data/lib/watir/browser.rb +5 -1
  13. data/lib/watir/capabilities.rb +9 -6
  14. data/lib/watir/cookies.rb +1 -1
  15. data/lib/watir/elements/element.rb +59 -46
  16. data/lib/watir/elements/file_field.rb +1 -0
  17. data/lib/watir/elements/iframe.rb +2 -2
  18. data/lib/watir/elements/link.rb +0 -9
  19. data/lib/watir/elements/radio.rb +1 -1
  20. data/lib/watir/elements/select.rb +2 -2
  21. data/lib/watir/generator/base/spec_extractor.rb +4 -4
  22. data/lib/watir/js_execution.rb +1 -1
  23. data/lib/watir/legacy_wait.rb +1 -1
  24. data/lib/watir/locators/element/selector_builder.rb +11 -12
  25. data/lib/watir/locators/element/selector_builder/xpath.rb +40 -13
  26. data/lib/watir/locators/text_field/selector_builder/xpath.rb +3 -1
  27. data/lib/watir/logger.rb +5 -2
  28. data/lib/watir/version.rb +1 -1
  29. data/lib/watir/window.rb +1 -1
  30. data/lib/watirspec.rb +1 -1
  31. data/lib/watirspec/guards.rb +1 -1
  32. data/lib/watirspec/rake_tasks.rb +2 -0
  33. data/lib/watirspec/runner.rb +4 -0
  34. data/spec/unit/container_spec.rb +1 -1
  35. data/spec/unit/logger_spec.rb +5 -7
  36. data/spec/unit/selector_builder/button_spec.rb +16 -15
  37. data/spec/unit/selector_builder/element_spec.rb +58 -9
  38. data/spec/unit/selector_builder/text_field_spec.rb +14 -14
  39. data/spec/watirspec/after_hooks_spec.rb +64 -78
  40. data/spec/watirspec/alert_spec.rb +69 -79
  41. data/spec/watirspec/browser_spec.rb +48 -46
  42. data/spec/watirspec/cookies_spec.rb +52 -37
  43. data/spec/watirspec/drag_and_drop_spec.rb +14 -38
  44. data/spec/watirspec/elements/button_spec.rb +2 -0
  45. data/spec/watirspec/elements/buttons_spec.rb +1 -1
  46. data/spec/watirspec/elements/checkbox_spec.rb +8 -4
  47. data/spec/watirspec/elements/date_field_spec.rb +18 -9
  48. data/spec/watirspec/elements/date_time_field_spec.rb +3 -4
  49. data/spec/watirspec/elements/div_spec.rb +62 -54
  50. data/spec/watirspec/elements/element_spec.rb +60 -78
  51. data/spec/watirspec/elements/elements_spec.rb +12 -3
  52. data/spec/watirspec/elements/filefield_spec.rb +25 -50
  53. data/spec/watirspec/elements/form_spec.rb +6 -8
  54. data/spec/watirspec/elements/frame_spec.rb +10 -13
  55. data/spec/watirspec/elements/iframe_spec.rb +17 -12
  56. data/spec/watirspec/elements/iframes_spec.rb +2 -2
  57. data/spec/watirspec/elements/link_spec.rb +18 -9
  58. data/spec/watirspec/elements/links_spec.rb +11 -3
  59. data/spec/watirspec/elements/option_spec.rb +15 -17
  60. data/spec/watirspec/elements/select_list_spec.rb +66 -80
  61. data/spec/watirspec/elements/text_field_spec.rb +8 -4
  62. data/spec/watirspec/elements/tr_spec.rb +0 -9
  63. data/spec/watirspec/html/forms_with_input_elements.html +1 -0
  64. data/spec/watirspec/html/iframes.html +3 -0
  65. data/spec/watirspec/html/non_control_elements.html +4 -4
  66. data/spec/watirspec/html/right_click.html +12 -0
  67. data/spec/watirspec/html/wait.html +1 -1
  68. data/spec/watirspec/relaxed_locate_spec.rb +16 -20
  69. data/spec/watirspec/support/rspec_matchers.rb +7 -6
  70. data/spec/watirspec/user_editable_spec.rb +1 -1
  71. data/spec/watirspec/wait_spec.rb +13 -17
  72. data/spec/watirspec/window_switching_spec.rb +162 -163
  73. data/spec/watirspec_helper.rb +7 -5
  74. data/watir.gemspec +4 -5
  75. metadata +14 -16
  76. data/lib/watir/elements/area.rb +0 -10
@@ -29,11 +29,9 @@ class LocalConfig
29
29
  def load_webdrivers
30
30
  case browser
31
31
  when :chrome
32
- Webdrivers::Chromedriver.version = 2.44 if ENV['APPVEYOR']
33
32
  Webdrivers::Chromedriver.update
34
33
  Watir.logger.info "chromedriver version: #{Webdrivers::Chromedriver.current_version.version}"
35
34
  when :firefox
36
- Webdrivers::Geckodriver.version = '0.20.1' if ENV['APPVEYOR']
37
35
  Webdrivers::Geckodriver.update
38
36
  Watir.logger.info "geckodriver version: #{Webdrivers::Geckodriver.current_version.version}"
39
37
  end
@@ -86,6 +84,8 @@ class LocalConfig
86
84
  matching_guards << [browser, Selenium::WebDriver::Platform.os]
87
85
  matching_guards << :relaxed_locate if Watir.relaxed_locate?
88
86
  matching_guards << :headless if @imp.browser_args.last[:headless]
87
+ matching_guards << :w3c if ENV['W3C']
88
+
89
89
  # TODO: Replace this with Selenium::WebDriver::Platform.ci after next Selenium Release
90
90
  if ENV['APPVEYOR']
91
91
  matching_guards << :appveyor
@@ -110,12 +110,14 @@ class LocalConfig
110
110
  def chrome_args
111
111
  opts = {args: ['--disable-translate']}
112
112
  opts[:headless] = true if ENV['HEADLESS'] == 'true'
113
- opts[:options] = {binary: ENV['CHROME_BINARY']} if ENV['CHROME_BINARY']
113
+ opts[:options] = {binary: ENV['CHROME_BINARY']} if ENV['CHROME_BINARY'] == 'true'
114
+ opts[:options] = {options: {w3c: true}} if ENV['W3C'] == 'true'
114
115
  opts
115
116
  end
116
117
 
117
118
  class SelectorListener < Selenium::WebDriver::Support::AbstractEventListener
118
119
  def initialize
120
+ super
119
121
  @counts = Hash.new(0)
120
122
  end
121
123
 
@@ -141,8 +143,8 @@ class RemoteConfig < LocalConfig
141
143
  require 'watirspec/remote_server'
142
144
 
143
145
  remote_server = WatirSpec::RemoteServer.new
144
- args = ["-Dwebdriver.chrome.driver=#{Webdrivers::Chromedriver.binary}",
145
- "-Dwebdriver.gecko.driver=#{Webdrivers::Geckodriver.binary}"]
146
+ args = ["-Dwebdriver.chrome.driver=#{Webdrivers::Chromedriver.driver_path}",
147
+ "-Dwebdriver.gecko.driver=#{Webdrivers::Geckodriver.driver_path}"]
146
148
  remote_server.start(4444, args: args)
147
149
  remote_server.server.webdriver_url
148
150
  end
@@ -6,7 +6,7 @@ require 'watir/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'watir'
8
8
  s.version = Watir::VERSION
9
- s.required_ruby_version = '>= 2.3.0'
9
+ s.required_ruby_version = '>= 2.5.0'
10
10
 
11
11
  s.platform = Gem::Platform::RUBY
12
12
  s.authors = ['Alex Rodionov', 'Titus Fortner', 'Justin Ko']
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  DESCRIPTION_MESSAGE
20
20
 
21
21
  s.license = 'MIT'
22
- s.rubyforge_project = 'watir'
23
22
 
24
23
  s.files = `git ls-files`.split("\n")
25
24
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -34,15 +33,15 @@ Gem::Specification.new do |s|
34
33
  s.add_development_dependency 'fuubar'
35
34
  s.add_development_dependency 'nokogiri'
36
35
  s.add_development_dependency 'pry'
37
- s.add_development_dependency 'rake', '~> 0.9.2'
36
+ s.add_development_dependency 'rake', '>= 12.3.3'
38
37
  s.add_development_dependency 'rspec', '~> 3.0'
39
38
  s.add_development_dependency 'rspec-retry'
40
39
  s.add_development_dependency 'rubocop', '~> 0.59'
41
40
  s.add_development_dependency 'selenium_statistics'
42
41
  s.add_development_dependency 'simplecov'
43
42
  s.add_development_dependency 'simplecov-console'
44
- s.add_development_dependency 'webdrivers', '~> 3.5.2'
43
+ s.add_development_dependency 'webdrivers', '~> 4.1'
45
44
  s.add_development_dependency 'webidl', '>= 0.2.2'
46
45
  s.add_development_dependency 'yard', '> 0.8.2.1'
47
- s.add_development_dependency 'yard-doctest', '>= 0.1.8'
46
+ s.add_development_dependency 'yard-doctest', '~> 0.1.14'
48
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.16.5
4
+ version: 6.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-12-25 00:00:00.000000000 Z
13
+ date: 2020-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: selenium-webdriver
@@ -120,16 +120,16 @@ dependencies:
120
120
  name: rake
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - "~>"
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
- version: 0.9.2
125
+ version: 12.3.3
126
126
  type: :development
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - "~>"
130
+ - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: 0.9.2
132
+ version: 12.3.3
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rspec
135
135
  requirement: !ruby/object:Gem::Requirement
@@ -220,14 +220,14 @@ dependencies:
220
220
  requirements:
221
221
  - - "~>"
222
222
  - !ruby/object:Gem::Version
223
- version: 3.5.2
223
+ version: '4.1'
224
224
  type: :development
225
225
  prerelease: false
226
226
  version_requirements: !ruby/object:Gem::Requirement
227
227
  requirements:
228
228
  - - "~>"
229
229
  - !ruby/object:Gem::Version
230
- version: 3.5.2
230
+ version: '4.1'
231
231
  - !ruby/object:Gem::Dependency
232
232
  name: webidl
233
233
  requirement: !ruby/object:Gem::Requirement
@@ -260,16 +260,16 @@ dependencies:
260
260
  name: yard-doctest
261
261
  requirement: !ruby/object:Gem::Requirement
262
262
  requirements:
263
- - - ">="
263
+ - - "~>"
264
264
  - !ruby/object:Gem::Version
265
- version: 0.1.8
265
+ version: 0.1.14
266
266
  type: :development
267
267
  prerelease: false
268
268
  version_requirements: !ruby/object:Gem::Requirement
269
269
  requirements:
270
- - - ">="
270
+ - - "~>"
271
271
  - !ruby/object:Gem::Version
272
- version: 0.1.8
272
+ version: 0.1.14
273
273
  description: |
274
274
  Watir stands for Web Application Testing In Ruby
275
275
  It facilitates the writing of automated tests by mimicing the behavior of a user interacting with a website.
@@ -305,7 +305,6 @@ files:
305
305
  - lib/watir/container.rb
306
306
  - lib/watir/cookies.rb
307
307
  - lib/watir/element_collection.rb
308
- - lib/watir/elements/area.rb
309
308
  - lib/watir/elements/button.rb
310
309
  - lib/watir/elements/cell.rb
311
310
  - lib/watir/elements/checkbox.rb
@@ -613,15 +612,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
613
612
  requirements:
614
613
  - - ">="
615
614
  - !ruby/object:Gem::Version
616
- version: 2.3.0
615
+ version: 2.5.0
617
616
  required_rubygems_version: !ruby/object:Gem::Requirement
618
617
  requirements:
619
618
  - - ">="
620
619
  - !ruby/object:Gem::Version
621
620
  version: '0'
622
621
  requirements: []
623
- rubyforge_project: watir
624
- rubygems_version: 2.5.2.3
622
+ rubygems_version: 3.1.2
625
623
  signing_key:
626
624
  specification_version: 4
627
625
  summary: Watir powered by Selenium
@@ -1,10 +0,0 @@
1
- module Watir
2
- class Area < HTMLElement
3
- #
4
- # @todo temporarily add href attribute
5
- #
6
- # @see https://www.w3.org/Bugs/Public/show_bug.cgi?id=23192
7
- #
8
- attribute String, :href, :href
9
- end # Area
10
- end # Watir