watir-webdriver 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -2
  3. data/.travis.yml +2 -3
  4. data/CHANGES.md +10 -1
  5. data/Gemfile +1 -1
  6. data/README.md +22 -17
  7. data/Rakefile +55 -52
  8. data/lib/watir-webdriver.rb +3 -2
  9. data/lib/watir-webdriver/alert.rb +0 -1
  10. data/lib/watir-webdriver/atoms/README +1 -1
  11. data/lib/watir-webdriver/browser.rb +4 -5
  12. data/lib/watir-webdriver/cell_container.rb +2 -2
  13. data/lib/watir-webdriver/container.rb +2 -3
  14. data/lib/watir-webdriver/cookies.rb +8 -8
  15. data/lib/watir-webdriver/element_collection.rb +3 -4
  16. data/lib/watir-webdriver/elements/area.rb +0 -1
  17. data/lib/watir-webdriver/elements/button.rb +0 -1
  18. data/lib/watir-webdriver/elements/checkbox.rb +2 -4
  19. data/lib/watir-webdriver/elements/element.rb +69 -45
  20. data/lib/watir-webdriver/elements/file_field.rb +2 -3
  21. data/lib/watir-webdriver/elements/font.rb +2 -2
  22. data/lib/watir-webdriver/elements/form.rb +0 -1
  23. data/lib/watir-webdriver/elements/hidden.rb +2 -3
  24. data/lib/watir-webdriver/elements/html_elements.rb +2282 -0
  25. data/lib/watir-webdriver/elements/iframe.rb +6 -7
  26. data/lib/watir-webdriver/elements/image.rb +0 -1
  27. data/lib/watir-webdriver/elements/input.rb +0 -1
  28. data/lib/watir-webdriver/elements/link.rb +0 -1
  29. data/lib/watir-webdriver/elements/option.rb +3 -4
  30. data/lib/watir-webdriver/elements/radio.rb +2 -3
  31. data/lib/watir-webdriver/elements/select.rb +0 -1
  32. data/lib/watir-webdriver/elements/svg_elements.rb +787 -0
  33. data/lib/watir-webdriver/elements/table.rb +0 -2
  34. data/lib/watir-webdriver/elements/table_section.rb +1 -1
  35. data/lib/watir-webdriver/elements/text_field.rb +2 -3
  36. data/lib/watir-webdriver/exception.rb +0 -2
  37. data/lib/watir-webdriver/extensions/nokogiri.rb +1 -1
  38. data/lib/watir-webdriver/generator.rb +3 -0
  39. data/lib/watir-webdriver/generator/base.rb +11 -0
  40. data/lib/watir-webdriver/{html → generator/base}/generator.rb +23 -33
  41. data/lib/watir-webdriver/{html → generator/base}/idl_sorter.rb +3 -5
  42. data/lib/watir-webdriver/{html → generator/base}/spec_extractor.rb +15 -41
  43. data/lib/watir-webdriver/generator/base/util.rb +21 -0
  44. data/lib/watir-webdriver/{html → generator/base}/visitor.rb +15 -15
  45. data/lib/watir-webdriver/{html.rb → generator/html.rb} +3 -11
  46. data/lib/watir-webdriver/generator/html/generator.rb +36 -0
  47. data/lib/watir-webdriver/generator/html/spec_extractor.rb +50 -0
  48. data/lib/watir-webdriver/generator/html/visitor.rb +21 -0
  49. data/lib/watir-webdriver/generator/svg.rb +7 -0
  50. data/lib/watir-webdriver/generator/svg/generator.rb +38 -0
  51. data/lib/watir-webdriver/generator/svg/spec_extractor.rb +46 -0
  52. data/lib/watir-webdriver/generator/svg/visitor.rb +21 -0
  53. data/lib/watir-webdriver/has_window.rb +3 -3
  54. data/lib/watir-webdriver/locators/button_locator.rb +7 -2
  55. data/lib/watir-webdriver/locators/child_cell_locator.rb +1 -1
  56. data/lib/watir-webdriver/locators/child_row_locator.rb +1 -1
  57. data/lib/watir-webdriver/locators/element_locator.rb +44 -9
  58. data/lib/watir-webdriver/locators/text_area_locator.rb +4 -0
  59. data/lib/watir-webdriver/locators/text_field_locator.rb +7 -2
  60. data/lib/watir-webdriver/screenshot.rb +0 -1
  61. data/lib/watir-webdriver/version.rb +1 -1
  62. data/lib/watir-webdriver/wait.rb +10 -11
  63. data/lib/watir-webdriver/window.rb +5 -5
  64. data/lib/watir-webdriver/xpath_support.rb +0 -1
  65. data/spec/always_locate_spec.rb +4 -4
  66. data/spec/browser_spec.rb +3 -3
  67. data/spec/click_spec.rb +11 -4
  68. data/spec/container_spec.rb +2 -2
  69. data/spec/element_locator_spec.rb +145 -84
  70. data/spec/element_spec.rb +29 -16
  71. data/spec/html/clicks.html +3 -0
  72. data/spec/html/removed_element.html +7 -0
  73. data/spec/implementation.rb +5 -5
  74. data/spec/input_spec.rb +1 -1
  75. data/spec/spec_helper.rb +1 -2
  76. data/spec/special_chars_spec.rb +2 -2
  77. data/support/doctest_helper.rb +4 -4
  78. data/support/version_differ.rb +2 -2
  79. data/watir-webdriver.gemspec +3 -3
  80. metadata +27 -17
  81. data/lib/watir-webdriver/elements/generated.rb +0 -3106
  82. data/lib/watir-webdriver/html/util.rb +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c59e0947d61d3444072fba9199dbb1923ef78bb
4
- data.tar.gz: cea68a6afbae78f341d70c43e276697cd297b42a
3
+ metadata.gz: 9370b06f40fbc6975aeea6dea8986520f4bf5ecd
4
+ data.tar.gz: f4cb6ecae2be21dfb1c30170e8b1aaf4aac78127
5
5
  SHA512:
6
- metadata.gz: 118d8dac0739c61e992e684c3f7ea86744142bf27f68f10bd766f3f930724c5d7c7475b9ba02d2fb11dda3ff33c582ddf02227a5933e23b8c07d39409fcb1473
7
- data.tar.gz: 76b6e52b21db799697ccf8777debbeaebd14bbb5e19e60825c6f7c6a5ccce387c964dd647e1506f5dc4c8a6315264b8f9816f77cd234987e219be7741399b723
6
+ metadata.gz: 398ffa48eb35503b7b92b771bf6f2a9ab6a8afc5dbfcf9033e7daaa1fcb7c69c8dcd6b4a9df55a5c3d73fb20f7a2cd7b23106e26eb4b0ac2bed8f4f34155a5c9
7
+ data.tar.gz: 4966d71ac3d300392e7f8525a3f25aa81a712e7aada635632b2531cd5e57cfb52b0900f96ef0f2a141935095a251713727453301b06708474368778d3923ce89
data/.gitignore CHANGED
@@ -11,7 +11,8 @@ Gemfile.lock
11
11
  *.rbc
12
12
  .rbx/*
13
13
  chromedriver.log
14
- support/html5.html
14
+ support/html.html
15
+ support/svg.html
15
16
  /doc
16
17
  .idea
17
- .ruby-version
18
+ .ruby-version
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.0.0
2
+ - 2.0
3
+ - 2.1
4
4
  notifications:
5
5
  recipients:
6
- - jari.bakken@gmail.com
7
6
  - p0deje@gmail.com
8
7
  - jarmo.p@gmail.com
9
8
  irc: "irc.freenode.net#watir"
data/CHANGES.md CHANGED
@@ -1,4 +1,13 @@
1
- ### 0.7.0
1
+ ### 0.8.0 (2015-06-26)
2
+
3
+ * Ruby 1.8 is no longer supported. Ruby 1.9 still works, but not supported as well (#327)
4
+ * Ensure `Watir::Element` responds to `data_*` and `aria_*` methods (#333, thanks @daneandersen)
5
+ * Fixed the handling of child elements becoming stale (#321)
6
+ * Performance optimization for nested elements (#321)
7
+ * Support for SVG elements (see `lib/watir-webdriver/elements/svg_elements.rb`)
8
+ * Updated selenium-webdriver to 2.46.2
9
+
10
+ ### 0.7.0 (2015-03-02)
2
11
 
3
12
  * Allow finding all elements with prefer_css
4
13
  * Add support for yard-doctest (#287)
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  unless ENV['TRAVIS']
4
- gem "simplecov", ">= 0.3.5", :platform => :ruby_19
4
+ gem "simplecov", ">= 0.3.5", platform: :ruby_19
5
5
  end
6
6
 
7
7
  if ENV['LOCAL_WEBIDL']
data/README.md CHANGED
@@ -2,24 +2,24 @@ watir-webdriver
2
2
  ===============
3
3
 
4
4
  Watir implementation built on WebDriver's Ruby bindings.
5
- See https://web.archive.org/web/20140518221755/http://rubyforge.org/pipermail/wtr-development/2009-October/001313.html
5
+ See [introduction mail](https://web.archive.org/web/20140518221755/http://rubyforge.org/pipermail/wtr-development/2009-October/001313.html).
6
6
 
7
- [![Gem Version](https://badge.fury.io/rb/watir-webdriver.png)](http://badge.fury.io/rb/watir-webdriver)
8
- [![Build Status](https://travis-ci.org/watir/watir-webdriver.png?branch=master)](https://travis-ci.org/watir/watir-webdriver)
9
- [![Code Climate](https://codeclimate.com/github/watir/watir-webdriver.png)](https://codeclimate.com/github/watir/watir-webdriver)
10
- [![Dependency Status](https://gemnasium.com/watir/watir-webdriver.png)](https://gemnasium.com/watir/watir-webdriver)
11
- [![Coverage Status](https://coveralls.io/repos/watir/watir-webdriver/badge.png?branch=master)](https://coveralls.io/r/watir/watir-webdriver)
7
+ [![Gem Version](https://badge.fury.io/rb/watir-webdriver.svg)](http://badge.fury.io/rb/watir-webdriver)
8
+ [![Build Status](https://travis-ci.org/watir/watir-webdriver.svg?branch=master)](https://travis-ci.org/watir/watir-webdriver)
9
+ [![Code Climate](https://codeclimate.com/github/watir/watir-webdriver.svg)](https://codeclimate.com/github/watir/watir-webdriver)
10
+ [![Dependency Status](https://gemnasium.com/watir/watir-webdriver.svg)](https://gemnasium.com/watir/watir-webdriver)
11
+ [![Coverage Status](https://coveralls.io/repos/watir/watir-webdriver/badge.svg?branch=master)](https://coveralls.io/r/watir/watir-webdriver)
12
12
 
13
13
  Example
14
14
  -------
15
- ```ruby
16
15
 
16
+ ```ruby
17
17
  require 'watir-webdriver'
18
18
 
19
19
  browser = Watir::Browser.new :firefox
20
20
  browser.goto "http://google.com"
21
- browser.text_field(:name => 'q').set("WebDriver rocks!")
22
- browser.button(:name => 'btnG').click
21
+ browser.text_field(name: 'q').set("WebDriver rocks!")
22
+ browser.button(name: 'btnG').click
23
23
  puts browser.url
24
24
  browser.close
25
25
  ```
@@ -27,29 +27,34 @@ browser.close
27
27
  Description
28
28
  -----------
29
29
 
30
- The file in lib/watir/elements/generated.rb is autogenerated from the HTML5 spec. This is done by extracting the IDL parts from the spec and processing them with the WebIDL gem (link below).
30
+ The file in `lib/watir-webdriver/elements/html_generated.rb` is autogenerated from the HTML spec. This is done by extracting the IDL parts from the spec and processing them with the WebIDL gem (link below).
31
+
32
+ The same is true for `lib/watir-webdriver/elements/svg_elements.rb`.
31
33
 
32
34
  Specs
33
35
  -----
34
36
 
35
37
  watir-webdriver uses [watirspec](http://github.com/watir/watirspec) for testing. After cloning, you should fetch the submodule:
36
38
 
37
- git submodule init && git submodule update
39
+ ```bash
40
+ git submodule init && git submodule update
41
+ ```
38
42
 
39
- Specs specific to watir-webdriver are found in spec/*_spec.rb, with watirspec in spec/watirspec.
43
+ Specs specific to watir-webdriver are found in `spec/*_spec.rb`, with watirspec in `spec/watirspec/`.
40
44
 
41
45
  Doctests
42
46
  --------
43
47
 
44
48
  watir-webdriver uses [yard-doctest](https://github.com/p0deje/yard-doctest) for testing documentation examples.
45
49
 
46
- rake yard:doctest
50
+ ```bash
51
+ rake yard:doctest
52
+ ```
47
53
 
48
54
  API docs
49
55
  --------
50
56
 
51
- * http://rdoc.info/gems/watir-webdriver/ (basic docs, updated on every release)
52
- * http://watir.github.com/watir-webdriver/doc/ (includes all attribute methods, updated occasionally)
57
+ * http://rdoc.info/gems/watir-webdriver/ (updated on every release)
53
58
 
54
59
  See also
55
60
  --------
@@ -57,7 +62,7 @@ See also
57
62
  * http://watirwebdriver.com
58
63
  * http://github.com/jarib/webidl
59
64
  * http://github.com/watir/watirspec
60
- * http://selenium.googlecode.com
65
+ * https://github.com/seleniumhq/selenium
61
66
 
62
67
  Dependencies
63
68
  ------------
@@ -71,7 +76,7 @@ Note on Patches/Pull Requests
71
76
  * Make your feature addition or bug fix.
72
77
  * Add tests for it. This is important so I don't break it in a
73
78
  future version unintentionally.
74
- * Commit, do not mess with rakefile, version, or history.
79
+ * Commit, do not mess with Rakefile, version, or history.
75
80
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
76
81
  * Send me a pull request. Bonus points for topic branches.
77
82
 
data/Rakefile CHANGED
@@ -20,71 +20,72 @@ namespace :spec do
20
20
  end
21
21
  end
22
22
 
23
- task :default => [:spec, 'yard:doctest']
24
-
25
- namespace :html5 do
26
- SPEC_URI = "https://www.whatwg.org/specs/web-apps/current-work/"
27
- SPEC_PATH = "support/html5.html"
23
+ {
24
+ html: 'https://www.whatwg.org/specs/web-apps/current-work/',
25
+ svg: 'http://www.w3.org/TR/SVG2/single-page.html'
26
+ }.each do |type, spec_uri|
27
+ namespace type do
28
+ spec_path = "support/#{type}.html"
29
+
30
+ task generator_lib: :lib do
31
+ require "watir-webdriver/generator"
32
+ end
28
33
 
29
- task :html_lib => :lib do
30
- require 'watir-webdriver/html'
31
- end
34
+ desc "Download #{type.upcase} spec from #{spec_uri}"
35
+ task :download do
36
+ require "open-uri"
37
+ mv spec_path, "#{spec_path}.old" if File.exist?(spec_path)
38
+ downloaded_bytes = 0
32
39
 
33
- desc "Download the HTML5 spec from #{SPEC_URI}"
34
- task :download do
35
- require "open-uri"
36
- mv SPEC_PATH, "#{SPEC_PATH}.old" if File.exist?(SPEC_PATH)
37
- downloaded_bytes = 0
40
+ File.open(spec_path, "w") do |io|
41
+ io << "<!-- downloaded from #{spec_uri} on #{Time.now} -->\n"
42
+ io << data = open(spec_uri).read
43
+ downloaded_bytes = data.bytesize
44
+ end
38
45
 
39
- File.open(SPEC_PATH, "w") do |io|
40
- io << "<!-- downloaded from #{SPEC_URI} on #{Time.now} -->\n"
41
- io << data = open(SPEC_URI).read
42
- downloaded_bytes = data.bytesize
46
+ puts "#{spec_uri} => #{spec_path} (#{downloaded_bytes} bytes)"
43
47
  end
44
48
 
45
- puts "#{SPEC_URI} => #{SPEC_PATH} (#{downloaded_bytes} bytes)"
46
- end
49
+ desc "Print IDL parts from #{spec_uri}"
50
+ task print: :generator_lib do
51
+ extractor = Watir::Generator.const_get("#{type.upcase}::SpecExtractor").new(spec_path)
47
52
 
48
- desc "Print IDL parts from #{SPEC_URI}"
49
- task :print => :html_lib do
50
- extractor = Watir::HTML::SpecExtractor.new(SPEC_PATH)
53
+ extractor.process.each do |tag_name, interface_definitions|
54
+ puts "#{tag_name.ljust(10)} => #{interface_definitions.map(&:name)}"
55
+ end
51
56
 
52
- extractor.process.each do |tag_name, interface_definitions|
53
- puts "#{tag_name.ljust(10)} => #{interface_definitions.map { |e| e.name }}"
54
- end
55
-
56
- extractor.print_hierarchy
57
+ extractor.print_hierarchy
57
58
 
58
- unless extractor.errors.empty?
59
- puts "\n\n<======================= ERRORS =======================>\n\n"
60
- puts extractor.errors.join("\n" + "="*80 + "\n")
59
+ if extractor.errors.any?
60
+ puts "\n\n<======================= ERRORS =======================>\n\n"
61
+ puts extractor.errors.join("\n" + "=" * 80 + "\n")
62
+ end
61
63
  end
62
- end
63
64
 
64
- desc 'Re-generate the base Watir element classes from the spec'
65
- task :generate => :html_lib do
66
- old_file = "lib/watir-webdriver/elements/generated.rb"
67
- generator = Watir::HTML::Generator.new
65
+ desc 'Re-generate the base Watir element classes from the spec'
66
+ task generate: :generator_lib do
67
+ old_file = "lib/watir-webdriver/elements/#{type}_elements.rb"
68
+ generator = Watir::Generator.const_get(type.upcase).new
68
69
 
69
- File.open("#{old_file}.new", "w") do |file|
70
- generator.generate(SPEC_PATH, file)
70
+ File.open("#{old_file}.new", "w") do |file|
71
+ generator.generate(spec_path, file)
72
+ end
73
+
74
+ if File.exist?(old_file)
75
+ system "diff -Naut #{old_file} #{old_file}.new | less"
76
+ end
71
77
  end
72
78
 
73
- if File.exist?(old_file)
74
- system "diff -Naut #{old_file} #{old_file}.new | less"
79
+ desc "Move #{type}.rb.new to #{type}.rb"
80
+ task :overwrite do
81
+ file = "lib/watir-webdriver/elements/#{type}_elements.rb"
82
+ mv "#{file}.new", file
75
83
  end
76
- end
77
84
 
78
- desc 'Move generated.rb.new to generated.rb'
79
- task :overwrite do
80
- file = "lib/watir-webdriver/elements/generated.rb"
81
- mv "#{file}.new", file
85
+ desc "download spec -> generate -> #{type}.rb"
86
+ task update: [:download, :generate, :overwrite]
82
87
  end
83
-
84
- desc 'download spec -> generate -> generated.rb'
85
- task :update => [:download, :generate, :overwrite]
86
- end # html5
87
-
88
+ end
88
89
 
89
90
  require 'yard'
90
91
  YARD::Rake::YardocTask.new do |task|
@@ -102,19 +103,21 @@ namespace :changes do
102
103
  end
103
104
 
104
105
  desc 'Update CHANGES.md'
105
- task :update => :differ do
106
+ task update: :differ do
106
107
  VersionDiffer.new.update('CHANGES.md')
107
108
  end
108
109
 
109
110
  desc 'Generate CHANGES.md from scratch'
110
- task :generate => :differ do
111
+ task generate: :differ do
111
112
  VersionDiffer.new.generate('CHANGES.md')
112
113
  end
113
114
 
114
115
  desc 'Print latest diff'
115
- task :print => :differ do
116
+ task print: :differ do
116
117
  VersionDiffer.new.print_latest(STDOUT)
117
118
  end
118
119
  end
119
120
 
120
121
  load "spec/watirspec/watirspec.rake" if File.exist?("spec/watirspec/watirspec.rake")
122
+
123
+ task default: [:spec, 'yard:doctest']
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  require 'selenium-webdriver'
3
2
 
4
3
  require 'watir-webdriver/version'
@@ -87,7 +86,9 @@ require 'watir-webdriver/cell_container'
87
86
  require 'watir-webdriver/user_editable'
88
87
  require 'watir-webdriver/element_collection'
89
88
  require 'watir-webdriver/elements/element'
90
- require 'watir-webdriver/elements/generated'
89
+
90
+ require 'watir-webdriver/elements/html_elements'
91
+ require 'watir-webdriver/elements/svg_elements'
91
92
 
92
93
  require 'watir-webdriver/elements/area'
93
94
  require 'watir-webdriver/elements/button'
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  module Watir
3
2
  class Alert
4
3
 
@@ -1,3 +1,3 @@
1
1
  These compiled JavaScript fragments originate in the Selenium code base, and are under the Apache 2.0 License.
2
2
 
3
- See http://selenium.googlecode.com/svn/trunk/javascript/watir-atoms/
3
+ See https://github.com/SeleniumHQ/selenium/tree/master/javascript/watir-atoms
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  module Watir
3
2
 
4
3
  #
@@ -42,7 +41,7 @@ module Watir
42
41
 
43
42
  def initialize(browser = :firefox, *args)
44
43
  case browser
45
- when Symbol, String
44
+ when ::Symbol, String
46
45
  @driver = Selenium::WebDriver.for browser.to_sym, *args
47
46
  when Selenium::WebDriver::Driver
48
47
  @driver = browser
@@ -343,7 +342,7 @@ module Watir
343
342
  #
344
343
  # @example
345
344
  # browser.without_checkers do
346
- # browser.element(:name => "new_user_button").click
345
+ # browser.element(name: "new_user_button").click
347
346
  # end
348
347
  #
349
348
  # @yieldparam [Watir::Browser]
@@ -387,7 +386,7 @@ module Watir
387
386
  true
388
387
  end
389
388
  end
390
- alias_method :assert_not_stale, :assert_exists
389
+ alias_method :ensure_not_stale, :assert_exists
391
390
 
392
391
  def reset!
393
392
  # no-op
@@ -415,7 +414,7 @@ module Watir
415
414
  end
416
415
 
417
416
  def wrap_element(element)
418
- Watir.element_class_for(element.tag_name.downcase).new(self, :element => element)
417
+ Watir.element_class_for(element.tag_name.downcase).new(self, element: element)
419
418
  end
420
419
 
421
420
  end # Browser
@@ -8,7 +8,7 @@ module Watir
8
8
  #
9
9
 
10
10
  def cell(*args)
11
- cell = TableCell.new(self, extract_selector(args).merge(:tag_name => /^(th|td)$/))
11
+ cell = TableCell.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
12
12
  cell.locator_class = ChildCellLocator
13
13
 
14
14
  cell
@@ -21,7 +21,7 @@ module Watir
21
21
  #
22
22
 
23
23
  def cells(*args)
24
- cells = TableCellCollection.new(self, extract_selector(args).merge(:tag_name => /^(th|td)$/))
24
+ cells = TableCellCollection.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
25
25
  cells.locator_class = ChildCellLocator
26
26
 
27
27
  cells
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  module Watir
3
2
  module Container
4
3
  include XpathSupport
@@ -8,7 +7,7 @@ module Watir
8
7
  # Returns element.
9
8
  #
10
9
  # @example
11
- # browser.element(:data_bind => 'func')
10
+ # browser.element(data_bind: 'func')
12
11
  #
13
12
  # @return [HTMLElement]
14
13
  #
@@ -21,7 +20,7 @@ module Watir
21
20
  # Returns element collection.
22
21
  #
23
22
  # @example
24
- # browser.elements(:data_bind => 'func')
23
+ # browser.elements(data_bind: 'func')
25
24
  #
26
25
  # @return [HTMLElementCollection]
27
26
  #
@@ -19,7 +19,7 @@ module Watir
19
19
 
20
20
  def to_a
21
21
  @control.all_cookies.map do |e|
22
- e.merge(:expires => e[:expires] ? to_time(e[:expires]) : nil)
22
+ e.merge(expires: e[:expires] ? to_time(e[:expires]) : nil)
23
23
  end
24
24
  end
25
25
 
@@ -42,7 +42,7 @@ module Watir
42
42
  # Adds new cookie.
43
43
  #
44
44
  # @example
45
- # browser.cookies.add 'my_session', 'BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk', :secure => true
45
+ # browser.cookies.add 'my_session', 'BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk', secure: true
46
46
  #
47
47
  # @param [String] name
48
48
  # @param [String] value
@@ -55,12 +55,12 @@ module Watir
55
55
 
56
56
  def add(name, value, opts = {})
57
57
  cookie = {
58
- :name => name,
59
- :value => value,
60
- :secure => opts[:secure],
61
- :path => opts[:path],
62
- :expires => opts[:expires],
63
- :domain => opts[:domain]
58
+ name: name,
59
+ value: value,
60
+ secure: opts[:secure],
61
+ path: opts[:path],
62
+ expires: opts[:expires],
63
+ domain: opts[:domain]
64
64
  }
65
65
 
66
66
  @control.add_cookie cookie