watir 6.7.3 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGES.md +11 -0
  4. data/lib/watir.rb +4 -1
  5. data/lib/watir/adjacent.rb +1 -1
  6. data/lib/watir/browser.rb +5 -3
  7. data/lib/watir/capabilities.rb +1 -0
  8. data/lib/watir/container.rb +1 -1
  9. data/lib/watir/elements/element.rb +31 -98
  10. data/lib/watir/elements/file_field.rb +1 -1
  11. data/lib/watir/elements/iframe.rb +1 -1
  12. data/lib/watir/elements/image.rb +1 -5
  13. data/lib/watir/elements/input.rb +15 -0
  14. data/lib/watir/elements/radio.rb +17 -0
  15. data/lib/watir/elements/select.rb +67 -20
  16. data/lib/watir/js_execution.rb +141 -0
  17. data/lib/watir/js_snippets.rb +16 -0
  18. data/lib/watir/js_snippets/backgroundColor.js +7 -0
  19. data/lib/watir/{atoms → js_snippets}/fireEvent.js +2 -0
  20. data/lib/watir/js_snippets/focus.js +3 -0
  21. data/lib/watir/{atoms → js_snippets}/getInnerHtml.js +1 -0
  22. data/lib/watir/js_snippets/getInnerText.js +19 -0
  23. data/lib/watir/{atoms → js_snippets}/getOuterHtml.js +2 -0
  24. data/lib/watir/js_snippets/getTextContent.js +19 -0
  25. data/lib/watir/js_snippets/isImageLoaded.js +3 -0
  26. data/lib/watir/js_snippets/selectOptionsLabel.js +10 -0
  27. data/lib/watir/js_snippets/selectOptionsText.js +10 -0
  28. data/lib/watir/js_snippets/selectOptionsValue.js +10 -0
  29. data/lib/watir/{atoms → js_snippets}/selectText.js +3 -0
  30. data/lib/watir/js_snippets/selectedOptions.js +11 -0
  31. data/lib/watir/js_snippets/setValue.js +3 -0
  32. data/lib/watir/locators/element/locator.rb +24 -10
  33. data/lib/watir/radio_set.rb +231 -0
  34. data/lib/watir/user_editable.rb +16 -2
  35. data/lib/watirspec/remote_server.rb +2 -1
  36. data/spec/browser_spec.rb +8 -2
  37. data/spec/spec_helper.rb +1 -0
  38. data/spec/watirspec/elements/div_spec.rb +22 -0
  39. data/spec/watirspec/elements/divs_spec.rb +1 -1
  40. data/spec/watirspec/elements/element_spec.rb +24 -7
  41. data/spec/watirspec/elements/labels_spec.rb +1 -1
  42. data/spec/watirspec/elements/radio_spec.rb +17 -3
  43. data/spec/watirspec/elements/radios_spec.rb +1 -1
  44. data/spec/watirspec/elements/select_list_spec.rb +167 -65
  45. data/spec/watirspec/elements/text_field_spec.rb +36 -0
  46. data/spec/watirspec/html/forms_with_input_elements.html +4 -2
  47. data/spec/watirspec/html/non_control_elements.html +1 -1
  48. data/spec/watirspec/radio_set_spec.rb +340 -0
  49. data/spec/watirspec_helper.rb +14 -1
  50. data/support/doctest_helper.rb +11 -8
  51. data/watir.gemspec +2 -2
  52. metadata +30 -11
  53. data/lib/watir/atoms.rb +0 -22
  54. data/lib/watir/atoms/README +0 -3
  55. data/lib/watir/extensions/select_text.rb +0 -11
data/watir.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'watir'
5
- s.version = '6.7.3'
5
+ s.version = '6.8.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ['Alex Rodionov', 'Titus Fortner']
8
8
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
@@ -33,5 +33,5 @@ It facilitates the writing of automated tests by mimicing the behavior of a user
33
33
  s.add_development_dependency 'pry'
34
34
  s.add_development_dependency 'coveralls'
35
35
  s.add_development_dependency 'yard-doctest', '>= 0.1.8'
36
- s.add_development_dependency 'webdrivers', '~> 2.0'
36
+ s.add_development_dependency 'webdrivers', '~> 3.0', '>= 3.1.0'
37
37
  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.7.3
4
+ version: 6.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-22 00:00:00.000000000 Z
12
+ date: 2017-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
@@ -177,14 +177,20 @@ dependencies:
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '2.0'
180
+ version: '3.0'
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: 3.1.0
181
184
  type: :development
182
185
  prerelease: false
183
186
  version_requirements: !ruby/object:Gem::Requirement
184
187
  requirements:
185
188
  - - "~>"
186
189
  - !ruby/object:Gem::Version
187
- version: '2.0'
190
+ version: '3.0'
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: 3.1.0
188
194
  description: |
189
195
  Watir stands for Web Application Testing In Ruby
190
196
  It facilitates the writing of automated tests by mimicing the behavior of a user interacting with a website.
@@ -210,12 +216,6 @@ files:
210
216
  - lib/watir/after_hooks.rb
211
217
  - lib/watir/alert.rb
212
218
  - lib/watir/aliases.rb
213
- - lib/watir/atoms.rb
214
- - lib/watir/atoms/README
215
- - lib/watir/atoms/fireEvent.js
216
- - lib/watir/atoms/getInnerHtml.js
217
- - lib/watir/atoms/getOuterHtml.js
218
- - lib/watir/atoms/selectText.js
219
219
  - lib/watir/attribute_helper.rb
220
220
  - lib/watir/browser.rb
221
221
  - lib/watir/capabilities.rb
@@ -236,6 +236,7 @@ files:
236
236
  - lib/watir/elements/html_elements.rb
237
237
  - lib/watir/elements/iframe.rb
238
238
  - lib/watir/elements/image.rb
239
+ - lib/watir/elements/input.rb
239
240
  - lib/watir/elements/link.rb
240
241
  - lib/watir/elements/list.rb
241
242
  - lib/watir/elements/option.rb
@@ -251,7 +252,6 @@ files:
251
252
  - lib/watir/elements/text_field.rb
252
253
  - lib/watir/exception.rb
253
254
  - lib/watir/extensions/nokogiri.rb
254
- - lib/watir/extensions/select_text.rb
255
255
  - lib/watir/generator.rb
256
256
  - lib/watir/generator/base.rb
257
257
  - lib/watir/generator/base/generator.rb
@@ -268,6 +268,22 @@ files:
268
268
  - lib/watir/generator/svg/spec_extractor.rb
269
269
  - lib/watir/generator/svg/visitor.rb
270
270
  - lib/watir/has_window.rb
271
+ - lib/watir/js_execution.rb
272
+ - lib/watir/js_snippets.rb
273
+ - lib/watir/js_snippets/backgroundColor.js
274
+ - lib/watir/js_snippets/fireEvent.js
275
+ - lib/watir/js_snippets/focus.js
276
+ - lib/watir/js_snippets/getInnerHtml.js
277
+ - lib/watir/js_snippets/getInnerText.js
278
+ - lib/watir/js_snippets/getOuterHtml.js
279
+ - lib/watir/js_snippets/getTextContent.js
280
+ - lib/watir/js_snippets/isImageLoaded.js
281
+ - lib/watir/js_snippets/selectOptionsLabel.js
282
+ - lib/watir/js_snippets/selectOptionsText.js
283
+ - lib/watir/js_snippets/selectOptionsValue.js
284
+ - lib/watir/js_snippets/selectText.js
285
+ - lib/watir/js_snippets/selectedOptions.js
286
+ - lib/watir/js_snippets/setValue.js
271
287
  - lib/watir/legacy_wait.rb
272
288
  - lib/watir/locators.rb
273
289
  - lib/watir/locators/button/locator.rb
@@ -289,6 +305,7 @@ files:
289
305
  - lib/watir/locators/text_field/selector_builder/xpath.rb
290
306
  - lib/watir/locators/text_field/validator.rb
291
307
  - lib/watir/logger.rb
308
+ - lib/watir/radio_set.rb
292
309
  - lib/watir/row_container.rb
293
310
  - lib/watir/screenshot.rb
294
311
  - lib/watir/user_editable.rb
@@ -462,6 +479,7 @@ files:
462
479
  - spec/watirspec/html/wait.html
463
480
  - spec/watirspec/html/watirspec.css
464
481
  - spec/watirspec/html/window_switching.html
482
+ - spec/watirspec/radio_set_spec.rb
465
483
  - spec/watirspec/relaxed_locate_spec.rb
466
484
  - spec/watirspec/screenshot_spec.rb
467
485
  - spec/watirspec/support/raise_exception_matchers.rb
@@ -656,6 +674,7 @@ test_files:
656
674
  - spec/watirspec/html/wait.html
657
675
  - spec/watirspec/html/watirspec.css
658
676
  - spec/watirspec/html/window_switching.html
677
+ - spec/watirspec/radio_set_spec.rb
659
678
  - spec/watirspec/relaxed_locate_spec.rb
660
679
  - spec/watirspec/screenshot_spec.rb
661
680
  - spec/watirspec/support/raise_exception_matchers.rb
data/lib/watir/atoms.rb DELETED
@@ -1,22 +0,0 @@
1
- module Watir
2
- module Atoms
3
-
4
- ATOMS = {}
5
-
6
- def self.load(function_name)
7
- ATOMS[function_name] = File.read(File.expand_path("../atoms/#{function_name}.js", __FILE__))
8
- end
9
-
10
- load :fireEvent
11
- load :getOuterHtml
12
- load :getInnerHtml
13
-
14
- private
15
-
16
- def execute_atom(function_name, *arguments)
17
- script = "return (%s).apply(null, arguments)" % ATOMS.fetch(function_name)
18
- driver.execute_script(script, *arguments)
19
- end
20
-
21
- end # Atoms
22
- end # Watir
@@ -1,3 +0,0 @@
1
- These compiled JavaScript fragments originate in the Selenium code base, and are under the Apache 2.0 License.
2
-
3
- See https://github.com/SeleniumHQ/selenium/tree/master/javascript/watir-atoms
@@ -1,11 +0,0 @@
1
- Watir::Atoms.load :selectText
2
-
3
- module Watir
4
- class Element
5
- def select_text(str)
6
- element_call do
7
- execute_atom :selectText, @element, str
8
- end
9
- end
10
- end # Element
11
- end # Watir