watir 6.16.5 → 6.19.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +5 -5
  2. data/.github/actions/enable-safari/action.yml +11 -0
  3. data/.github/actions/install-chrome/action.yml +11 -0
  4. data/.github/workflows/linux.yml +61 -0
  5. data/.github/workflows/mac.yml +55 -0
  6. data/.github/workflows/unit.yml +37 -0
  7. data/.github/workflows/windows.yml +39 -0
  8. data/.rubocop.yml +32 -107
  9. data/.rubocop_todo.yml +36 -0
  10. data/CHANGES.md +52 -0
  11. data/Gemfile +3 -1
  12. data/LICENSE +2 -2
  13. data/README.md +9 -10
  14. data/Rakefile +4 -4
  15. data/lib/watir/adjacent.rb +8 -10
  16. data/lib/watir/after_hooks.rb +4 -4
  17. data/lib/watir/alert.rb +1 -0
  18. data/lib/watir/attribute_helper.rb +2 -0
  19. data/lib/watir/browser.rb +7 -3
  20. data/lib/watir/capabilities.rb +245 -97
  21. data/lib/watir/cookies.rb +3 -1
  22. data/lib/watir/element_collection.rb +21 -6
  23. data/lib/watir/elements/element.rb +66 -53
  24. data/lib/watir/elements/file_field.rb +1 -0
  25. data/lib/watir/elements/html_elements.rb +0 -1
  26. data/lib/watir/elements/iframe.rb +4 -3
  27. data/lib/watir/elements/link.rb +0 -9
  28. data/lib/watir/elements/radio.rb +1 -1
  29. data/lib/watir/elements/select.rb +22 -7
  30. data/lib/watir/generator/base/spec_extractor.rb +4 -4
  31. data/lib/watir/generator/html/generator.rb +1 -1
  32. data/lib/watir/has_window.rb +17 -15
  33. data/lib/watir/http_client.rb +17 -0
  34. data/lib/watir/js_execution.rb +3 -3
  35. data/lib/watir/js_snippets.rb +2 -2
  36. data/lib/watir/legacy_wait.rb +1 -1
  37. data/lib/watir/locators/element/selector_builder/xpath.rb +50 -15
  38. data/lib/watir/locators/element/selector_builder.rb +12 -13
  39. data/lib/watir/locators/text_field/selector_builder/xpath.rb +3 -1
  40. data/lib/watir/locators.rb +1 -3
  41. data/lib/watir/logger.rb +7 -20
  42. data/lib/watir/radio_set.rb +2 -2
  43. data/lib/watir/user_editable.rb +6 -2
  44. data/lib/watir/version.rb +1 -1
  45. data/lib/watir/wait/timer.rb +1 -1
  46. data/lib/watir/wait.rb +2 -0
  47. data/lib/watir/window.rb +8 -4
  48. data/lib/watir/window_collection.rb +114 -0
  49. data/lib/watir-webdriver.rb +1 -1
  50. data/lib/watir.rb +3 -1
  51. data/lib/watirspec/guards.rb +1 -1
  52. data/lib/watirspec/implementation.rb +3 -5
  53. data/lib/watirspec/rake_tasks.rb +2 -0
  54. data/lib/watirspec/runner.rb +6 -2
  55. data/lib/watirspec/server.rb +1 -1
  56. data/lib/watirspec.rb +2 -1
  57. data/spec/spec_helper.rb +2 -7
  58. data/spec/unit/capabilities_spec.rb +1234 -18
  59. data/spec/unit/container_spec.rb +1 -1
  60. data/spec/unit/logger_spec.rb +5 -7
  61. data/spec/unit/match_elements/element_spec.rb +17 -15
  62. data/spec/unit/selector_builder/button_spec.rb +16 -15
  63. data/spec/unit/selector_builder/element_spec.rb +58 -9
  64. data/spec/unit/selector_builder/text_field_spec.rb +14 -14
  65. data/spec/unit/unit_helper.rb +2 -4
  66. data/spec/watirspec/after_hooks_spec.rb +58 -68
  67. data/spec/watirspec/alert_spec.rb +69 -79
  68. data/spec/watirspec/browser_spec.rb +51 -48
  69. data/spec/watirspec/cookies_spec.rb +52 -37
  70. data/spec/watirspec/drag_and_drop_spec.rb +14 -38
  71. data/spec/watirspec/elements/button_spec.rb +2 -0
  72. data/spec/watirspec/elements/buttons_spec.rb +1 -1
  73. data/spec/watirspec/elements/checkbox_spec.rb +8 -4
  74. data/spec/watirspec/elements/date_field_spec.rb +18 -9
  75. data/spec/watirspec/elements/date_time_field_spec.rb +3 -4
  76. data/spec/watirspec/elements/div_spec.rb +62 -54
  77. data/spec/watirspec/elements/element_spec.rb +73 -88
  78. data/spec/watirspec/elements/elements_spec.rb +12 -3
  79. data/spec/watirspec/elements/filefield_spec.rb +25 -50
  80. data/spec/watirspec/elements/form_spec.rb +6 -8
  81. data/spec/watirspec/elements/frame_spec.rb +10 -13
  82. data/spec/watirspec/elements/iframe_spec.rb +12 -9
  83. data/spec/watirspec/elements/iframes_spec.rb +2 -2
  84. data/spec/watirspec/elements/link_spec.rb +23 -12
  85. data/spec/watirspec/elements/links_spec.rb +11 -3
  86. data/spec/watirspec/elements/option_spec.rb +15 -17
  87. data/spec/watirspec/elements/select_list_spec.rb +222 -117
  88. data/spec/watirspec/elements/text_field_spec.rb +8 -4
  89. data/spec/watirspec/elements/tr_spec.rb +0 -9
  90. data/spec/watirspec/html/forms_with_input_elements.html +1 -0
  91. data/spec/watirspec/html/iframes.html +3 -0
  92. data/spec/watirspec/html/non_control_elements.html +4 -4
  93. data/spec/watirspec/html/right_click.html +12 -0
  94. data/spec/watirspec/html/special_chars.html +3 -0
  95. data/spec/watirspec/html/wait.html +6 -6
  96. data/spec/watirspec/html/window_switching.html +10 -0
  97. data/spec/watirspec/legacy_wait_spec.rb +216 -0
  98. data/spec/watirspec/special_chars_spec.rb +10 -0
  99. data/spec/watirspec/support/rspec_matchers.rb +33 -14
  100. data/spec/watirspec/user_editable_spec.rb +1 -1
  101. data/spec/watirspec/wait_spec.rb +257 -305
  102. data/spec/watirspec/window_switching_spec.rb +347 -211
  103. data/spec/watirspec_helper.rb +17 -20
  104. data/support/doctest_helper.rb +0 -2
  105. data/watir.gemspec +6 -7
  106. metadata +37 -26
  107. data/.travis.yml +0 -84
  108. data/appveyor.yml +0 -12
  109. data/lib/watir/elements/area.rb +0 -10
  110. data/spec/watirspec/relaxed_locate_spec.rb +0 -113
@@ -1,5 +1,6 @@
1
1
  require 'watirspec'
2
2
  require 'spec_helper'
3
+ require 'webdrivers'
3
4
 
4
5
  Watir.default_timeout = 8
5
6
 
@@ -27,16 +28,14 @@ class LocalConfig
27
28
  private
28
29
 
29
30
  def load_webdrivers
30
- case browser
31
- when :chrome
32
- Webdrivers::Chromedriver.version = 2.44 if ENV['APPVEYOR']
33
- Webdrivers::Chromedriver.update
34
- Watir.logger.info "chromedriver version: #{Webdrivers::Chromedriver.current_version.version}"
35
- when :firefox
36
- Webdrivers::Geckodriver.version = '0.20.1' if ENV['APPVEYOR']
37
- Webdrivers::Geckodriver.update
38
- Watir.logger.info "geckodriver version: #{Webdrivers::Geckodriver.current_version.version}"
39
- end
31
+ @imp.driver_info = case browser
32
+ when :chrome
33
+ Webdrivers::Chromedriver.update
34
+ "chromedriver version: #{Webdrivers::Chromedriver.current_version.version}"
35
+ when :firefox
36
+ Webdrivers::Geckodriver.update
37
+ "geckodriver version: #{Webdrivers::Geckodriver.current_version.version}"
38
+ end
40
39
  end
41
40
 
42
41
  def set_webdriver
@@ -86,11 +85,8 @@ class LocalConfig
86
85
  matching_guards << [browser, Selenium::WebDriver::Platform.os]
87
86
  matching_guards << :relaxed_locate if Watir.relaxed_locate?
88
87
  matching_guards << :headless if @imp.browser_args.last[:headless]
89
- # TODO: Replace this with Selenium::WebDriver::Platform.ci after next Selenium Release
90
- if ENV['APPVEYOR']
91
- matching_guards << :appveyor
92
- matching_guards << [browser, :appveyor]
93
- end
88
+ matching_guards << "v#{Watir::VERSION.tr('.', '_')[/.*(?=_)/]}".to_sym
89
+ matching_guards << :w3c if ENV['W3C']
94
90
 
95
91
  if !Selenium::WebDriver::Platform.linux? || ENV['DESKTOP_SESSION']
96
92
  # some specs (i.e. Window#maximize) needs a window manager on linux
@@ -103,19 +99,20 @@ class LocalConfig
103
99
  ENV['FIREFOX_BINARY'] ? {options: {binary: ENV['FIREFOX_BINARY']}} : {}
104
100
  end
105
101
 
106
- def safari_args
102
+ def safari_preview_args
107
103
  {technology_preview: true}
108
104
  end
109
105
 
110
106
  def chrome_args
111
- opts = {args: ['--disable-translate']}
107
+ opts = {options: {args: ['--disable-translate']}}
112
108
  opts[:headless] = true if ENV['HEADLESS'] == 'true'
113
- opts[:options] = {binary: ENV['CHROME_BINARY']} if ENV['CHROME_BINARY']
109
+ opts[:options][:binary] = ENV['CHROME_BINARY'] if ENV['CHROME_BINARY']
114
110
  opts
115
111
  end
116
112
 
117
113
  class SelectorListener < Selenium::WebDriver::Support::AbstractEventListener
118
114
  def initialize
115
+ super
119
116
  @counts = Hash.new(0)
120
117
  end
121
118
 
@@ -141,8 +138,8 @@ class RemoteConfig < LocalConfig
141
138
  require 'watirspec/remote_server'
142
139
 
143
140
  remote_server = WatirSpec::RemoteServer.new
144
- args = ["-Dwebdriver.chrome.driver=#{Webdrivers::Chromedriver.binary}",
145
- "-Dwebdriver.gecko.driver=#{Webdrivers::Geckodriver.binary}"]
141
+ args = ["-Dwebdriver.chrome.driver=#{Webdrivers::Chromedriver.driver_path}",
142
+ "-Dwebdriver.gecko.driver=#{Webdrivers::Geckodriver.driver_path}"]
146
143
  remote_server.start(4444, args: args)
147
144
  remote_server.server.webdriver_url
148
145
  end
@@ -97,5 +97,3 @@ YARD::Doctest.configure do |doctest|
97
97
  end
98
98
  end
99
99
  end
100
-
101
- ENV['DISPLAY'] = ':99.0' if ENV['TRAVIS']
data/watir.gemspec CHANGED
@@ -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,30 +19,29 @@ 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")
26
25
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
27
26
  s.require_paths = ['lib']
28
27
 
29
- s.add_dependency 'selenium-webdriver', '~> 3.6'
30
- s.add_runtime_dependency 'regexp_parser', '~>1.2'
28
+ s.add_dependency 'selenium-webdriver', '>= 3.142.7'
29
+ s.add_runtime_dependency 'regexp_parser', '>= 1.2', '< 3'
31
30
 
32
31
  s.add_development_dependency 'activesupport', '~> 4.0', '>= 4.1.11' # for pluralization during code generation
33
32
  s.add_development_dependency 'coveralls'
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.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -10,36 +10,42 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-12-25 00:00:00.000000000 Z
13
+ date: 2021-03-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: selenium-webdriver
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '3.6'
21
+ version: 3.142.7
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - "~>"
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '3.6'
28
+ version: 3.142.7
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: regexp_parser
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '1.2'
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '3'
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
- - - "~>"
43
+ - - ">="
41
44
  - !ruby/object:Gem::Version
42
45
  version: '1.2'
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: '3'
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: activesupport
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -120,16 +126,16 @@ dependencies:
120
126
  name: rake
121
127
  requirement: !ruby/object:Gem::Requirement
122
128
  requirements:
123
- - - "~>"
129
+ - - ">="
124
130
  - !ruby/object:Gem::Version
125
- version: 0.9.2
131
+ version: 12.3.3
126
132
  type: :development
127
133
  prerelease: false
128
134
  version_requirements: !ruby/object:Gem::Requirement
129
135
  requirements:
130
- - - "~>"
136
+ - - ">="
131
137
  - !ruby/object:Gem::Version
132
- version: 0.9.2
138
+ version: 12.3.3
133
139
  - !ruby/object:Gem::Dependency
134
140
  name: rspec
135
141
  requirement: !ruby/object:Gem::Requirement
@@ -220,14 +226,14 @@ dependencies:
220
226
  requirements:
221
227
  - - "~>"
222
228
  - !ruby/object:Gem::Version
223
- version: 3.5.2
229
+ version: '4.1'
224
230
  type: :development
225
231
  prerelease: false
226
232
  version_requirements: !ruby/object:Gem::Requirement
227
233
  requirements:
228
234
  - - "~>"
229
235
  - !ruby/object:Gem::Version
230
- version: 3.5.2
236
+ version: '4.1'
231
237
  - !ruby/object:Gem::Dependency
232
238
  name: webidl
233
239
  requirement: !ruby/object:Gem::Requirement
@@ -260,16 +266,16 @@ dependencies:
260
266
  name: yard-doctest
261
267
  requirement: !ruby/object:Gem::Requirement
262
268
  requirements:
263
- - - ">="
269
+ - - "~>"
264
270
  - !ruby/object:Gem::Version
265
- version: 0.1.8
271
+ version: 0.1.14
266
272
  type: :development
267
273
  prerelease: false
268
274
  version_requirements: !ruby/object:Gem::Requirement
269
275
  requirements:
270
- - - ">="
276
+ - - "~>"
271
277
  - !ruby/object:Gem::Version
272
- version: 0.1.8
278
+ version: 0.1.14
273
279
  description: |
274
280
  Watir stands for Web Application Testing In Ruby
275
281
  It facilitates the writing of automated tests by mimicing the behavior of a user interacting with a website.
@@ -283,15 +289,20 @@ extra_rdoc_files: []
283
289
  files:
284
290
  - ".document"
285
291
  - ".github/ISSUE_TEMPLATE.md"
292
+ - ".github/actions/enable-safari/action.yml"
293
+ - ".github/actions/install-chrome/action.yml"
294
+ - ".github/workflows/linux.yml"
295
+ - ".github/workflows/mac.yml"
296
+ - ".github/workflows/unit.yml"
297
+ - ".github/workflows/windows.yml"
286
298
  - ".gitignore"
287
299
  - ".rubocop.yml"
288
- - ".travis.yml"
300
+ - ".rubocop_todo.yml"
289
301
  - CHANGES.md
290
302
  - Gemfile
291
303
  - LICENSE
292
304
  - README.md
293
305
  - Rakefile
294
- - appveyor.yml
295
306
  - lib/watir-webdriver.rb
296
307
  - lib/watir.rb
297
308
  - lib/watir/adjacent.rb
@@ -305,7 +316,6 @@ files:
305
316
  - lib/watir/container.rb
306
317
  - lib/watir/cookies.rb
307
318
  - lib/watir/element_collection.rb
308
- - lib/watir/elements/area.rb
309
319
  - lib/watir/elements/button.rb
310
320
  - lib/watir/elements/cell.rb
311
321
  - lib/watir/elements/checkbox.rb
@@ -352,6 +362,7 @@ files:
352
362
  - lib/watir/generator/svg/spec_extractor.rb
353
363
  - lib/watir/generator/svg/visitor.rb
354
364
  - lib/watir/has_window.rb
365
+ - lib/watir/http_client.rb
355
366
  - lib/watir/js_execution.rb
356
367
  - lib/watir/js_snippets.rb
357
368
  - lib/watir/js_snippets/attributeValues.js
@@ -405,6 +416,7 @@ files:
405
416
  - lib/watir/wait.rb
406
417
  - lib/watir/wait/timer.rb
407
418
  - lib/watir/window.rb
419
+ - lib/watir/window_collection.rb
408
420
  - lib/watirspec.rb
409
421
  - lib/watirspec/guards.rb
410
422
  - lib/watirspec/implementation.rb
@@ -587,8 +599,8 @@ files:
587
599
  - spec/watirspec/html/wait.html
588
600
  - spec/watirspec/html/watirspec.css
589
601
  - spec/watirspec/html/window_switching.html
602
+ - spec/watirspec/legacy_wait_spec.rb
590
603
  - spec/watirspec/radio_set_spec.rb
591
- - spec/watirspec/relaxed_locate_spec.rb
592
604
  - spec/watirspec/screenshot_spec.rb
593
605
  - spec/watirspec/scroll_spec.rb
594
606
  - spec/watirspec/special_chars_spec.rb
@@ -613,15 +625,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
613
625
  requirements:
614
626
  - - ">="
615
627
  - !ruby/object:Gem::Version
616
- version: 2.3.0
628
+ version: 2.5.0
617
629
  required_rubygems_version: !ruby/object:Gem::Requirement
618
630
  requirements:
619
631
  - - ">="
620
632
  - !ruby/object:Gem::Version
621
633
  version: '0'
622
634
  requirements: []
623
- rubyforge_project: watir
624
- rubygems_version: 2.5.2.3
635
+ rubygems_version: 3.1.4
625
636
  signing_key:
626
637
  specification_version: 4
627
638
  summary: Watir powered by Selenium
@@ -800,8 +811,8 @@ test_files:
800
811
  - spec/watirspec/html/wait.html
801
812
  - spec/watirspec/html/watirspec.css
802
813
  - spec/watirspec/html/window_switching.html
814
+ - spec/watirspec/legacy_wait_spec.rb
803
815
  - spec/watirspec/radio_set_spec.rb
804
- - spec/watirspec/relaxed_locate_spec.rb
805
816
  - spec/watirspec/screenshot_spec.rb
806
817
  - spec/watirspec/scroll_spec.rb
807
818
  - spec/watirspec/special_chars_spec.rb
data/.travis.yml DELETED
@@ -1,84 +0,0 @@
1
- # Please note that we should not be using container-based infrastructure
2
- # because Chrome requires a lot of shared memory and Travis does not allow
3
- # use host's /dev/shm.
4
- sudo: required
5
- dist: trusty
6
- cache: bundler
7
- notifications:
8
- slack:
9
- secure: BLsBCm33R32VNRccrLx9F0P24X6BVpVHj1OWaN4Kyn6g9qXteIwC2VKVMnKNbifpojfMkrn0OeFQFK1O1DSOsC3mgzn/udoB+DnUGcSemFUn04xhbYF5SI+3zGPKPo0JLvjjdEKSSma84YwKdrj88pGUK34p01gL8hiaqjFzWdk=
10
- before_install:
11
- - gem update --system
12
- - gem install bundler
13
-
14
- before_script:
15
- - support/travis.sh
16
- - export PATH=~/.webdrivers:$PATH
17
-
18
- script: bundle exec rake $RAKE_TASK
19
-
20
- _version:
21
- three: &three
22
- language: ruby
23
- rvm: 2.3.8
24
- four: &four
25
- language: ruby
26
- rvm: 2.4.5
27
- five: &five
28
- language: ruby
29
- rvm: 2.5.3
30
-
31
- _browsers:
32
- firefox: &firefox-latest
33
- addons:
34
- firefox: latest
35
- chrome: &chrome
36
- addons:
37
- chrome: stable
38
-
39
- matrix:
40
- include:
41
- - env: RAKE_TASK=spec:remote_firefox
42
- <<: *five
43
- <<: *firefox-latest
44
- - env: RAKE_TASK=spec:remote_chrome
45
- <<: *five
46
- <<: *chrome
47
- - env: RAKE_TASK=spec:firefox RELAXED_LOCATE=false
48
- <<: *five
49
- <<: *firefox-latest
50
- - env: RAKE_TASK=spec:firefox
51
- <<: *five
52
- <<: *firefox-latest
53
- - env: RAKE_TASK=spec:firefox
54
- <<: *four
55
- <<: *firefox-latest
56
- - env: RAKE_TASK=spec:firefox
57
- <<: *three
58
- <<: *firefox-latest
59
- - env: RAKE_TASK=spec:chrome
60
- <<: *five
61
- <<: *chrome
62
- - env: RAKE_TASK=spec:chrome
63
- <<: *four
64
- <<: *chrome
65
- - env: RAKE_TASK=spec:chrome
66
- <<: *three
67
- <<: *chrome
68
- - env: RAKE_TASK=spec:chrome RELAXED_LOCATE=false
69
- <<: *five
70
- <<: *chrome
71
- - env: RAKE_TASK=spec:chrome HEADLESS=true
72
- <<: *five
73
- <<: *chrome
74
- - env: RAKE_TASK=spec:unit
75
- <<: *five
76
- - env: RAKE_TASK=spec:stats
77
- <<: *five
78
- <<: *chrome
79
- - env: RAKE_TASK=yard:doctest
80
- <<: *five
81
- <<: *chrome
82
- - env: RAKE_TASK=rubocop
83
- <<: *three
84
- <<: *chrome
data/appveyor.yml DELETED
@@ -1,12 +0,0 @@
1
- version: "#{build}"
2
- build: off
3
- clone_depth: 100
4
- install:
5
- - set PATH=C:\Ruby23\bin;%PATH%
6
- - bundle install
7
- test_script:
8
- - bundle exec rake %RAKE_TASK%
9
- environment:
10
- matrix:
11
- - RAKE_TASK: spec:chrome
12
- - RAKE_TASK: spec:firefox
@@ -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
@@ -1,113 +0,0 @@
1
- require 'watirspec_helper'
2
-
3
- describe 'Watir#relaxed_locate?' do
4
- compliant_on :relaxed_locate do
5
- context 'when true' do
6
- before :each do
7
- browser.goto(WatirSpec.url_for('wait.html'))
8
- end
9
-
10
- context 'when acting on an element that is never present' do
11
- it 'raises exception after timing out' do
12
- element = browser.link(id: 'not_there')
13
- expect { element.click }.to wait_and_raise_unknown_object_exception
14
- end
15
- end
16
-
17
- context 'when acting on an element whose parent is never present' do
18
- it 'raises exception after timing out' do
19
- element = browser.link(id: 'not_there')
20
- expect { element.element.click }.to wait_and_raise_unknown_object_exception
21
- end
22
- end
23
-
24
- context 'when acting on an element from a collection whose parent is never present' do
25
- it 'raises exception after timing out' do
26
- element = browser.link(id: 'not_there')
27
- expect { element.elements[2].click }.to wait_and_raise_unknown_object_exception
28
- end
29
- end
30
-
31
- context 'when acting on an element that is already present' do
32
- it 'does not wait' do
33
- expect { browser.link.click }.to execute_immediately
34
- end
35
- end
36
-
37
- context 'when acting on an element that eventually becomes present' do
38
- bug 'https://github.com/SeleniumHQ/selenium/issues/4380', %i[remote firefox] do
39
- it 'waits until present and then takes action' do
40
- start_time = ::Time.now
41
- browser.a(id: 'show_bar').click
42
- expect { browser.div(id: 'bar').click }.to_not raise_exception
43
- expect(::Time.now - start_time).to be < Watir.default_timeout
44
- end
45
-
46
- it 'waits until text field is displayed and then takes action' do
47
- start_time = ::Time.now
48
- browser.a(id: 'show_textfield').click
49
- expect { browser.text_field(id: 'textfield').set 'Foo' }.to_not raise_exception
50
- expect(::Time.now - start_time).to be < Watir.default_timeout
51
- end
52
- end
53
- end
54
-
55
- context 'when acting on a text field that eventually becomes writable' do
56
- it 'waits to not be readonly' do
57
- expect(browser.text_field(id: 'writable')).to be_readonly
58
- start_time = ::Time.now
59
- browser.a(id: 'make-writable').click
60
- expect { browser.text_field(id: 'writable').set 'foo' }.not_to raise_exception
61
- expect(::Time.now - start_time).to be > 2
62
- end
63
- end
64
-
65
- it 'ensures all checks happen once even if time has expired' do
66
- begin
67
- Watir.default_timeout = -1
68
- expect { browser.link.click }.to_not raise_exception
69
- ensure
70
- Watir.default_timeout = 30
71
- end
72
- end
73
-
74
- it 'does not wait for parent element to be present when querying child element' do
75
- el = browser.element(id: 'not_there').element(id: 'doesnt_matter')
76
- expect { el.present? }.to execute_immediately
77
- end
78
-
79
- it 'waits for parent element to be present before locating a collection' do
80
- els = browser.element(id: /not|there/).elements(id: 'doesnt_matter')
81
- expect { els.to_a }.to wait_and_raise_unknown_object_exception
82
- end
83
- end
84
- end
85
-
86
- not_compliant_on :relaxed_locate do
87
- context 'when false' do
88
- before :each do
89
- browser.goto(WatirSpec.url_for('wait.html'))
90
- end
91
-
92
- context 'when acting on an element that is never present' do
93
- it 'raises exception immediately' do
94
- element = browser.link(id: 'not_there')
95
- start_time = ::Time.now
96
- expect { element.click }.to raise_exception(Watir::Exception::UnknownObjectException)
97
- expect(::Time.now - start_time).to be < 1
98
- end
99
- end
100
-
101
- context 'when acting on an element that eventually becomes present' do
102
- it 'raises exception immediately' do
103
- start_time = ::Time.now
104
- browser.a(id: 'show_bar').click
105
-
106
- expect { browser.div(id: 'bar').click }.to raise_unknown_object_exception
107
-
108
- expect(::Time.now - start_time).to be < 1
109
- end
110
- end
111
- end
112
- end
113
- end