watir-webdriver 0.0.1.dev5 → 0.0.1.dev6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/Rakefile +13 -19
  2. data/VERSION +1 -1
  3. data/lib/watir-webdriver.rb +3 -1
  4. data/lib/watir-webdriver/base_element.rb +33 -27
  5. data/lib/watir-webdriver/browser.rb +2 -6
  6. data/lib/watir-webdriver/elements/font.rb +12 -0
  7. data/lib/watir-webdriver/elements/generated.rb +1027 -622
  8. data/lib/watir-webdriver/elements/select_list.rb +3 -3
  9. data/lib/watir-webdriver/locators/element_locator.rb +2 -2
  10. data/lib/watir-webdriver/xpath_support.rb +2 -2
  11. data/support/html5/html5.idl +942 -483
  12. data/support/html5/old/html5.idl +962 -0
  13. data/support/html5/{html5_extras.idl → old/html5_extras.idl} +0 -2
  14. data/support/html5/watir_visitor.rb +23 -19
  15. metadata +74 -100
  16. data/spec/watirspec/area_spec.rb +0 -78
  17. data/spec/watirspec/areas_spec.rb +0 -31
  18. data/spec/watirspec/browser_spec.rb +0 -274
  19. data/spec/watirspec/button_spec.rb +0 -242
  20. data/spec/watirspec/buttons_spec.rb +0 -48
  21. data/spec/watirspec/checkbox_spec.rb +0 -272
  22. data/spec/watirspec/checkboxes_spec.rb +0 -32
  23. data/spec/watirspec/dd_spec.rb +0 -123
  24. data/spec/watirspec/dds_spec.rb +0 -31
  25. data/spec/watirspec/div_spec.rb +0 -211
  26. data/spec/watirspec/divs_spec.rb +0 -31
  27. data/spec/watirspec/dl_spec.rb +0 -123
  28. data/spec/watirspec/dls_spec.rb +0 -32
  29. data/spec/watirspec/dt_spec.rb +0 -123
  30. data/spec/watirspec/dts_spec.rb +0 -31
  31. data/spec/watirspec/element_spec.rb +0 -89
  32. data/spec/watirspec/em_spec.rb +0 -97
  33. data/spec/watirspec/ems_spec.rb +0 -32
  34. data/spec/watirspec/filefield_spec.rb +0 -119
  35. data/spec/watirspec/filefields_spec.rb +0 -32
  36. data/spec/watirspec/form_spec.rb +0 -63
  37. data/spec/watirspec/forms_spec.rb +0 -33
  38. data/spec/watirspec/frame_spec.rb +0 -129
  39. data/spec/watirspec/frames_spec.rb +0 -62
  40. data/spec/watirspec/hidden_spec.rb +0 -102
  41. data/spec/watirspec/hiddens_spec.rb +0 -32
  42. data/spec/watirspec/hn_spec.rb +0 -93
  43. data/spec/watirspec/hns_spec.rb +0 -38
  44. data/spec/watirspec/image_spec.rb +0 -207
  45. data/spec/watirspec/images_spec.rb +0 -31
  46. data/spec/watirspec/label_spec.rb +0 -75
  47. data/spec/watirspec/labels_spec.rb +0 -31
  48. data/spec/watirspec/li_spec.rb +0 -112
  49. data/spec/watirspec/lib/guards.rb +0 -59
  50. data/spec/watirspec/lib/server.rb +0 -127
  51. data/spec/watirspec/lib/spec_helper.rb +0 -79
  52. data/spec/watirspec/lib/watirspec.rb +0 -72
  53. data/spec/watirspec/link_spec.rb +0 -168
  54. data/spec/watirspec/links_spec.rb +0 -35
  55. data/spec/watirspec/lis_spec.rb +0 -31
  56. data/spec/watirspec/map_spec.rb +0 -76
  57. data/spec/watirspec/maps_spec.rb +0 -32
  58. data/spec/watirspec/meta_spec.rb +0 -22
  59. data/spec/watirspec/metas_spec.rb +0 -30
  60. data/spec/watirspec/ol_spec.rb +0 -78
  61. data/spec/watirspec/ols_spec.rb +0 -31
  62. data/spec/watirspec/option_spec.rb +0 -173
  63. data/spec/watirspec/p_spec.rb +0 -128
  64. data/spec/watirspec/pre_spec.rb +0 -112
  65. data/spec/watirspec/pres_spec.rb +0 -31
  66. data/spec/watirspec/ps_spec.rb +0 -31
  67. data/spec/watirspec/radio_spec.rb +0 -255
  68. data/spec/watirspec/radios_spec.rb +0 -32
  69. data/spec/watirspec/select_list_spec.rb +0 -318
  70. data/spec/watirspec/select_lists_spec.rb +0 -35
  71. data/spec/watirspec/span_spec.rb +0 -142
  72. data/spec/watirspec/spans_spec.rb +0 -31
  73. data/spec/watirspec/spec_helper.rb +0 -17
  74. data/spec/watirspec/strong_spec.rb +0 -89
  75. data/spec/watirspec/strongs_spec.rb +0 -32
  76. data/spec/watirspec/table_bodies_spec.rb +0 -45
  77. data/spec/watirspec/table_body_spec.rb +0 -98
  78. data/spec/watirspec/table_cell_spec.rb +0 -68
  79. data/spec/watirspec/table_cells_spec.rb +0 -47
  80. data/spec/watirspec/table_footer_spec.rb +0 -85
  81. data/spec/watirspec/table_footers_spec.rb +0 -47
  82. data/spec/watirspec/table_header_spec.rb +0 -85
  83. data/spec/watirspec/table_headers_spec.rb +0 -45
  84. data/spec/watirspec/table_row_spec.rb +0 -87
  85. data/spec/watirspec/table_rows_spec.rb +0 -50
  86. data/spec/watirspec/table_spec.rb +0 -160
  87. data/spec/watirspec/tables_spec.rb +0 -33
  88. data/spec/watirspec/text_field_spec.rb +0 -276
  89. data/spec/watirspec/text_fields_spec.rb +0 -35
  90. data/spec/watirspec/ul_spec.rb +0 -76
  91. data/spec/watirspec/uls_spec.rb +0 -33
  92. data/support/html5/idl_extractor.rb +0 -73
@@ -1,73 +0,0 @@
1
- # encoding: utf-8
2
- require "nokogiri"
3
- require "open-uri"
4
- require "pp"
5
- require "ruby-debug"
6
-
7
- class IdlExtractor
8
- def initialize(url)
9
- @doc = Nokogiri.HTML(open(url))
10
- @idls = {}
11
- @extras = {}
12
- extract
13
- end
14
-
15
- def write_idl_to(filepath)
16
- File.open(filepath, "w") do |file|
17
- @idls.values.each { |idl| file.puts(idl) }
18
- end
19
- end
20
-
21
- def write_extras_to(filepath)
22
- File.open(filepath, "w") do |file|
23
- @extras.values.each { |extra| file.puts(extra) }
24
- end
25
- end
26
-
27
- def extract
28
- # get the HTMLElement interface, which doesn't follow the normal structure
29
- unless html_header = @doc.search("//h4[@id='elements-in-the-dom']").first
30
- raise "could not find header with id 'elements-in-the-dom' (for HTMLElement)"
31
- end
32
-
33
- idl = html_header.xpath("following-sibling::pre[@class='idl']").first.text
34
- @idls['htmlelement'] = "// HTMLElement\n#{idl}"
35
-
36
- # then get all the others
37
- element_headers = @doc.search('//h4').select { |e| e['id'] =~ /the-.+-element/ }
38
- raise "no elements found in the spec!" if element_headers.empty?
39
- element_headers.map { |e| extract_idl_from(e) }
40
- end
41
-
42
-
43
- def extract_idl_from(node)
44
- dl = node.xpath("following-sibling::dl[@class='element' and position()=1]").first
45
- unless dl
46
- short_id = node['id'][/^the-.+-element/, 0]
47
- $stderr.puts "could not find 'DOM interface' section for #{node['id']}"
48
- $stderr.puts " already have #{short_id}" if @idls.has_key?(short_id) || @extras.has_key?(short_id)
49
- return
50
- end
51
-
52
- prefix = "\n\n// #{node['id']}\n" << tag_name_ext_attr_for(node)
53
-
54
- if idl_node = dl.css("pre.idl").first
55
- @idls[node['id']] = prefix << idl_node.text
56
- else
57
- if extra_node = dl.css("dt ~ dd").last
58
- @extras[node['id']] = prefix << extra_node.text
59
- else
60
- raise "could not find IDL section for #{node['id']}"
61
- end
62
- end
63
- end
64
-
65
- def tag_name_ext_attr_for(node)
66
- if node['id'] =~ /^the-(.+)-element/
67
- "[TagName=#{$1}]\n"
68
- else
69
- raise "not sure what tag name to use for #{node['id']}"
70
- end
71
- end
72
-
73
- end # IdlExtractor