watir-webdriver 0.0.1.dev5 → 0.0.1.dev6
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.
- data/Rakefile +13 -19
- data/VERSION +1 -1
- data/lib/watir-webdriver.rb +3 -1
- data/lib/watir-webdriver/base_element.rb +33 -27
- data/lib/watir-webdriver/browser.rb +2 -6
- data/lib/watir-webdriver/elements/font.rb +12 -0
- data/lib/watir-webdriver/elements/generated.rb +1027 -622
- data/lib/watir-webdriver/elements/select_list.rb +3 -3
- data/lib/watir-webdriver/locators/element_locator.rb +2 -2
- data/lib/watir-webdriver/xpath_support.rb +2 -2
- data/support/html5/html5.idl +942 -483
- data/support/html5/old/html5.idl +962 -0
- data/support/html5/{html5_extras.idl → old/html5_extras.idl} +0 -2
- data/support/html5/watir_visitor.rb +23 -19
- metadata +74 -100
- data/spec/watirspec/area_spec.rb +0 -78
- data/spec/watirspec/areas_spec.rb +0 -31
- data/spec/watirspec/browser_spec.rb +0 -274
- data/spec/watirspec/button_spec.rb +0 -242
- data/spec/watirspec/buttons_spec.rb +0 -48
- data/spec/watirspec/checkbox_spec.rb +0 -272
- data/spec/watirspec/checkboxes_spec.rb +0 -32
- data/spec/watirspec/dd_spec.rb +0 -123
- data/spec/watirspec/dds_spec.rb +0 -31
- data/spec/watirspec/div_spec.rb +0 -211
- data/spec/watirspec/divs_spec.rb +0 -31
- data/spec/watirspec/dl_spec.rb +0 -123
- data/spec/watirspec/dls_spec.rb +0 -32
- data/spec/watirspec/dt_spec.rb +0 -123
- data/spec/watirspec/dts_spec.rb +0 -31
- data/spec/watirspec/element_spec.rb +0 -89
- data/spec/watirspec/em_spec.rb +0 -97
- data/spec/watirspec/ems_spec.rb +0 -32
- data/spec/watirspec/filefield_spec.rb +0 -119
- data/spec/watirspec/filefields_spec.rb +0 -32
- data/spec/watirspec/form_spec.rb +0 -63
- data/spec/watirspec/forms_spec.rb +0 -33
- data/spec/watirspec/frame_spec.rb +0 -129
- data/spec/watirspec/frames_spec.rb +0 -62
- data/spec/watirspec/hidden_spec.rb +0 -102
- data/spec/watirspec/hiddens_spec.rb +0 -32
- data/spec/watirspec/hn_spec.rb +0 -93
- data/spec/watirspec/hns_spec.rb +0 -38
- data/spec/watirspec/image_spec.rb +0 -207
- data/spec/watirspec/images_spec.rb +0 -31
- data/spec/watirspec/label_spec.rb +0 -75
- data/spec/watirspec/labels_spec.rb +0 -31
- data/spec/watirspec/li_spec.rb +0 -112
- data/spec/watirspec/lib/guards.rb +0 -59
- data/spec/watirspec/lib/server.rb +0 -127
- data/spec/watirspec/lib/spec_helper.rb +0 -79
- data/spec/watirspec/lib/watirspec.rb +0 -72
- data/spec/watirspec/link_spec.rb +0 -168
- data/spec/watirspec/links_spec.rb +0 -35
- data/spec/watirspec/lis_spec.rb +0 -31
- data/spec/watirspec/map_spec.rb +0 -76
- data/spec/watirspec/maps_spec.rb +0 -32
- data/spec/watirspec/meta_spec.rb +0 -22
- data/spec/watirspec/metas_spec.rb +0 -30
- data/spec/watirspec/ol_spec.rb +0 -78
- data/spec/watirspec/ols_spec.rb +0 -31
- data/spec/watirspec/option_spec.rb +0 -173
- data/spec/watirspec/p_spec.rb +0 -128
- data/spec/watirspec/pre_spec.rb +0 -112
- data/spec/watirspec/pres_spec.rb +0 -31
- data/spec/watirspec/ps_spec.rb +0 -31
- data/spec/watirspec/radio_spec.rb +0 -255
- data/spec/watirspec/radios_spec.rb +0 -32
- data/spec/watirspec/select_list_spec.rb +0 -318
- data/spec/watirspec/select_lists_spec.rb +0 -35
- data/spec/watirspec/span_spec.rb +0 -142
- data/spec/watirspec/spans_spec.rb +0 -31
- data/spec/watirspec/spec_helper.rb +0 -17
- data/spec/watirspec/strong_spec.rb +0 -89
- data/spec/watirspec/strongs_spec.rb +0 -32
- data/spec/watirspec/table_bodies_spec.rb +0 -45
- data/spec/watirspec/table_body_spec.rb +0 -98
- data/spec/watirspec/table_cell_spec.rb +0 -68
- data/spec/watirspec/table_cells_spec.rb +0 -47
- data/spec/watirspec/table_footer_spec.rb +0 -85
- data/spec/watirspec/table_footers_spec.rb +0 -47
- data/spec/watirspec/table_header_spec.rb +0 -85
- data/spec/watirspec/table_headers_spec.rb +0 -45
- data/spec/watirspec/table_row_spec.rb +0 -87
- data/spec/watirspec/table_rows_spec.rb +0 -50
- data/spec/watirspec/table_spec.rb +0 -160
- data/spec/watirspec/tables_spec.rb +0 -33
- data/spec/watirspec/text_field_spec.rb +0 -276
- data/spec/watirspec/text_fields_spec.rb +0 -35
- data/spec/watirspec/ul_spec.rb +0 -76
- data/spec/watirspec/uls_spec.rb +0 -33
- 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
|