watir-webdriver 0.0.1.dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. data/.document +5 -0
  2. data/.gitignore +5 -0
  3. data/.gitmodules +3 -0
  4. data/LICENSE +20 -0
  5. data/README.rdoc +32 -0
  6. data/Rakefile +107 -0
  7. data/TODO +15 -0
  8. data/VERSION +1 -0
  9. data/lib/watir-webdriver.rb +74 -0
  10. data/lib/watir-webdriver/base_element.rb +347 -0
  11. data/lib/watir-webdriver/browser.rb +130 -0
  12. data/lib/watir-webdriver/browserbot.js +34 -0
  13. data/lib/watir-webdriver/collections/buttons_collection.rb +13 -0
  14. data/lib/watir-webdriver/collections/element_collection.rb +45 -0
  15. data/lib/watir-webdriver/collections/table_rows_collection.rb +14 -0
  16. data/lib/watir-webdriver/collections/text_fields_collection.rb +13 -0
  17. data/lib/watir-webdriver/container.rb +24 -0
  18. data/lib/watir-webdriver/core_ext/string.rb +22 -0
  19. data/lib/watir-webdriver/elements/button.rb +27 -0
  20. data/lib/watir-webdriver/elements/checkbox.rb +23 -0
  21. data/lib/watir-webdriver/elements/file_field.rb +20 -0
  22. data/lib/watir-webdriver/elements/form.rb +11 -0
  23. data/lib/watir-webdriver/elements/generated.rb +941 -0
  24. data/lib/watir-webdriver/elements/headings.rb +48 -0
  25. data/lib/watir-webdriver/elements/hidden.rb +18 -0
  26. data/lib/watir-webdriver/elements/image.rb +33 -0
  27. data/lib/watir-webdriver/elements/input.rb +39 -0
  28. data/lib/watir-webdriver/elements/link.rb +13 -0
  29. data/lib/watir-webdriver/elements/option.rb +36 -0
  30. data/lib/watir-webdriver/elements/radio.rb +23 -0
  31. data/lib/watir-webdriver/elements/select_list.rb +73 -0
  32. data/lib/watir-webdriver/elements/shared_radio_checkbox.rb +13 -0
  33. data/lib/watir-webdriver/elements/table.rb +18 -0
  34. data/lib/watir-webdriver/elements/table_row.rb +17 -0
  35. data/lib/watir-webdriver/elements/text_field.rb +60 -0
  36. data/lib/watir-webdriver/exception.rb +20 -0
  37. data/lib/watir-webdriver/locators/button_locator.rb +57 -0
  38. data/lib/watir-webdriver/locators/element_locator.rb +269 -0
  39. data/lib/watir-webdriver/locators/table_row_locator.rb +25 -0
  40. data/lib/watir-webdriver/locators/text_field_locator.rb +61 -0
  41. data/lib/watir-webdriver/xpath_support.rb +23 -0
  42. data/spec/element_locator_spec.rb +11 -0
  43. data/spec/spec_helper.rb +16 -0
  44. data/spec/watirspec/area_spec.rb +78 -0
  45. data/spec/watirspec/areas_spec.rb +31 -0
  46. data/spec/watirspec/browser_spec.rb +262 -0
  47. data/spec/watirspec/button_spec.rb +242 -0
  48. data/spec/watirspec/buttons_spec.rb +48 -0
  49. data/spec/watirspec/checkbox_spec.rb +272 -0
  50. data/spec/watirspec/checkboxes_spec.rb +32 -0
  51. data/spec/watirspec/dd_spec.rb +136 -0
  52. data/spec/watirspec/dds_spec.rb +31 -0
  53. data/spec/watirspec/div_spec.rb +222 -0
  54. data/spec/watirspec/divs_spec.rb +31 -0
  55. data/spec/watirspec/dl_spec.rb +136 -0
  56. data/spec/watirspec/dls_spec.rb +32 -0
  57. data/spec/watirspec/dt_spec.rb +136 -0
  58. data/spec/watirspec/dts_spec.rb +31 -0
  59. data/spec/watirspec/element_spec.rb +87 -0
  60. data/spec/watirspec/em_spec.rb +110 -0
  61. data/spec/watirspec/ems_spec.rb +32 -0
  62. data/spec/watirspec/filefield_spec.rb +119 -0
  63. data/spec/watirspec/filefields_spec.rb +32 -0
  64. data/spec/watirspec/form_spec.rb +63 -0
  65. data/spec/watirspec/forms_spec.rb +33 -0
  66. data/spec/watirspec/frame_spec.rb +140 -0
  67. data/spec/watirspec/frames_spec.rb +62 -0
  68. data/spec/watirspec/hidden_spec.rb +102 -0
  69. data/spec/watirspec/hiddens_spec.rb +32 -0
  70. data/spec/watirspec/hn_spec.rb +93 -0
  71. data/spec/watirspec/hns_spec.rb +38 -0
  72. data/spec/watirspec/image_spec.rb +207 -0
  73. data/spec/watirspec/images_spec.rb +31 -0
  74. data/spec/watirspec/label_spec.rb +75 -0
  75. data/spec/watirspec/labels_spec.rb +31 -0
  76. data/spec/watirspec/li_spec.rb +127 -0
  77. data/spec/watirspec/lib/guards.rb +59 -0
  78. data/spec/watirspec/lib/server.rb +127 -0
  79. data/spec/watirspec/lib/spec_helper.rb +79 -0
  80. data/spec/watirspec/lib/watirspec.rb +72 -0
  81. data/spec/watirspec/link_spec.rb +165 -0
  82. data/spec/watirspec/links_spec.rb +35 -0
  83. data/spec/watirspec/lis_spec.rb +31 -0
  84. data/spec/watirspec/map_spec.rb +92 -0
  85. data/spec/watirspec/maps_spec.rb +32 -0
  86. data/spec/watirspec/meta_spec.rb +22 -0
  87. data/spec/watirspec/metas_spec.rb +30 -0
  88. data/spec/watirspec/ol_spec.rb +78 -0
  89. data/spec/watirspec/ols_spec.rb +31 -0
  90. data/spec/watirspec/option_spec.rb +173 -0
  91. data/spec/watirspec/p_spec.rb +143 -0
  92. data/spec/watirspec/pre_spec.rb +125 -0
  93. data/spec/watirspec/pres_spec.rb +31 -0
  94. data/spec/watirspec/ps_spec.rb +31 -0
  95. data/spec/watirspec/radio_spec.rb +278 -0
  96. data/spec/watirspec/radios_spec.rb +32 -0
  97. data/spec/watirspec/select_list_spec.rb +318 -0
  98. data/spec/watirspec/select_lists_spec.rb +35 -0
  99. data/spec/watirspec/span_spec.rb +157 -0
  100. data/spec/watirspec/spans_spec.rb +57 -0
  101. data/spec/watirspec/spec_helper.rb +17 -0
  102. data/spec/watirspec/strong_spec.rb +89 -0
  103. data/spec/watirspec/strongs_spec.rb +32 -0
  104. data/spec/watirspec/table_bodies_spec.rb +45 -0
  105. data/spec/watirspec/table_body_spec.rb +98 -0
  106. data/spec/watirspec/table_cell_spec.rb +68 -0
  107. data/spec/watirspec/table_cells_spec.rb +47 -0
  108. data/spec/watirspec/table_footer_spec.rb +85 -0
  109. data/spec/watirspec/table_footers_spec.rb +47 -0
  110. data/spec/watirspec/table_header_spec.rb +85 -0
  111. data/spec/watirspec/table_headers_spec.rb +45 -0
  112. data/spec/watirspec/table_row_spec.rb +87 -0
  113. data/spec/watirspec/table_rows_spec.rb +50 -0
  114. data/spec/watirspec/table_spec.rb +166 -0
  115. data/spec/watirspec/tables_spec.rb +33 -0
  116. data/spec/watirspec/text_field_spec.rb +276 -0
  117. data/spec/watirspec/text_fields_spec.rb +35 -0
  118. data/spec/watirspec/ul_spec.rb +76 -0
  119. data/spec/watirspec/uls_spec.rb +33 -0
  120. data/spec/xpath_builder_spec.rb +49 -0
  121. data/support/html5/html5.idl +815 -0
  122. data/support/html5/html5_extras.idl +147 -0
  123. data/support/html5/idl_extractor.rb +73 -0
  124. data/support/html5/watir_visitor.rb +169 -0
  125. metadata +220 -0
@@ -0,0 +1,130 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class Browser
4
+ include Container
5
+
6
+ attr_reader :driver
7
+ alias_method :wd, :driver # ensures duck typing with BaseElement
8
+
9
+ class << self
10
+ def start(url, browser = :firefox)
11
+ b = new(browser)
12
+ b.goto url
13
+
14
+ b
15
+ end
16
+ end
17
+
18
+ def initialize(browser, *args)
19
+ case browser
20
+ when Symbol, String
21
+ @driver = Selenium::WebDriver.for browser.to_sym, *args
22
+ when Selenium::WebDriver::Driver
23
+ @driver = browser
24
+ else
25
+ raise ArugmentError, "expected Symbol or Selenium::WebDriver::Driver, got #{browser.class}"
26
+ end
27
+
28
+ @error_checkers = []
29
+ end
30
+
31
+ def inspect
32
+ '#<%s:0x%x url=%s title=%s>' % [self.class, hash*2, url.inspect, title.inspect]
33
+ end
34
+
35
+ def goto(uri)
36
+ uri = "http://#{uri}" unless uri.include?("://")
37
+
38
+ @driver.navigate.to uri
39
+ run_checkers
40
+
41
+ url
42
+ end
43
+
44
+ def back
45
+ @driver.navigate.back
46
+ end
47
+
48
+ def forward
49
+ @driver.navigate.forward
50
+ end
51
+
52
+ def url
53
+ @driver.current_url
54
+ end
55
+
56
+ def title
57
+ @driver.title
58
+ end
59
+
60
+ def quit
61
+ @driver.quit
62
+ end
63
+
64
+ def close
65
+ @driver.quit
66
+ end
67
+ alias_method :quit, :close # TODO: close vs quit
68
+
69
+ def clear_cookies
70
+ @driver.manage.delete_all_cookies
71
+ end
72
+
73
+ def text
74
+ # TODO: do this properly
75
+ if @driver.bridge.browser == :firefox
76
+ browserbot 'getVisibleText'
77
+ else
78
+ @driver.find_element(:tag_name, "body").text
79
+ end
80
+ end
81
+
82
+ def html
83
+ @driver.page_source
84
+ end
85
+
86
+ def refresh
87
+ execute_script 'location.reload(true)'
88
+ end
89
+
90
+ def exist?
91
+ true
92
+ end
93
+
94
+ def status
95
+ execute_script "return window.status;"
96
+ end
97
+
98
+ def execute_script(script, *args)
99
+ args.map! { |e| e.kind_of?(Watir::BaseElement) ? e.element : e }
100
+ @driver.execute_script(script, *args)
101
+ end
102
+
103
+ def add_checker(checker = nil, &block)
104
+ if block_given?
105
+ @error_checkers << block
106
+ elsif Proc === checker
107
+ @error_checkers << checker
108
+ else
109
+ raise ArgumentError, "argument must be a Proc or block"
110
+ end
111
+ end
112
+
113
+ def disable_checker(checker)
114
+ @error_checkers.delete(checker)
115
+ end
116
+
117
+ def run_checkers
118
+ @error_checkers.each { |e| e[self] }
119
+ end
120
+
121
+ #
122
+ # @api private
123
+ #
124
+
125
+ def assert_exists
126
+ true # TODO: assert browser is open
127
+ end
128
+
129
+ end # Browser
130
+ end # Watir
@@ -0,0 +1,34 @@
1
+ // stolen from injectableSelenium.js in WebDriver
2
+
3
+ var browserbot = {
4
+
5
+ triggerEvent : function(element, eventType, canBubble, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown) {
6
+ canBubble = (typeof(canBubble) == undefined) ? true : canBubble;
7
+ if (element.fireEvent && element.ownerDocument && element.ownerDocument.createEventObject) { // IE
8
+ var evt = this.createEventObject(element, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown);
9
+ element.fireEvent('on' + eventType, evt);
10
+ } else {
11
+ var evt = document.createEvent('HTMLEvents');
12
+
13
+ try {
14
+ evt.shiftKey = shiftKeyDown;
15
+ evt.metaKey = metaKeyDown;
16
+ evt.altKey = altKeyDown;
17
+ evt.ctrlKey = controlKeyDown;
18
+ } catch (e) {
19
+ // Nothing sane to do
20
+ }
21
+
22
+ evt.initEvent(eventType, canBubble, true);
23
+ element.dispatchEvent(evt);
24
+ }
25
+ },
26
+
27
+ getVisibleText : function() {
28
+ var selection = getSelection();
29
+ var range = document.createRange();
30
+ range.selectNodeContents(document.documentElement);
31
+ selection.addRange(range);
32
+ return selection.toString();
33
+ }
34
+ };
@@ -0,0 +1,13 @@
1
+ module Watir
2
+ class ButtonsCollection < ElementCollection
3
+
4
+ def elements
5
+ @elements ||= ButtonLocator.new(
6
+ @parent.wd,
7
+ @element_class.default_selector,
8
+ @element_class.attribute_list
9
+ ).locate_all
10
+ end
11
+
12
+ end # ButtonsCollection
13
+ end # Watir
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class ElementCollection
4
+ include Enumerable
5
+
6
+ def initialize(parent, element_class)
7
+ @parent, @element_class = parent, element_class
8
+ end
9
+
10
+ def each(&blk)
11
+ to_a.each(&blk)
12
+ end
13
+
14
+ def length
15
+ to_a.length
16
+ end
17
+ alias_method :size, :length
18
+
19
+ def [](idx)
20
+ to_a[idx] || @element_class.new(@parent, :index, idx)
21
+ end
22
+
23
+ def first
24
+ to_a[0] || @element_class.new(@parent, :index, 0)
25
+ end
26
+
27
+ def last
28
+ to_a[-1] || @element_class.new(@parent, :index, -1)
29
+ end
30
+
31
+ def to_a
32
+ # TODO: optimize - lazily @element_class instance
33
+ @to_a ||= elements.map { |e| @element_class.new(@parent, :element, e) }
34
+ end
35
+
36
+ def elements
37
+ @elements ||= ElementLocator.new(
38
+ @parent.wd,
39
+ @element_class.default_selector,
40
+ @element_class.attribute_list
41
+ ).locate_all
42
+ end
43
+
44
+ end # ElementCollection
45
+ end # Watir
@@ -0,0 +1,14 @@
1
+ module Watir
2
+ class TrsCollection < ElementCollection
3
+
4
+ def elements
5
+ return super unless @parent.kind_of?(Watir::Table)
6
+ @elements ||= TableRowLocator.new(
7
+ @parent.wd,
8
+ @element_class.default_selector,
9
+ @element_class.attribute_list
10
+ ).locate_all
11
+ end
12
+
13
+ end # ButtonsCollection
14
+ end # Watir
@@ -0,0 +1,13 @@
1
+ module Watir
2
+ class TextFieldsCollection < ElementCollection
3
+
4
+ def elements
5
+ @elements ||= TextFieldLocator.new(
6
+ @parent.wd,
7
+ @element_class.default_selector,
8
+ @element_class.attribute_list
9
+ ).locate_all
10
+ end
11
+
12
+ end # ButtonsCollection
13
+ end # Watir
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ module Container
4
+ class << self
5
+ def add(method, &blk)
6
+ define_method(method, &blk)
7
+ end
8
+ end
9
+
10
+ include XpathSupport
11
+
12
+ private
13
+
14
+ def browserbot(function_name, *arguments)
15
+ script = browserbot_script + "return browserbot.#{function_name}.apply(browserbot, arguments);"
16
+ driver.execute_script(script, *arguments)
17
+ end
18
+
19
+ def browserbot_script
20
+ @browserbot_script ||= File.read("#{File.dirname(__FILE__)}/browserbot.js")
21
+ end
22
+
23
+ end # Container
24
+ end # Watir
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ class String
3
+ #
4
+ # Convert from camel case to snake case
5
+ #
6
+ # 'FooBar'.snake_case # => "foo_bar"
7
+ #
8
+
9
+ def snake_case
10
+ gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_')
11
+ end
12
+
13
+ #
14
+ # Convert from snake case to camel case
15
+ #
16
+ # 'foo_bar'.camel_case # => "FooBar"
17
+ #
18
+
19
+ def camel_case
20
+ split('_').map { |e| e.capitalize }.join
21
+ end
22
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class Button < HTMLElement
4
+
5
+ # add the attributes from <input>
6
+ attributes Watir::Input.typed_attributes
7
+
8
+ def locate
9
+ ButtonLocator.new(@parent.wd, @selector, self.class.attribute_list).locate
10
+ end
11
+
12
+ def text
13
+ assert_exists
14
+ case @element.tag_name
15
+ when 'input'
16
+ value
17
+ when 'button'
18
+ text
19
+ end
20
+ end
21
+
22
+ def enabled?
23
+ !disabled?
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class CheckBox < Input
4
+ include SharedRadioCheckbox
5
+
6
+ identifier :type => 'checkbox'
7
+
8
+ container_method :checkbox
9
+ collection_method :checkboxes
10
+
11
+ def set(bool = true)
12
+ assert_exists
13
+ assert_enabled
14
+
15
+ if @element.selected?
16
+ @element.click unless bool
17
+ else
18
+ @element.click if bool
19
+ end
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class FileField < Input
4
+ identifier :type => 'file'
5
+
6
+ container_method :file_field
7
+ collection_method :file_fields
8
+
9
+ def set(value)
10
+ assert_exists
11
+ @element.send_keys value
12
+ end
13
+
14
+ def value
15
+ # since 'value' is an attribute on input fields, we override this here
16
+ assert_exists
17
+ @element.value
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+ module Watir
3
+ class Form
4
+
5
+ def submit
6
+ assert_exists
7
+ @element.submit
8
+ end
9
+
10
+ end # Form
11
+ end # Watir
@@ -0,0 +1,941 @@
1
+ # Autogenerated from the HTML5 specification. Edits may be lost.
2
+ module Watir
3
+ class HTMLElement < BaseElement
4
+ attributes(:string_map => ([:dataset]), :string => ([:innerhtml, :outerhtml, :id, :title, :lang, :dir, :class_name, :item_type, :item_id, :item_ref, :item_value, :access_key, :access_key_label, :content_editable, :spellcheck, :command_type, :label, :icon]), :properties_collection => ([:properties]), :int => ([:tab_index]), :html_element => ([:context_menu]), :function => ([:onabort, :onblur, :oncanplay, :oncanplaythrough, :onchange, :onclick, :oncontextmenu, :ondblclick, :ondrag, :ondragend, :ondragenter, :ondragleave, :ondragover, :ondragstart, :ondrop, :ondurationchange, :onemptied, :onended, :onerror, :onfocus, :onformchange, :onforminput, :oninput, :oninvalid, :onkeydown, :onkeypress, :onkeyup, :onload, :onloadeddata, :onloadedmetadata, :onloadstart, :onmousedown, :onmousemove, :onmouseout, :onmouseover, :onmouseup, :onmousewheel, :onpause, :onplay, :onplaying, :onprogress, :onratechange, :onreadystatechange, :onscroll, :onseeked, :onseeking, :onselect, :onshow, :onstalled, :onsubmit, :onsuspend, :ontimeupdate, :onvolumechange, :onwaiting]), :style => ([:style]), :bool => ([:item_scope, :hidden, :draggable, :is_content_editable, :disabled, :checked]), :token_list => ([:class_list, :item_prop]))
5
+ end
6
+
7
+ class TableCell < HTMLElement
8
+ attributes(:string => ([:headers]), :int => ([:col_span, :row_span, :cell_index]))
9
+ end
10
+
11
+ class Mod < HTMLElement
12
+ attributes(:string => ([:cite, :date_time]))
13
+ end
14
+
15
+ class Meta < HTMLElement
16
+ identifier(:tag_name => "meta")
17
+
18
+ container_method(:meta)
19
+
20
+ collection_method(:metas)
21
+
22
+ attributes(:string => ([:name, :http_equiv, :content]))
23
+ end
24
+
25
+ class Input < HTMLElement
26
+ identifier(:tag_name => "input")
27
+
28
+ container_method(:input)
29
+
30
+ collection_method(:inputs)
31
+
32
+ attributes(:string => ([:accept, :alt, :form_action, :form_enctype, :form_method, :form_target, :height, :max, :min, :name, :pattern, :placeholder, :src, :step, :type, :default_value, :value, :width, :validity, :validation_message]), :int => ([:max_length, :size, :selection_start, :selection_end]), :float => ([:value_as_number]), :date => ([:value_as_date]), :html_element => ([:form, :list, :selected_option]), :list => ([:files, :labels]), :bool => ([:autocomplete, :autofocus, :default_checked, :checked, :disabled, :form_no_validate, :indeterminate, :multiple, :read_only, :required, :will_validate]))
33
+ end
34
+
35
+ class TableHeaderCell < TableCell
36
+ identifier(:tag_name => "th")
37
+
38
+ container_method(:th)
39
+
40
+ collection_method(:ths)
41
+
42
+ attributes(:string => ([:scope]))
43
+ end
44
+
45
+ class DataList < HTMLElement
46
+ identifier(:tag_name => "datalist")
47
+
48
+ container_method(:datalist)
49
+
50
+ collection_method(:datalists)
51
+
52
+ attributes(:html_collection => ([:options]))
53
+ end
54
+
55
+ class Object < HTMLElement
56
+ identifier(:tag_name => "object")
57
+
58
+ container_method(:object)
59
+
60
+ collection_method(:objects)
61
+
62
+ attributes(:string => ([:data, :type, :name, :use_map, :width, :height, :content_window, :validity, :validation_message]), :document => ([:content_document]), :html_element => ([:form]), :bool => ([:will_validate]))
63
+ end
64
+
65
+ class DList < HTMLElement
66
+ identifier(:tag_name => "dl")
67
+
68
+ container_method(:dl)
69
+
70
+ collection_method(:dls)
71
+
72
+ # do nothing
73
+ end
74
+
75
+ class LI < HTMLElement
76
+ identifier(:tag_name => "li")
77
+
78
+ container_method(:li)
79
+
80
+ collection_method(:lis)
81
+
82
+ attributes(:int => ([:value]))
83
+ end
84
+
85
+ class HR < HTMLElement
86
+ identifier(:tag_name => "hr")
87
+
88
+ container_method(:hr)
89
+
90
+ collection_method(:hrs)
91
+
92
+ # do nothing
93
+ end
94
+
95
+ class Button < HTMLElement
96
+ identifier(:tag_name => "button")
97
+
98
+ container_method(:button)
99
+
100
+ collection_method(:buttons)
101
+
102
+ attributes(:string => ([:form_action, :form_enctype, :form_method, :form_no_validate, :form_target, :name, :type, :value, :validity, :validation_message]), :html_element => ([:form]), :list => ([:labels]), :bool => ([:autofocus, :disabled, :will_validate]))
103
+ end
104
+
105
+ class TableRow < HTMLElement
106
+ identifier(:tag_name => "tr")
107
+
108
+ container_method(:tr)
109
+
110
+ collection_method(:trs)
111
+
112
+ attributes(:int => ([:row_index, :section_row_index]), :html_collection => ([:cells]))
113
+ end
114
+
115
+ class TableSection < HTMLElement
116
+ identifier(:tag_name => "tbody")
117
+
118
+ container_method(:tbody)
119
+
120
+ collection_method(:tbodys)
121
+
122
+ attributes(:html_collection => ([:rows]))
123
+ end
124
+
125
+ class Area < HTMLElement
126
+ identifier(:tag_name => "area")
127
+
128
+ container_method(:area)
129
+
130
+ collection_method(:areas)
131
+
132
+ attributes(:string => ([:alt, :coords, :shape, :href, :target, :ping, :rel, :media, :hreflang, :type, :protocol, :host, :hostname, :port, :pathname, :search, :hash]), :token_list => ([:rel_list]))
133
+ end
134
+
135
+ class Anchor < HTMLElement
136
+ identifier(:tag_name => "a")
137
+
138
+ container_method(:a)
139
+
140
+ collection_method(:as)
141
+
142
+ attributes(:string => ([:href, :target, :ping, :rel, :media, :hreflang, :type, :protocol, :host, :hostname, :port, :pathname, :search, :hash]), :token_list => ([:rel_list]))
143
+ end
144
+
145
+ class Pre < HTMLElement
146
+ identifier(:tag_name => "pre")
147
+
148
+ container_method(:pre)
149
+
150
+ collection_method(:pres)
151
+
152
+ # do nothing
153
+ end
154
+
155
+ class Details < HTMLElement
156
+ identifier(:tag_name => "details")
157
+
158
+ container_method(:details)
159
+
160
+ collection_method(:details)
161
+
162
+ attributes(:bool => ([:open]))
163
+ end
164
+
165
+ class OptGroup < HTMLElement
166
+ identifier(:tag_name => "optgroup")
167
+
168
+ container_method(:optgroup)
169
+
170
+ collection_method(:optgroups)
171
+
172
+ attributes(:string => ([:label]), :bool => ([:disabled]))
173
+ end
174
+
175
+ class TableCol < HTMLElement
176
+ identifier(:tag_name => "colgroup")
177
+
178
+ container_method(:colgroup)
179
+
180
+ collection_method(:colgroups)
181
+
182
+ attributes(:int => ([:span]))
183
+ end
184
+
185
+ class Embed < HTMLElement
186
+ identifier(:tag_name => "embed")
187
+
188
+ container_method(:embed)
189
+
190
+ collection_method(:embeds)
191
+
192
+ attributes(:string => ([:src, :type, :width, :height]))
193
+ end
194
+
195
+ # class Link < HTMLElement
196
+ # identifier(:tag_name => "link")
197
+ #
198
+ # container_method(:link)
199
+ #
200
+ # collection_method(:links)
201
+ #
202
+ # attributes(:string => ([:href, :rel, :media, :hreflang, :type, :sizes]), :bool => ([:disabled]), :token_list => ([:rel_list]))
203
+ # end
204
+
205
+
206
+
207
+ class Html < HTMLElement
208
+ identifier(:tag_name => "html")
209
+
210
+ container_method(:html)
211
+
212
+ collection_method(:htmls)
213
+
214
+ # do nothing
215
+ end
216
+
217
+ class Option < HTMLElement
218
+ identifier(:tag_name => "option")
219
+
220
+ container_method(:option)
221
+
222
+ collection_method(:options)
223
+
224
+ attributes(:string => ([:label, :value, :text]), :int => ([:index]), :html_element => ([:form]), :bool => ([:disabled, :default_selected, :selected]))
225
+ end
226
+
227
+ class Legend < HTMLElement
228
+ identifier(:tag_name => "legend")
229
+
230
+ container_method(:legend)
231
+
232
+ collection_method(:legends)
233
+
234
+ attributes(:html_element => ([:form]))
235
+ end
236
+
237
+ class Form < HTMLElement
238
+ identifier(:tag_name => "form")
239
+
240
+ container_method(:form)
241
+
242
+ collection_method(:forms)
243
+
244
+ attributes(:string => ([:accept_charset, :action, :enctype, :method, :name, :target]), :int => ([:length]), :html_collection => ([:elements]), :bool => ([:autocomplete, :no_validate]))
245
+ end
246
+
247
+ class Param < HTMLElement
248
+ identifier(:tag_name => "param")
249
+
250
+ container_method(:param)
251
+
252
+ collection_method(:params)
253
+
254
+ attributes(:string => ([:name, :value]))
255
+ end
256
+
257
+ class IFrame < HTMLElement
258
+ identifier(:tag_name => "iframe")
259
+
260
+ container_method(:iframe)
261
+
262
+ collection_method(:iframes)
263
+
264
+ attributes(:string => ([:src, :name, :sandbox, :width, :height, :content_window]), :document => ([:content_document]), :bool => ([:seamless]))
265
+ end
266
+
267
+ class Image < HTMLElement
268
+ identifier(:tag_name => "img")
269
+
270
+ container_method(:image)
271
+
272
+ collection_method(:images)
273
+
274
+ attributes(:string => ([:alt, :src, :use_map]), :int => ([:width, :height, :natural_width, :natural_height]), :bool => ([:is_map, :complete]))
275
+ end
276
+
277
+ class Progress < HTMLElement
278
+ identifier(:tag_name => "progress")
279
+
280
+ container_method(:progress)
281
+
282
+ collection_method(:progress)
283
+
284
+ attributes(:float => ([:value, :max, :position]))
285
+ end
286
+
287
+ class Time < HTMLElement
288
+ identifier(:tag_name => "time")
289
+
290
+ container_method(:time)
291
+
292
+ collection_method(:times)
293
+
294
+ attributes(:string => ([:date_time]), :date => ([:value_as_date]), :bool => ([:pub_date]))
295
+ end
296
+
297
+ class UList < HTMLElement
298
+ identifier(:tag_name => "ul")
299
+
300
+ container_method(:ul)
301
+
302
+ collection_method(:uls)
303
+
304
+ # do nothing
305
+ end
306
+
307
+ class Quote < HTMLElement
308
+ identifier(:tag_name => "blockquote")
309
+
310
+ container_method(:blockquote)
311
+
312
+ collection_method(:blockquotes)
313
+
314
+ attributes(:string => ([:cite]))
315
+ end
316
+
317
+ class Style < HTMLElement
318
+ identifier(:tag_name => "style")
319
+
320
+ container_method(:style)
321
+
322
+ collection_method(:styles)
323
+
324
+ attributes(:string => ([:media, :type]), :bool => ([:disabled, :scoped]))
325
+ end
326
+
327
+
328
+
329
+ class Output < HTMLElement
330
+ identifier(:tag_name => "output")
331
+
332
+ container_method(:output)
333
+
334
+ collection_method(:outputs)
335
+
336
+ attributes(:string => ([:html_for, :name, :type, :default_value, :value, :validity, :validation_message]), :html_element => ([:form]), :bool => ([:will_validate]))
337
+ end
338
+
339
+ class TableCaption < HTMLElement
340
+ identifier(:tag_name => "caption")
341
+
342
+ container_method(:caption)
343
+
344
+ collection_method(:captions)
345
+
346
+ # do nothing
347
+ end
348
+
349
+ class Table < HTMLElement
350
+ identifier(:tag_name => "table")
351
+
352
+ container_method(:table)
353
+
354
+ collection_method(:tables)
355
+
356
+ attributes(:string => ([:summary]), :html_element => ([:caption, :t_head, :t_foot]), :html_collection => ([:t_bodies, :rows]))
357
+ end
358
+
359
+ class Paragraph < HTMLElement
360
+ identifier(:tag_name => "p")
361
+
362
+ container_method(:p)
363
+
364
+ collection_method(:ps)
365
+
366
+ # do nothing
367
+ end
368
+
369
+ class Body < HTMLElement
370
+ identifier(:tag_name => "body")
371
+
372
+ container_method(:body)
373
+
374
+ collection_method(:bodys)
375
+
376
+ attributes(:function => ([:onafterprint, :onbeforeprint, :onbeforeunload, :onblur, :onerror, :onfocus, :onhashchange, :onload, :onmessage, :onoffline, :ononline, :onpopstate, :onpagehide, :onpageshow, :onredo, :onresize, :onstorage, :onundo, :onunload]))
377
+ end
378
+
379
+ class Head < HTMLElement
380
+ identifier(:tag_name => "head")
381
+
382
+ container_method(:head)
383
+
384
+ collection_method(:heads)
385
+
386
+ # do nothing
387
+ end
388
+
389
+ class Map < HTMLElement
390
+ identifier(:tag_name => "map")
391
+
392
+ container_method(:map)
393
+
394
+ collection_method(:maps)
395
+
396
+ attributes(:string => ([:name]), :html_collection => ([:areas, :images]))
397
+ end
398
+
399
+ class Div < HTMLElement
400
+ identifier(:tag_name => "div")
401
+
402
+ container_method(:div)
403
+
404
+ collection_method(:divs)
405
+
406
+ # do nothing
407
+ end
408
+
409
+ class TextArea < HTMLElement
410
+ identifier(:tag_name => "textarea")
411
+
412
+ container_method(:textarea)
413
+
414
+ collection_method(:textareas)
415
+
416
+ attributes(:string => ([:name, :placeholder, :wrap, :type, :default_value, :value, :validity, :validation_message]), :int => ([:cols, :max_length, :rows, :text_length, :selection_start, :selection_end]), :html_element => ([:form]), :list => ([:labels]), :bool => ([:autofocus, :disabled, :read_only, :required, :will_validate]))
417
+ end
418
+
419
+ class TableDataCell < TableCell
420
+ identifier(:tag_name => "td")
421
+
422
+ container_method(:td)
423
+
424
+ collection_method(:tds)
425
+
426
+ # do nothing
427
+ end
428
+
429
+ class Canvas < HTMLElement
430
+ identifier(:tag_name => "canvas")
431
+
432
+ container_method(:canvas)
433
+
434
+ collection_method(:canvas)
435
+
436
+ attributes(:int => ([:width, :height]))
437
+ end
438
+
439
+ class BR < HTMLElement
440
+ identifier(:tag_name => "br")
441
+
442
+ container_method(:br)
443
+
444
+ collection_method(:brs)
445
+
446
+ # do nothing
447
+ end
448
+
449
+ class Title < HTMLElement
450
+ identifier(:tag_name => "title")
451
+
452
+ container_method(:title)
453
+
454
+ collection_method(:titles)
455
+
456
+ attributes(:string => ([:text]))
457
+ end
458
+
459
+ class Meter < HTMLElement
460
+ identifier(:tag_name => "meter")
461
+
462
+ container_method(:meter)
463
+
464
+ collection_method(:meters)
465
+
466
+ attributes(:float => ([:value, :min, :max, :low, :high, :optimum]))
467
+ end
468
+
469
+ class Heading < HTMLElement
470
+ identifier(:tag_name => "h1")
471
+
472
+ container_method(:h1)
473
+
474
+ collection_method(:h1s)
475
+
476
+ # do nothing
477
+ end
478
+
479
+ class Base < HTMLElement
480
+ identifier(:tag_name => "base")
481
+
482
+ container_method(:base)
483
+
484
+ collection_method(:bases)
485
+
486
+ attributes(:string => ([:href, :target]))
487
+ end
488
+
489
+ class Unknown < HTMLElement
490
+ identifier(:tag_name => "unknown")
491
+
492
+ container_method(:unknown)
493
+
494
+ collection_method(:unknowns)
495
+
496
+ # do nothing
497
+ end
498
+
499
+ class Select < HTMLElement
500
+ identifier(:tag_name => "select")
501
+
502
+ container_method(:select)
503
+
504
+ collection_method(:selects)
505
+
506
+ attributes(:string => ([:name, :type, :value, :validity, :validation_message]), :int => ([:size, :length, :selected_index]), :html_element => ([:form]), :list => ([:labels]), :html_collection => ([:options, :selected_options]), :bool => ([:autofocus, :disabled, :multiple, :will_validate]))
507
+ end
508
+
509
+ class Label < HTMLElement
510
+ identifier(:tag_name => "label")
511
+
512
+ container_method(:label)
513
+
514
+ collection_method(:labels)
515
+
516
+ attributes(:string => ([:html_for]), :html_element => ([:form, :control]))
517
+ end
518
+
519
+ class Keygen < HTMLElement
520
+ identifier(:tag_name => "keygen")
521
+
522
+ container_method(:keygen)
523
+
524
+ collection_method(:keygens)
525
+
526
+ attributes(:string => ([:challenge, :keytype, :name, :type, :validity, :validation_message]), :html_element => ([:form]), :list => ([:labels]), :bool => ([:autofocus, :disabled, :will_validate]))
527
+ end
528
+
529
+ class FieldSet < HTMLElement
530
+ identifier(:tag_name => "fieldset")
531
+
532
+ container_method(:fieldset)
533
+
534
+ collection_method(:fieldsets)
535
+
536
+ attributes(:string => ([:name, :type, :validity, :validation_message]), :html_element => ([:form]), :html_collection => ([:elements]), :bool => ([:disabled, :will_validate]))
537
+ end
538
+
539
+ class Source < HTMLElement
540
+ identifier(:tag_name => "source")
541
+
542
+ container_method(:source)
543
+
544
+ collection_method(:sources)
545
+
546
+ attributes(:string => ([:src, :type, :media]))
547
+ end
548
+
549
+ class Span < HTMLElement
550
+ identifier(:tag_name => "span")
551
+
552
+ container_method(:span)
553
+
554
+ collection_method(:spans)
555
+
556
+ # do nothing
557
+ end
558
+
559
+ class OList < HTMLElement
560
+ identifier(:tag_name => "ol")
561
+
562
+ container_method(:ol)
563
+
564
+ collection_method(:ols)
565
+
566
+ attributes(:int => ([:start]), :bool => ([:reversed]))
567
+ end
568
+ end# from extras:
569
+
570
+ # Autogenerated from the HTML5 specification. Edits may be lost.
571
+ module Watir
572
+ class Thead < TableSection
573
+ identifier(:tag_name => "thead")
574
+
575
+ container_method(:thead)
576
+
577
+ collection_method(:theads)
578
+
579
+ # do nothing
580
+ end
581
+
582
+ class Dd < HTMLElement
583
+ identifier(:tag_name => "dd")
584
+
585
+ container_method(:dd)
586
+
587
+ collection_method(:dds)
588
+
589
+ # do nothing
590
+ end
591
+
592
+ class Address < HTMLElement
593
+ identifier(:tag_name => "address")
594
+
595
+ container_method(:address)
596
+
597
+ collection_method(:address)
598
+
599
+ # do nothing
600
+ end
601
+
602
+ class Nav < HTMLElement
603
+ identifier(:tag_name => "nav")
604
+
605
+ container_method(:nav)
606
+
607
+ collection_method(:navs)
608
+
609
+ # do nothing
610
+ end
611
+
612
+ class TFoot < TableSection
613
+ identifier(:tag_name => "tfoot")
614
+
615
+ container_method(:tfoot)
616
+
617
+ collection_method(:tfoots)
618
+
619
+ # do nothing
620
+ end
621
+
622
+ class Sub < HTMLElement
623
+ identifier(:tag_name => "sub")
624
+
625
+ container_method(:sub)
626
+
627
+ collection_method(:subs)
628
+
629
+ # do nothing
630
+ end
631
+
632
+ class Sup < HTMLElement
633
+ identifier(:tag_name => "sup")
634
+
635
+ container_method(:sup)
636
+
637
+ collection_method(:sups)
638
+
639
+ # do nothing
640
+ end
641
+
642
+ class Bdo < HTMLElement
643
+ identifier(:tag_name => "bdo")
644
+
645
+ container_method(:bdo)
646
+
647
+ collection_method(:bdos)
648
+
649
+ # do nothing
650
+ end
651
+
652
+ class Rp < HTMLElement
653
+ identifier(:tag_name => "rp")
654
+
655
+ container_method(:rp)
656
+
657
+ collection_method(:rps)
658
+
659
+ # do nothing
660
+ end
661
+
662
+ class Rt < HTMLElement
663
+ identifier(:tag_name => "rt")
664
+
665
+ container_method(:rt)
666
+
667
+ collection_method(:rts)
668
+
669
+ # do nothing
670
+ end
671
+
672
+ class Mark < HTMLElement
673
+ identifier(:tag_name => "mark")
674
+
675
+ container_method(:mark)
676
+
677
+ collection_method(:marks)
678
+
679
+ # do nothing
680
+ end
681
+
682
+ class Kbd < HTMLElement
683
+ identifier(:tag_name => "kbd")
684
+
685
+ container_method(:kbd)
686
+
687
+ collection_method(:kbds)
688
+
689
+ # do nothing
690
+ end
691
+
692
+ class Dfn < HTMLElement
693
+ identifier(:tag_name => "dfn")
694
+
695
+ container_method(:dfn)
696
+
697
+ collection_method(:dfns)
698
+
699
+ # do nothing
700
+ end
701
+
702
+ class Cite < HTMLElement
703
+ identifier(:tag_name => "cite")
704
+
705
+ container_method(:cite)
706
+
707
+ collection_method(:cites)
708
+
709
+ # do nothing
710
+ end
711
+
712
+ class Ins < Mod
713
+ identifier(:tag_name => "ins")
714
+
715
+ container_method(:ins)
716
+
717
+ collection_method(:ins)
718
+
719
+ # do nothing
720
+ end
721
+
722
+ class B < HTMLElement
723
+ identifier(:tag_name => "b")
724
+
725
+ container_method(:b)
726
+
727
+ collection_method(:bs)
728
+
729
+ # do nothing
730
+ end
731
+
732
+ class Noscript < HTMLElement
733
+ identifier(:tag_name => "noscript")
734
+
735
+ container_method(:noscript)
736
+
737
+ collection_method(:noscripts)
738
+
739
+ # do nothing
740
+ end
741
+
742
+ class Figure < HTMLElement
743
+ identifier(:tag_name => "figure")
744
+
745
+ container_method(:figure)
746
+
747
+ collection_method(:figures)
748
+
749
+ # do nothing
750
+ end
751
+
752
+ class Code < HTMLElement
753
+ identifier(:tag_name => "code")
754
+
755
+ container_method(:code)
756
+
757
+ collection_method(:codes)
758
+
759
+ # do nothing
760
+ end
761
+
762
+ class Q < Quote
763
+ identifier(:tag_name => "q")
764
+
765
+ container_method(:q)
766
+
767
+ collection_method(:qs)
768
+
769
+ # do nothing
770
+ end
771
+
772
+ class Strong < HTMLElement
773
+ identifier(:tag_name => "strong")
774
+
775
+ container_method(:strong)
776
+
777
+ collection_method(:strongs)
778
+
779
+ # do nothing
780
+ end
781
+
782
+ class Header < HTMLElement
783
+ identifier(:tag_name => "header")
784
+
785
+ container_method(:header)
786
+
787
+ collection_method(:headers)
788
+
789
+ # do nothing
790
+ end
791
+
792
+ class Hgroup < HTMLElement
793
+ identifier(:tag_name => "hgroup")
794
+
795
+ container_method(:hgroup)
796
+
797
+ collection_method(:hgroups)
798
+
799
+ # do nothing
800
+ end
801
+
802
+ class Aside < HTMLElement
803
+ identifier(:tag_name => "aside")
804
+
805
+ container_method(:aside)
806
+
807
+ collection_method(:asides)
808
+
809
+ # do nothing
810
+ end
811
+
812
+ class Samp < HTMLElement
813
+ identifier(:tag_name => "samp")
814
+
815
+ container_method(:samp)
816
+
817
+ collection_method(:samps)
818
+
819
+ # do nothing
820
+ end
821
+
822
+ class Section < HTMLElement
823
+ identifier(:tag_name => "section")
824
+
825
+ container_method(:section)
826
+
827
+ collection_method(:sections)
828
+
829
+ # do nothing
830
+ end
831
+
832
+ class Dt < HTMLElement
833
+ identifier(:tag_name => "dt")
834
+
835
+ container_method(:dt)
836
+
837
+ collection_method(:dts)
838
+
839
+ # do nothing
840
+ end
841
+
842
+ class Col < TableCol
843
+ identifier(:tag_name => "col")
844
+
845
+ container_method(:col)
846
+
847
+ collection_method(:cols)
848
+
849
+ # do nothing
850
+ end
851
+
852
+ class I < HTMLElement
853
+ identifier(:tag_name => "i")
854
+
855
+ container_method(:i)
856
+
857
+ collection_method(:is)
858
+
859
+ # do nothing
860
+ end
861
+
862
+ class Var < HTMLElement
863
+ identifier(:tag_name => "var")
864
+
865
+ container_method(:var)
866
+
867
+ collection_method(:vars)
868
+
869
+ # do nothing
870
+ end
871
+
872
+ class Abbr < HTMLElement
873
+ identifier(:tag_name => "abbr")
874
+
875
+ container_method(:abbr)
876
+
877
+ collection_method(:abbrs)
878
+
879
+ # do nothing
880
+ end
881
+
882
+ class Small < HTMLElement
883
+ identifier(:tag_name => "small")
884
+
885
+ container_method(:small)
886
+
887
+ collection_method(:smalls)
888
+
889
+ # do nothing
890
+ end
891
+
892
+ class Footer < HTMLElement
893
+ identifier(:tag_name => "footer")
894
+
895
+ container_method(:footer)
896
+
897
+ collection_method(:footers)
898
+
899
+ # do nothing
900
+ end
901
+
902
+ class Ruby < HTMLElement
903
+ identifier(:tag_name => "ruby")
904
+
905
+ container_method(:ruby)
906
+
907
+ collection_method(:rubys)
908
+
909
+ # do nothing
910
+ end
911
+
912
+ class Article < HTMLElement
913
+ identifier(:tag_name => "article")
914
+
915
+ container_method(:article)
916
+
917
+ collection_method(:articles)
918
+
919
+ # do nothing
920
+ end
921
+
922
+ class Del < Mod
923
+ identifier(:tag_name => "del")
924
+
925
+ container_method(:del)
926
+
927
+ collection_method(:dels)
928
+
929
+ # do nothing
930
+ end
931
+
932
+ class Em < HTMLElement
933
+ identifier(:tag_name => "em")
934
+
935
+ container_method(:em)
936
+
937
+ collection_method(:ems)
938
+
939
+ # do nothing
940
+ end
941
+ end