watir-webdriver 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.travis.yml +7 -3
  4. data/CHANGES.md +6 -0
  5. data/Rakefile +17 -5
  6. data/lib/watir-webdriver.rb +16 -6
  7. data/lib/watir-webdriver/after_hooks.rb +2 -2
  8. data/lib/watir-webdriver/browser.rb +5 -5
  9. data/lib/watir-webdriver/cell_container.rb +4 -10
  10. data/lib/watir-webdriver/element_collection.rb +28 -7
  11. data/lib/watir-webdriver/elements/button.rb +0 -18
  12. data/lib/watir-webdriver/elements/cell.rb +17 -0
  13. data/lib/watir-webdriver/elements/checkbox.rb +0 -3
  14. data/lib/watir-webdriver/elements/element.rb +37 -10
  15. data/lib/watir-webdriver/elements/file_field.rb +0 -3
  16. data/lib/watir-webdriver/elements/hidden.rb +0 -3
  17. data/lib/watir-webdriver/elements/html_elements.rb +0 -219
  18. data/lib/watir-webdriver/elements/iframe.rb +29 -19
  19. data/lib/watir-webdriver/elements/row.rb +17 -0
  20. data/lib/watir-webdriver/elements/svg_elements.rb +0 -120
  21. data/lib/watir-webdriver/elements/table.rb +1 -1
  22. data/lib/watir-webdriver/elements/table_cell.rb +0 -28
  23. data/lib/watir-webdriver/elements/table_row.rb +1 -30
  24. data/lib/watir-webdriver/elements/text_area.rb +0 -17
  25. data/lib/watir-webdriver/elements/text_field.rb +2 -8
  26. data/lib/watir-webdriver/generator/base/visitor.rb +1 -10
  27. data/lib/watir-webdriver/locators.rb +22 -0
  28. data/lib/watir-webdriver/locators/button/locator.rb +38 -0
  29. data/lib/watir-webdriver/locators/button/selector_builder.rb +27 -0
  30. data/lib/watir-webdriver/locators/button/selector_builder/xpath.rb +29 -0
  31. data/lib/watir-webdriver/locators/button/validator.rb +14 -0
  32. data/lib/watir-webdriver/locators/cell/locator.rb +17 -0
  33. data/lib/watir-webdriver/locators/cell/selector_builder.rb +24 -0
  34. data/lib/watir-webdriver/locators/element/locator.rb +249 -0
  35. data/lib/watir-webdriver/locators/element/selector_builder.rb +147 -0
  36. data/lib/watir-webdriver/locators/element/selector_builder/css.rb +65 -0
  37. data/lib/watir-webdriver/locators/element/selector_builder/xpath.rb +72 -0
  38. data/lib/watir-webdriver/locators/element/validator.rb +22 -0
  39. data/lib/watir-webdriver/locators/row/locator.rb +17 -0
  40. data/lib/watir-webdriver/locators/row/selector_builder.rb +29 -0
  41. data/lib/watir-webdriver/locators/text_area/locator.rb +13 -0
  42. data/lib/watir-webdriver/locators/text_area/selector_builder.rb +22 -0
  43. data/lib/watir-webdriver/locators/text_field/locator.rb +42 -0
  44. data/lib/watir-webdriver/locators/text_field/selector_builder.rb +34 -0
  45. data/lib/watir-webdriver/locators/text_field/selector_builder/xpath.rb +19 -0
  46. data/lib/watir-webdriver/locators/text_field/validator.rb +20 -0
  47. data/lib/watir-webdriver/row_container.rb +3 -9
  48. data/lib/watir-webdriver/version.rb +1 -1
  49. data/lib/watir-webdriver/wait.rb +6 -3
  50. data/spec/always_locate_spec.rb +2 -1
  51. data/spec/element_locator_spec.rb +1 -1
  52. data/spec/element_spec.rb +8 -40
  53. data/spec/implementation.rb +52 -45
  54. data/spec/locator_spec_helper.rb +8 -2
  55. data/support/travis.sh +17 -6
  56. metadata +25 -10
  57. data/lib/watir-webdriver/locators/button_locator.rb +0 -85
  58. data/lib/watir-webdriver/locators/child_cell_locator.rb +0 -32
  59. data/lib/watir-webdriver/locators/child_row_locator.rb +0 -37
  60. data/lib/watir-webdriver/locators/element_locator.rb +0 -470
  61. data/lib/watir-webdriver/locators/text_area_locator.rb +0 -24
  62. data/lib/watir-webdriver/locators/text_field_locator.rb +0 -93
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69667d301519d6ffd4340fe0187d9989d72cd0b5
4
- data.tar.gz: 27ec93300295d47e1334fe0a92be7d40fceb9811
3
+ metadata.gz: d1f54118bae04cf0d3fa63789d3e497c44598568
4
+ data.tar.gz: 577b5480be284ed6fb2872faf741e5dc657fe81f
5
5
  SHA512:
6
- metadata.gz: 103bf16805460dd31e2e2c2151701c1eaaac607544868879a3e77ed83c85aa96b143d46d398355cca5eb024a5d16173bd7d05c7ac2a41bdb609de140c8ab6d1d
7
- data.tar.gz: fac256f75d40768e6df698add77dbc0032cad9a48b3ef4f2878824e9c807c6c92b12ce137be68ec4a4aeddd6adb15a3ab85d0f8e81e651afc6f8de3eb6b05998
6
+ metadata.gz: 720bbaa5c0629b2dbd845b336b9870d1cf48bc659ee3c5bd2ed7e83104d65141c80da02f327f6d0cb68a515ce534629a3c772a7454dc9a4faff201a10ece6866
7
+ data.tar.gz: d3d4c44c25c95ba661ed233c9c11f2b032019a45b89c7aa61352ea56d9da2c06b7e45a6636f39b813ef7058e20c1d55c1b5114cb0920b46c392dc97327763b45
data/.gitignore CHANGED
@@ -16,3 +16,6 @@ support/svg.html
16
16
  /doc
17
17
  .idea
18
18
  .ruby-version
19
+ .envrc
20
+ .projections.json
21
+ bin/
@@ -1,8 +1,8 @@
1
1
  sudo: false
2
2
  rvm:
3
- - 2.0
4
3
  - 2.1
5
4
  - 2.2
5
+ - 2.3.0
6
6
  addons:
7
7
  apt:
8
8
  packages:
@@ -14,8 +14,12 @@ notifications:
14
14
  - p0deje@gmail.com
15
15
  - jarmo.p@gmail.com
16
16
  - titusfortner@gmail.com
17
- irc: "irc.freenode.net#watir"
18
- before_script: support/travis.sh
17
+ slack:
18
+ secure: BLsBCm33R32VNRccrLx9F0P24X6BVpVHj1OWaN4Kyn6g9qXteIwC2VKVMnKNbifpojfMkrn0OeFQFK1O1DSOsC3mgzn/udoB+DnUGcSemFUn04xhbYF5SI+3zGPKPo0JLvjjdEKSSma84YwKdrj88pGUK34p01gL8hiaqjFzWdk=
19
+ before_script:
20
+ - mkdir travis-phantomjs
21
+ - export PATH=$PWD/travis-phantomjs:$PATH
22
+ - support/travis.sh
19
23
  script: bundle exec rake $RAKE_TASK
20
24
  env:
21
25
  - RAKE_TASK=spec:firefox
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.9.2 (2016-07-29)
2
+
3
+ * Massive reorganization and refactoring of element locators (#392)
4
+ * Fix bug with when_present (#432)
5
+ * Bug fix for elements in collections going stale
6
+
1
7
  ### 0.9.1 (2015-10-14)
2
8
 
3
9
  * Fix permissions issue with element_locator file(#381)
data/Rakefile CHANGED
@@ -126,19 +126,31 @@ namespace :spec do
126
126
  require 'selenium-webdriver'
127
127
 
128
128
  desc 'Run specs in all browsers'
129
- task all_browsers: [:firefox,
130
- :firefox_nightly,
131
- :chrome,
129
+ task all_browsers: [:chrome,
130
+ :firefox,
131
+ :phantomjs,
132
+ :remote_chrome,
133
+ :remote_firefox,
134
+ :remote_phantomjs,
132
135
  (:safari if Selenium::WebDriver::Platform.os == :macosx),
136
+ (:remote_safari if Selenium::WebDriver::Platform.os == :macosx),
133
137
  (:ie if Selenium::WebDriver::Platform.os == :windows),
138
+ (:remote_ie if Selenium::WebDriver::Platform.os == :windows),
134
139
  (:edge if Selenium::WebDriver::Platform.os == :windows),
135
- :phantomjs].compact
140
+ (:remote_edge if Selenium::WebDriver::Platform.os == :windows)].compact
136
141
 
137
- %w(firefox firefox_nightly chrome safari phantomjs ie edge).each do |browser|
142
+ %w(firefox marionette chrome safari phantomjs ie edge).each do |browser|
138
143
  desc "Run specs in #{browser}"
139
144
  task browser do
140
145
  ENV['WATIR_WEBDRIVER_BROWSER'] = browser
141
146
  Rake::Task['spec'].execute
142
147
  end
148
+
149
+ desc "Run specs in Remote #{browser}"
150
+ task "remote_#{browser}" do
151
+ ENV['WATIR_WEBDRIVER_BROWSER'] = 'remote'
152
+ ENV['REMOTE_BROWSER'] = browser
153
+ Rake::Task['spec'].execute
154
+ end
143
155
  end
144
156
  end
@@ -10,12 +10,6 @@ require 'watir-webdriver/alert'
10
10
  require 'watir-webdriver/atoms'
11
11
  require 'watir-webdriver/container'
12
12
  require 'watir-webdriver/cookies'
13
- require 'watir-webdriver/locators/element_locator'
14
- require 'watir-webdriver/locators/button_locator'
15
- require 'watir-webdriver/locators/text_area_locator'
16
- require 'watir-webdriver/locators/text_field_locator'
17
- require 'watir-webdriver/locators/child_row_locator'
18
- require 'watir-webdriver/locators/child_cell_locator'
19
13
  require 'watir-webdriver/browser'
20
14
  require 'watir-webdriver/screenshot'
21
15
  require 'watir-webdriver/after_hooks'
@@ -62,6 +56,19 @@ module Watir
62
56
  @prefer_css = bool
63
57
  end
64
58
 
59
+ def locator_namespace
60
+ @locator_namespace ||= Watir::Locators
61
+ end
62
+
63
+ #
64
+ # Whether the locators should be used from a different namespace.
65
+ # Defaults to Watir::Locators.
66
+ #
67
+
68
+ def locator_namespace=(mod)
69
+ @locator_namespace = mod
70
+ end
71
+
65
72
  #
66
73
  # @api private
67
74
  #
@@ -93,6 +100,7 @@ require 'watir-webdriver/elements/svg_elements'
93
100
 
94
101
  require 'watir-webdriver/elements/area'
95
102
  require 'watir-webdriver/elements/button'
103
+ require 'watir-webdriver/elements/cell'
96
104
  require 'watir-webdriver/elements/checkbox'
97
105
  require 'watir-webdriver/elements/dlist'
98
106
  require 'watir-webdriver/elements/file_field'
@@ -105,6 +113,7 @@ require 'watir-webdriver/elements/input'
105
113
  require 'watir-webdriver/elements/link'
106
114
  require 'watir-webdriver/elements/option'
107
115
  require 'watir-webdriver/elements/radio'
116
+ require 'watir-webdriver/elements/row'
108
117
  require 'watir-webdriver/elements/select'
109
118
  require 'watir-webdriver/elements/table'
110
119
  require 'watir-webdriver/elements/table_cell'
@@ -113,6 +122,7 @@ require 'watir-webdriver/elements/table_section'
113
122
  require 'watir-webdriver/elements/text_area'
114
123
  require 'watir-webdriver/elements/text_field'
115
124
 
125
+ require 'watir-webdriver/locators'
116
126
  require 'watir-webdriver/aliases'
117
127
 
118
128
  Watir.tag_to_class.freeze
@@ -25,7 +25,7 @@ module Watir
25
25
  # browser.after_hooks.add do |browser|
26
26
  # browser.text.include?("Server Error") and puts "Application exception or 500 error!"
27
27
  # end
28
- # browser.goto "www.watir.com/404"
28
+ # browser.goto "watir.github.io/404"
29
29
  # "Application exception or 500 error!"
30
30
  #
31
31
  # @param [#call] after_hook Object responding to call
@@ -51,7 +51,7 @@ module Watir
51
51
  # browser.after_hooks.add do |browser|
52
52
  # browser.text.include?("Server Error") and puts "Application exception or 500 error!"
53
53
  # end
54
- # browser.goto "www.watir.com/404"
54
+ # browser.goto "watir.github.io/404"
55
55
  # "Application exception or 500 error!"
56
56
  # browser.after_hooks.delete browser.after_hooks[0]
57
57
  # browser.refresh
@@ -65,7 +65,7 @@ module Watir
65
65
  # Goes to the given URL.
66
66
  #
67
67
  # @example
68
- # browser.goto "www.watir.com"
68
+ # browser.goto "watir.github.io"
69
69
  #
70
70
  # @param [String] uri The url.
71
71
  # @return [String] The url you end up at.
@@ -100,9 +100,9 @@ module Watir
100
100
  # Returns URL of current page.
101
101
  #
102
102
  # @example
103
- # browser.goto "www.watir.com"
103
+ # browser.goto "watir.github.io"
104
104
  # browser.url
105
- # #=> "http://watir.com/"
105
+ # #=> "http://watir.github.io/"
106
106
  #
107
107
  # @return [String]
108
108
  #
@@ -116,9 +116,9 @@ module Watir
116
116
  # Returns title of current page.
117
117
  #
118
118
  # @example
119
- # browser.goto "www.watir.com"
119
+ # browser.goto "watir.github.io"
120
120
  # browser.title
121
- # #=> "Watir.com | Web Application Testing in Ruby"
121
+ # #=> "Watir is... – Watir Project – Watir stands for Web Application Testing In Ruby. It facilitates the writing of automated tests by mimicking the behavior of a user interacting with a website."
122
122
  #
123
123
  # @return [String]
124
124
  #
@@ -4,27 +4,21 @@ module Watir
4
4
  #
5
5
  # Returns table cell.
6
6
  #
7
- # @return [TableCell]
7
+ # @return [Cell]
8
8
  #
9
9
 
10
10
  def cell(*args)
11
- cell = TableCell.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
12
- cell.locator_class = ChildCellLocator
13
-
14
- cell
11
+ Cell.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
15
12
  end
16
13
 
17
14
  #
18
15
  # Returns table cells collection.
19
16
  #
20
- # @return [TableCell]
17
+ # @return [Cell]
21
18
  #
22
19
 
23
20
  def cells(*args)
24
- cells = TableCellCollection.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
25
- cells.locator_class = ChildCellLocator
26
-
27
- cells
21
+ CellCollection.new(self, extract_selector(args).merge(tag_name: /^(th|td)$/))
28
22
  end
29
23
 
30
24
  end # CellContainer
@@ -89,16 +89,37 @@ module Watir
89
89
  def elements
90
90
  @parent.is_a?(IFrame) ? @parent.switch_to! : @parent.send(:assert_exists)
91
91
 
92
- @elements ||= locator_class.new(
93
- @parent.wd,
94
- @selector,
95
- element_class.attribute_list
96
- ).locate_all
92
+ element_validator = element_validator_class.new
93
+ selector_builder = selector_builder_class.new(@parent, @selector, element_class.attribute_list)
94
+ locator = locator_class.new(@parent, @selector, selector_builder, element_validator)
95
+
96
+ @elements ||= locator.locate_all
97
97
  end
98
98
 
99
- # overridable by subclasses
100
99
  def locator_class
101
- ElementLocator
100
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::Locator")
101
+ rescue NameError
102
+ Kernel.const_get("#{Watir.locator_namespace}::Element::Locator")
103
+ end
104
+
105
+ def element_validator_class
106
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::Validator")
107
+ rescue NameError
108
+ Kernel.const_get("#{Watir.locator_namespace}::Element::Validator")
109
+ end
110
+
111
+ def selector_builder_class
112
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::SelectorBuilder")
113
+ rescue NameError
114
+ Kernel.const_get("#{Watir.locator_namespace}::Element::SelectorBuilder")
115
+ end
116
+
117
+ def element_class_name
118
+ element_class.to_s.split('::').last
119
+ end
120
+
121
+ def element_class
122
+ Kernel.const_get(self.class.name.sub(/Collection$/, ''))
102
123
  end
103
124
 
104
125
  end # ElementCollection
@@ -33,23 +33,5 @@ module Watir
33
33
  raise Exception::Error, "unknown tag name for button: #{tn}"
34
34
  end
35
35
  end
36
-
37
- private
38
-
39
- def locator_class
40
- ButtonLocator
41
- end
42
36
  end # Button
43
-
44
- class ButtonCollection < ElementCollection
45
- private
46
-
47
- def locator_class
48
- ButtonLocator
49
- end
50
-
51
- def element_class
52
- Button
53
- end
54
- end # ButtonsCollection
55
37
  end # Watir
@@ -0,0 +1,17 @@
1
+ module Watir
2
+
3
+ #
4
+ # Custom class representing table cell (th or td).
5
+ #
6
+
7
+ class Cell < TableCell
8
+ end # Cell
9
+
10
+ class CellCollection < TableCellCollection
11
+ def elements
12
+ # we do this craziness since the xpath used will find direct child rows
13
+ # before any rows inside thead/tbody/tfoot...
14
+ super.sort_by { |e| e.attribute(:cellIndex).to_i }
15
+ end
16
+ end
17
+ end # Watir
@@ -50,8 +50,5 @@ module Watir
50
50
  end # Container
51
51
 
52
52
  class CheckBoxCollection < InputCollection
53
- def element_class
54
- CheckBox
55
- end
56
53
  end # CheckBoxCollection
57
54
  end # Watir
@@ -434,7 +434,7 @@ module Watir
434
434
  #
435
435
  # @example
436
436
  # browser.button(value: "Delete").style #=> "border: 4px solid red;"
437
- # browser.button(value: "Delete").style("border") #=> "4px solid red"
437
+ # browser.button(value: "Delete").style("border") #=> "4px solid rgb(255, 0, 0)"
438
438
  #
439
439
  # @param [String] property
440
440
  # @return [String]
@@ -493,7 +493,7 @@ module Watir
493
493
  @parent.browser
494
494
  end
495
495
 
496
- protected
496
+ protected
497
497
 
498
498
  # Ensure that the element exists, making sure that it is not stale and located if necessary
499
499
  def assert_exists
@@ -543,13 +543,36 @@ module Watir
543
543
 
544
544
  def locate
545
545
  ensure_context
546
- locator_class.new(@parent.wd, @selector, self.class.attribute_list).locate
546
+
547
+ element_validator = element_validator_class.new
548
+ selector_builder = selector_builder_class.new(@parent, @selector, self.class.attribute_list)
549
+ locator = locator_class.new(@parent, @selector, selector_builder, element_validator)
550
+
551
+ locator.locate
547
552
  end
548
553
 
549
- private
554
+ private
550
555
 
551
556
  def locator_class
552
- ElementLocator
557
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::Locator")
558
+ rescue NameError
559
+ Kernel.const_get("#{Watir.locator_namespace}::Element::Locator")
560
+ end
561
+
562
+ def element_validator_class
563
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::Validator")
564
+ rescue NameError
565
+ Kernel.const_get("#{Watir.locator_namespace}::Element::Validator")
566
+ end
567
+
568
+ def selector_builder_class
569
+ Kernel.const_get("#{Watir.locator_namespace}::#{element_class_name}::SelectorBuilder")
570
+ rescue NameError
571
+ Kernel.const_get("#{Watir.locator_namespace}::Element::SelectorBuilder")
572
+ end
573
+
574
+ def element_class_name
575
+ self.class.name.split('::').last
553
576
  end
554
577
 
555
578
  def selector_string
@@ -597,22 +620,26 @@ module Watir
597
620
  def element_call
598
621
  yield
599
622
  rescue Selenium::WebDriver::Error::StaleElementReferenceError
600
- raise unless Watir.always_locate?
601
- assert_exists
623
+ if Watir.always_locate? && !@selector[:element]
624
+ @element = locate
625
+ else
626
+ reset!
627
+ end
628
+ assert_element_found
602
629
  retry
603
630
  end
604
631
 
605
632
  def method_missing(meth, *args, &blk)
606
633
  method = meth.to_s
607
- if method =~ ElementLocator::WILDCARD_ATTRIBUTE
608
- attribute_value(method.gsub(/_/, '-'), *args)
634
+ if method =~ Locators::Element::SelectorBuilder::WILDCARD_ATTRIBUTE
635
+ attribute_value(method.tr('_', '-'), *args)
609
636
  else
610
637
  super
611
638
  end
612
639
  end
613
640
 
614
641
  def respond_to_missing?(meth, *)
615
- ElementLocator::WILDCARD_ATTRIBUTE === meth.to_s || super
642
+ Locators::Element::SelectorBuilder::WILDCARD_ATTRIBUTE === meth.to_s || super
616
643
  end
617
644
 
618
645
  end # Element
@@ -37,8 +37,5 @@ module Watir
37
37
  end # Container
38
38
 
39
39
  class FileFieldCollection < InputCollection
40
- def element_class
41
- FileField
42
- end
43
40
  end # FileFieldCollection
44
41
  end # Watir
@@ -16,8 +16,5 @@ module Watir
16
16
  end # Container
17
17
 
18
18
  class HiddenCollection < InputCollection
19
- def element_class
20
- Hidden
21
- end
22
19
  end # HiddenCollection
23
20
  end
@@ -94,9 +94,6 @@ module Watir
94
94
  attribute("Boolean", :content_editable?, :isContentEditable)
95
95
  end
96
96
  class HTMLElementCollection < ElementCollection
97
- def element_class
98
- HTMLElement
99
- end
100
97
  end
101
98
 
102
99
  class Font < HTMLElement
@@ -105,18 +102,12 @@ module Watir
105
102
  attribute(String, :size, :size)
106
103
  end
107
104
  class FontCollection < ElementCollection
108
- def element_class
109
- Font
110
- end
111
105
  end
112
106
 
113
107
  class Directory < HTMLElement
114
108
  attribute("Boolean", :compact?, :compact)
115
109
  end
116
110
  class DirectoryCollection < ElementCollection
117
- def element_class
118
- Directory
119
- end
120
111
  end
121
112
 
122
113
  class FrameSet < HTMLElement
@@ -136,9 +127,6 @@ module Watir
136
127
  attribute(String, :onunload, :onunload)
137
128
  end
138
129
  class FrameSetCollection < ElementCollection
139
- def element_class
140
- FrameSet
141
- end
142
130
  end
143
131
 
144
132
  class Marquee < HTMLElement
@@ -158,9 +146,6 @@ module Watir
158
146
  attribute(String, :onstart, :onstart)
159
147
  end
160
148
  class MarqueeCollection < ElementCollection
161
- def element_class
162
- Marquee
163
- end
164
149
  end
165
150
 
166
151
  class Applet < HTMLElement
@@ -177,9 +162,6 @@ module Watir
177
162
  attribute(String, :width, :width)
178
163
  end
179
164
  class AppletCollection < ElementCollection
180
- def element_class
181
- Applet
182
- end
183
165
  end
184
166
 
185
167
  class Canvas < HTMLElement
@@ -187,18 +169,12 @@ module Watir
187
169
  attribute(Fixnum, :height, :height)
188
170
  end
189
171
  class CanvasCollection < ElementCollection
190
- def element_class
191
- Canvas
192
- end
193
172
  end
194
173
 
195
174
  class Template < HTMLElement
196
175
  attribute(String, :content, :content)
197
176
  end
198
177
  class TemplateCollection < ElementCollection
199
- def element_class
200
- Template
201
- end
202
178
  end
203
179
 
204
180
  class Script < HTMLElement
@@ -212,9 +188,6 @@ module Watir
212
188
  attribute(String, :for, :htmlFor)
213
189
  end
214
190
  class ScriptCollection < ElementCollection
215
- def element_class
216
- Script
217
- end
218
191
  end
219
192
 
220
193
  class Dialog < HTMLElement
@@ -222,9 +195,6 @@ module Watir
222
195
  attribute(String, :return_value, :returnValue)
223
196
  end
224
197
  class DialogCollection < ElementCollection
225
- def element_class
226
- Dialog
227
- end
228
198
  end
229
199
 
230
200
  class MenuItem < HTMLElement
@@ -238,9 +208,6 @@ module Watir
238
208
  attribute(String, :command, :command)
239
209
  end
240
210
  class MenuItemCollection < ElementCollection
241
- def element_class
242
- MenuItem
243
- end
244
211
  end
245
212
 
246
213
  class Menu < HTMLElement
@@ -249,18 +216,12 @@ module Watir
249
216
  attribute("Boolean", :compact?, :compact)
250
217
  end
251
218
  class MenuCollection < ElementCollection
252
- def element_class
253
- Menu
254
- end
255
219
  end
256
220
 
257
221
  class Details < HTMLElement
258
222
  attribute("Boolean", :open?, :open)
259
223
  end
260
224
  class DetailsCollection < ElementCollection
261
- def element_class
262
- Details
263
- end
264
225
  end
265
226
 
266
227
  class Legend < HTMLElement
@@ -268,9 +229,6 @@ module Watir
268
229
  attribute(String, :align, :align)
269
230
  end
270
231
  class LegendCollection < ElementCollection
271
- def element_class
272
- Legend
273
- end
274
232
  end
275
233
 
276
234
  class FieldSet < HTMLElement
@@ -283,9 +241,6 @@ module Watir
283
241
  attribute(String, :validation_message, :validationMessage)
284
242
  end
285
243
  class FieldSetCollection < ElementCollection
286
- def element_class
287
- FieldSet
288
- end
289
244
  end
290
245
 
291
246
  class Meter < HTMLElement
@@ -298,9 +253,6 @@ module Watir
298
253
  attribute(String, :labels, :labels)
299
254
  end
300
255
  class MeterCollection < ElementCollection
301
- def element_class
302
- Meter
303
- end
304
256
  end
305
257
 
306
258
  class Progress < HTMLElement
@@ -310,9 +262,6 @@ module Watir
310
262
  attribute(String, :labels, :labels)
311
263
  end
312
264
  class ProgressCollection < ElementCollection
313
- def element_class
314
- Progress
315
- end
316
265
  end
317
266
 
318
267
  class Output < HTMLElement
@@ -328,9 +277,6 @@ module Watir
328
277
  attribute(String, :labels, :labels)
329
278
  end
330
279
  class OutputCollection < ElementCollection
331
- def element_class
332
- Output
333
- end
334
280
  end
335
281
 
336
282
  class Keygen < HTMLElement
@@ -347,9 +293,6 @@ module Watir
347
293
  attribute(String, :labels, :labels)
348
294
  end
349
295
  class KeygenCollection < ElementCollection
350
- def element_class
351
- Keygen
352
- end
353
296
  end
354
297
 
355
298
  class TextArea < HTMLElement
@@ -380,9 +323,6 @@ module Watir
380
323
  attribute(String, :selection_direction, :selectionDirection)
381
324
  end
382
325
  class TextAreaCollection < ElementCollection
383
- def element_class
384
- TextArea
385
- end
386
326
  end
387
327
 
388
328
  class Option < HTMLElement
@@ -395,9 +335,6 @@ module Watir
395
335
  attribute(Fixnum, :index, :index)
396
336
  end
397
337
  class OptionCollection < ElementCollection
398
- def element_class
399
- Option
400
- end
401
338
  end
402
339
 
403
340
  class OptGroup < HTMLElement
@@ -405,18 +342,12 @@ module Watir
405
342
  attribute(String, :label, :label)
406
343
  end
407
344
  class OptGroupCollection < ElementCollection
408
- def element_class
409
- OptGroup
410
- end
411
345
  end
412
346
 
413
347
  class DataList < HTMLElement
414
348
  attribute(String, :options, :options)
415
349
  end
416
350
  class DataListCollection < ElementCollection
417
- def element_class
418
- DataList
419
- end
420
351
  end
421
352
 
422
353
  class Select < HTMLElement
@@ -440,9 +371,6 @@ module Watir
440
371
  attribute(String, :labels, :labels)
441
372
  end
442
373
  class SelectCollection < ElementCollection
443
- def element_class
444
- Select
445
- end
446
374
  end
447
375
 
448
376
  class Button < HTMLElement
@@ -464,9 +392,6 @@ module Watir
464
392
  attribute(String, :labels, :labels)
465
393
  end
466
394
  class ButtonCollection < ElementCollection
467
- def element_class
468
- Button
469
- end
470
395
  end
471
396
 
472
397
  class Input < HTMLElement
@@ -521,9 +446,6 @@ module Watir
521
446
  attribute(String, :use_map, :useMap)
522
447
  end
523
448
  class InputCollection < ElementCollection
524
- def element_class
525
- Input
526
- end
527
449
  end
528
450
 
529
451
  class Label < HTMLElement
@@ -532,9 +454,6 @@ module Watir
532
454
  attribute(String, :control, :control)
533
455
  end
534
456
  class LabelCollection < ElementCollection
535
- def element_class
536
- Label
537
- end
538
457
  end
539
458
 
540
459
  class Form < HTMLElement
@@ -550,9 +469,6 @@ module Watir
550
469
  attribute(Fixnum, :length, :length)
551
470
  end
552
471
  class FormCollection < ElementCollection
553
- def element_class
554
- Form
555
- end
556
472
  end
557
473
 
558
474
  class TableCell < HTMLElement
@@ -571,9 +487,6 @@ module Watir
571
487
  attribute(String, :bg_color, :bgColor)
572
488
  end
573
489
  class TableCellCollection < ElementCollection
574
- def element_class
575
- TableCell
576
- end
577
490
  end
578
491
 
579
492
  class TableHeaderCell < TableCell
@@ -582,18 +495,12 @@ module Watir
582
495
  attribute(String, :sorted, :sorted)
583
496
  end
584
497
  class TableHeaderCellCollection < ElementCollection
585
- def element_class
586
- TableHeaderCell
587
- end
588
498
  end
589
499
 
590
500
  class TableDataCell < TableCell
591
501
  attribute(String, :abbr, :abbr)
592
502
  end
593
503
  class TableDataCellCollection < ElementCollection
594
- def element_class
595
- TableDataCell
596
- end
597
504
  end
598
505
 
599
506
  class TableRow < HTMLElement
@@ -606,9 +513,6 @@ module Watir
606
513
  attribute(String, :bg_color, :bgColor)
607
514
  end
608
515
  class TableRowCollection < ElementCollection
609
- def element_class
610
- TableRow
611
- end
612
516
  end
613
517
 
614
518
  class TableSection < HTMLElement
@@ -618,9 +522,6 @@ module Watir
618
522
  attribute(String, :v_align, :vAlign)
619
523
  end
620
524
  class TableSectionCollection < ElementCollection
621
- def element_class
622
- TableSection
623
- end
624
525
  end
625
526
 
626
527
  class TableCol < HTMLElement
@@ -631,18 +532,12 @@ module Watir
631
532
  attribute(String, :width, :width)
632
533
  end
633
534
  class TableColCollection < ElementCollection
634
- def element_class
635
- TableCol
636
- end
637
535
  end
638
536
 
639
537
  class TableCaption < HTMLElement
640
538
  attribute(String, :align, :align)
641
539
  end
642
540
  class TableCaptionCollection < ElementCollection
643
- def element_class
644
- TableCaption
645
- end
646
541
  end
647
542
 
648
543
  class Table < HTMLElement
@@ -662,9 +557,6 @@ module Watir
662
557
  attribute(String, :cell_spacing, :cellSpacing)
663
558
  end
664
559
  class TableCollection < ElementCollection
665
- def element_class
666
- Table
667
- end
668
560
  end
669
561
 
670
562
  class Area < HTMLElement
@@ -681,9 +573,6 @@ module Watir
681
573
  attribute("Boolean", :no_href?, :noHref)
682
574
  end
683
575
  class AreaCollection < ElementCollection
684
- def element_class
685
- Area
686
- end
687
576
  end
688
577
 
689
578
  class Map < HTMLElement
@@ -692,9 +581,6 @@ module Watir
692
581
  attribute(String, :images, :images)
693
582
  end
694
583
  class MapCollection < ElementCollection
695
- def element_class
696
- Map
697
- end
698
584
  end
699
585
 
700
586
  class Media < HTMLElement
@@ -729,17 +615,11 @@ module Watir
729
615
  attribute(String, :text_tracks, :textTracks)
730
616
  end
731
617
  class MediaCollection < ElementCollection
732
- def element_class
733
- Media
734
- end
735
618
  end
736
619
 
737
620
  class Audio < Media
738
621
  end
739
622
  class AudioCollection < ElementCollection
740
- def element_class
741
- Audio
742
- end
743
623
  end
744
624
 
745
625
  class Video < Media
@@ -750,9 +630,6 @@ module Watir
750
630
  attribute(String, :poster, :poster)
751
631
  end
752
632
  class VideoCollection < ElementCollection
753
- def element_class
754
- Video
755
- end
756
633
  end
757
634
 
758
635
  class Track < HTMLElement
@@ -765,9 +642,6 @@ module Watir
765
642
  attribute(String, :track, :track)
766
643
  end
767
644
  class TrackCollection < ElementCollection
768
- def element_class
769
- Track
770
- end
771
645
  end
772
646
 
773
647
  class Param < HTMLElement
@@ -777,9 +651,6 @@ module Watir
777
651
  attribute(String, :value_type, :valueType)
778
652
  end
779
653
  class ParamCollection < ElementCollection
780
- def element_class
781
- Param
782
- end
783
654
  end
784
655
 
785
656
  class Object < HTMLElement
@@ -808,9 +679,6 @@ module Watir
808
679
  attribute(String, :border, :border)
809
680
  end
810
681
  class ObjectCollection < ElementCollection
811
- def element_class
812
- Object
813
- end
814
682
  end
815
683
 
816
684
  class Embed < HTMLElement
@@ -822,9 +690,6 @@ module Watir
822
690
  attribute(String, :name, :name)
823
691
  end
824
692
  class EmbedCollection < ElementCollection
825
- def element_class
826
- Embed
827
- end
828
693
  end
829
694
 
830
695
  class IFrame < HTMLElement
@@ -846,9 +711,6 @@ module Watir
846
711
  attribute(String, :margin_width, :marginWidth)
847
712
  end
848
713
  class IFrameCollection < ElementCollection
849
- def element_class
850
- IFrame
851
- end
852
714
  end
853
715
 
854
716
  class Image < HTMLElement
@@ -874,9 +736,6 @@ module Watir
874
736
  attribute(String, :border, :border)
875
737
  end
876
738
  class ImageCollection < ElementCollection
877
- def element_class
878
- Image
879
- end
880
739
  end
881
740
 
882
741
  class Source < HTMLElement
@@ -887,17 +746,11 @@ module Watir
887
746
  attribute(String, :type, :type)
888
747
  end
889
748
  class SourceCollection < ElementCollection
890
- def element_class
891
- Source
892
- end
893
749
  end
894
750
 
895
751
  class Picture < HTMLElement
896
752
  end
897
753
  class PictureCollection < ElementCollection
898
- def element_class
899
- Picture
900
- end
901
754
  end
902
755
 
903
756
  class Mod < HTMLElement
@@ -905,44 +758,29 @@ module Watir
905
758
  attribute(String, :date_time, :dateTime)
906
759
  end
907
760
  class ModCollection < ElementCollection
908
- def element_class
909
- Mod
910
- end
911
761
  end
912
762
 
913
763
  class BR < HTMLElement
914
764
  attribute(String, :clear, :clear)
915
765
  end
916
766
  class BRCollection < ElementCollection
917
- def element_class
918
- BR
919
- end
920
767
  end
921
768
 
922
769
  class Span < HTMLElement
923
770
  end
924
771
  class SpanCollection < ElementCollection
925
- def element_class
926
- Span
927
- end
928
772
  end
929
773
 
930
774
  class Time < HTMLElement
931
775
  attribute(String, :date_time, :dateTime)
932
776
  end
933
777
  class TimeCollection < ElementCollection
934
- def element_class
935
- Time
936
- end
937
778
  end
938
779
 
939
780
  class Data < HTMLElement
940
781
  attribute(String, :value, :value)
941
782
  end
942
783
  class DataCollection < ElementCollection
943
- def element_class
944
- Data
945
- end
946
784
  end
947
785
 
948
786
  class Anchor < HTMLElement
@@ -960,27 +798,18 @@ module Watir
960
798
  attribute(String, :shape, :shape)
961
799
  end
962
800
  class AnchorCollection < ElementCollection
963
- def element_class
964
- Anchor
965
- end
966
801
  end
967
802
 
968
803
  class Div < HTMLElement
969
804
  attribute(String, :align, :align)
970
805
  end
971
806
  class DivCollection < ElementCollection
972
- def element_class
973
- Div
974
- end
975
807
  end
976
808
 
977
809
  class DList < HTMLElement
978
810
  attribute("Boolean", :compact?, :compact)
979
811
  end
980
812
  class DListCollection < ElementCollection
981
- def element_class
982
- DList
983
- end
984
813
  end
985
814
 
986
815
  class LI < HTMLElement
@@ -988,9 +817,6 @@ module Watir
988
817
  attribute(String, :type, :type)
989
818
  end
990
819
  class LICollection < ElementCollection
991
- def element_class
992
- LI
993
- end
994
820
  end
995
821
 
996
822
  class UList < HTMLElement
@@ -998,9 +824,6 @@ module Watir
998
824
  attribute(String, :type, :type)
999
825
  end
1000
826
  class UListCollection < ElementCollection
1001
- def element_class
1002
- UList
1003
- end
1004
827
  end
1005
828
 
1006
829
  class OList < HTMLElement
@@ -1010,27 +833,18 @@ module Watir
1010
833
  attribute("Boolean", :compact?, :compact)
1011
834
  end
1012
835
  class OListCollection < ElementCollection
1013
- def element_class
1014
- OList
1015
- end
1016
836
  end
1017
837
 
1018
838
  class Quote < HTMLElement
1019
839
  attribute(String, :cite, :cite)
1020
840
  end
1021
841
  class QuoteCollection < ElementCollection
1022
- def element_class
1023
- Quote
1024
- end
1025
842
  end
1026
843
 
1027
844
  class Pre < HTMLElement
1028
845
  attribute(Fixnum, :width, :width)
1029
846
  end
1030
847
  class PreCollection < ElementCollection
1031
- def element_class
1032
- Pre
1033
- end
1034
848
  end
1035
849
 
1036
850
  class HR < HTMLElement
@@ -1041,27 +855,18 @@ module Watir
1041
855
  attribute(String, :width, :width)
1042
856
  end
1043
857
  class HRCollection < ElementCollection
1044
- def element_class
1045
- HR
1046
- end
1047
858
  end
1048
859
 
1049
860
  class Paragraph < HTMLElement
1050
861
  attribute(String, :align, :align)
1051
862
  end
1052
863
  class ParagraphCollection < ElementCollection
1053
- def element_class
1054
- Paragraph
1055
- end
1056
864
  end
1057
865
 
1058
866
  class Heading < HTMLElement
1059
867
  attribute(String, :align, :align)
1060
868
  end
1061
869
  class HeadingCollection < ElementCollection
1062
- def element_class
1063
- Heading
1064
- end
1065
870
  end
1066
871
 
1067
872
  class Body < HTMLElement
@@ -1085,9 +890,6 @@ module Watir
1085
890
  attribute(String, :onunload, :onunload)
1086
891
  end
1087
892
  class BodyCollection < ElementCollection
1088
- def element_class
1089
- Body
1090
- end
1091
893
  end
1092
894
 
1093
895
  class Style < HTMLElement
@@ -1096,9 +898,6 @@ module Watir
1096
898
  attribute("Boolean", :scoped?, :scoped)
1097
899
  end
1098
900
  class StyleCollection < ElementCollection
1099
- def element_class
1100
- Style
1101
- end
1102
901
  end
1103
902
 
1104
903
  class Meta < HTMLElement
@@ -1108,9 +907,6 @@ module Watir
1108
907
  attribute(String, :scheme, :scheme)
1109
908
  end
1110
909
  class MetaCollection < ElementCollection
1111
- def element_class
1112
- Meta
1113
- end
1114
910
  end
1115
911
 
1116
912
  class Base < HTMLElement
@@ -1118,42 +914,27 @@ module Watir
1118
914
  attribute(String, :target, :target)
1119
915
  end
1120
916
  class BaseCollection < ElementCollection
1121
- def element_class
1122
- Base
1123
- end
1124
917
  end
1125
918
 
1126
919
  class Title < HTMLElement
1127
920
  end
1128
921
  class TitleCollection < ElementCollection
1129
- def element_class
1130
- Title
1131
- end
1132
922
  end
1133
923
 
1134
924
  class Head < HTMLElement
1135
925
  end
1136
926
  class HeadCollection < ElementCollection
1137
- def element_class
1138
- Head
1139
- end
1140
927
  end
1141
928
 
1142
929
  class Html < HTMLElement
1143
930
  attribute(String, :version, :version)
1144
931
  end
1145
932
  class HtmlCollection < ElementCollection
1146
- def element_class
1147
- Html
1148
- end
1149
933
  end
1150
934
 
1151
935
  class Unknown < HTMLElement
1152
936
  end
1153
937
  class UnknownCollection < ElementCollection
1154
- def element_class
1155
- Unknown
1156
- end
1157
938
  end
1158
939
 
1159
940