celerity 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +33 -0
- data/README.txt +19 -9
- data/Rakefile +9 -3
- data/lib/celerity.rb +39 -39
- data/lib/celerity/browser.rb +538 -153
- data/lib/celerity/clickable_element.rb +48 -7
- data/lib/celerity/collections.rb +155 -131
- data/lib/celerity/container.rb +766 -385
- data/lib/celerity/default_viewer.rb +10 -0
- data/lib/celerity/disabled_element.rb +19 -2
- data/lib/celerity/element.rb +152 -83
- data/lib/celerity/element_collection.rb +106 -0
- data/lib/celerity/element_locator.rb +89 -66
- data/lib/celerity/elements/button.rb +23 -13
- data/lib/celerity/elements/file_field.rb +17 -5
- data/lib/celerity/elements/form.rb +21 -16
- data/lib/celerity/elements/frame.rb +75 -53
- data/lib/celerity/elements/image.rb +76 -63
- data/lib/celerity/elements/label.rb +4 -2
- data/lib/celerity/elements/link.rb +30 -18
- data/lib/celerity/elements/meta.rb +6 -0
- data/lib/celerity/{non_control_elements.rb → elements/non_control_elements.rb} +106 -76
- data/lib/celerity/elements/option.rb +16 -2
- data/lib/celerity/elements/radio_check.rb +55 -20
- data/lib/celerity/elements/select_list.rb +65 -29
- data/lib/celerity/elements/table.rb +141 -94
- data/lib/celerity/elements/table_cell.rb +13 -6
- data/lib/celerity/elements/{table_body.rb → table_elements.rb} +20 -8
- data/lib/celerity/elements/table_row.rb +23 -7
- data/lib/celerity/elements/text_field.rb +89 -33
- data/lib/celerity/exception.rb +77 -41
- data/lib/celerity/extra/method_generator.rb +42 -24
- data/lib/celerity/htmlunit.rb +49 -0
- data/lib/celerity/htmlunit/commons-collections-3.2.1.jar +0 -0
- data/lib/celerity/htmlunit/htmlunit-2.5-SNAPSHOT.jar +0 -0
- data/lib/celerity/htmlunit/htmlunit-core-js-2.5-SNAPSHOT.jar +0 -0
- data/lib/celerity/htmlunit/nekohtml-1.9.12-20090308.130127-11.jar +0 -0
- data/lib/celerity/htmlunit/serializer-2.7.1.jar +0 -0
- data/lib/celerity/htmlunit/xalan-2.7.1.jar +0 -0
- data/lib/celerity/htmlunit/xml-apis-1.3.04.jar +0 -0
- data/lib/celerity/identifier.rb +3 -2
- data/lib/celerity/input_element.rb +5 -5
- data/lib/celerity/listener.rb +135 -0
- data/lib/celerity/resources/no_viewer.png +0 -0
- data/lib/celerity/util.rb +88 -0
- data/lib/celerity/version.rb +4 -3
- data/lib/celerity/watir_compatibility.rb +35 -25
- data/tasks/jar.rake +57 -0
- metadata +35 -142
- data.tar.gz.sig +0 -0
- data/Manifest.txt +0 -150
- data/lib/celerity/element_collections.rb +0 -54
- data/lib/celerity/element_map.rb +0 -51
- data/lib/celerity/elements/table_footer.rb +0 -30
- data/lib/celerity/elements/table_header.rb +0 -30
- data/lib/celerity/htmlunit/commons-collections-3.2.jar +0 -0
- data/lib/celerity/htmlunit/download.sh +0 -23
- data/lib/celerity/htmlunit/htmlunit-2.2.jar +0 -0
- data/lib/celerity/htmlunit/htmlunit-core-js-2.2.jar +0 -0
- data/lib/celerity/htmlunit/nekohtml-1.9.8.jar +0 -0
- data/lib/celerity/htmlunit/xalan-2.7.0.jar +0 -0
- data/lib/celerity/htmlunit/xml-apis-1.0.b2.jar +0 -0
- data/spec/area_spec.rb +0 -97
- data/spec/areas_spec.rb +0 -40
- data/spec/browser_spec.rb +0 -266
- data/spec/button_spec.rb +0 -227
- data/spec/buttons_spec.rb +0 -39
- data/spec/checkbox_spec.rb +0 -302
- data/spec/checkboxes_spec.rb +0 -38
- data/spec/div_spec.rb +0 -207
- data/spec/divs_spec.rb +0 -39
- data/spec/element_spec.rb +0 -79
- data/spec/filefield_spec.rb +0 -123
- data/spec/filefields_spec.rb +0 -40
- data/spec/form_spec.rb +0 -59
- data/spec/forms_spec.rb +0 -41
- data/spec/frame_spec.rb +0 -121
- data/spec/frames_spec.rb +0 -71
- data/spec/hidden_spec.rb +0 -127
- data/spec/hiddens_spec.rb +0 -39
- data/spec/hn_spec.rb +0 -104
- data/spec/hns_spec.rb +0 -45
- data/spec/html/2000_spans.html +0 -2009
- data/spec/html/bug_duplicate_attributes.html +0 -14
- data/spec/html/bug_javascript_001.html +0 -11
- data/spec/html/form_js_bug.html +0 -11
- data/spec/html/forms_with_input_elements.html +0 -114
- data/spec/html/frame_1.html +0 -17
- data/spec/html/frame_2.html +0 -16
- data/spec/html/frames.html +0 -11
- data/spec/html/iframes.html +0 -12
- data/spec/html/images.html +0 -27
- data/spec/html/images/1.gif +0 -0
- data/spec/html/images/2.gif +0 -0
- data/spec/html/images/3.gif +0 -0
- data/spec/html/images/button.jpg +0 -0
- data/spec/html/images/circle.jpg +0 -0
- data/spec/html/images/map.gif +0 -0
- data/spec/html/images/map2.gif +0 -0
- data/spec/html/images/minus.gif +0 -0
- data/spec/html/images/originaltriangle.jpg +0 -0
- data/spec/html/images/plus.gif +0 -0
- data/spec/html/images/square.jpg +0 -0
- data/spec/html/images/triangle.jpg +0 -0
- data/spec/html/invalid_js.html +0 -11
- data/spec/html/latin1_text.html +0 -17
- data/spec/html/non_control_elements.html +0 -115
- data/spec/html/simple_ajax.html +0 -22
- data/spec/html/tables.html +0 -119
- data/spec/html/utf8_text.html +0 -15
- data/spec/htmlunit_spec.rb +0 -26
- data/spec/image_spec.rb +0 -220
- data/spec/images_spec.rb +0 -39
- data/spec/label_spec.rb +0 -79
- data/spec/labels_spec.rb +0 -40
- data/spec/li_spec.rb +0 -139
- data/spec/link_spec.rb +0 -189
- data/spec/links_spec.rb +0 -43
- data/spec/lis_spec.rb +0 -40
- data/spec/map_spec.rb +0 -102
- data/spec/maps_spec.rb +0 -40
- data/spec/meta_spec.rb +0 -8
- data/spec/ol_spec.rb +0 -87
- data/spec/ols_spec.rb +0 -40
- data/spec/option_spec.rb +0 -154
- data/spec/p_spec.rb +0 -171
- data/spec/pre_spec.rb +0 -135
- data/spec/pres_spec.rb +0 -40
- data/spec/ps_spec.rb +0 -40
- data/spec/radio_spec.rb +0 -299
- data/spec/radios_spec.rb +0 -42
- data/spec/select_list_spec.rb +0 -299
- data/spec/select_lists_spec.rb +0 -47
- data/spec/span_spec.rb +0 -184
- data/spec/spans_spec.rb +0 -64
- data/spec/spec.opts +0 -1
- data/spec/spec_helper.rb +0 -55
- data/spec/table_bodies_spec.rb +0 -57
- data/spec/table_body_spec.rb +0 -111
- data/spec/table_cell_spec.rb +0 -74
- data/spec/table_cells_spec.rb +0 -59
- data/spec/table_footer_spec.rb +0 -101
- data/spec/table_footers_spec.rb +0 -55
- data/spec/table_header_spec.rb +0 -101
- data/spec/table_headers_spec.rb +0 -55
- data/spec/table_row_spec.rb +0 -104
- data/spec/table_rows_spec.rb +0 -58
- data/spec/table_spec.rb +0 -160
- data/spec/tables_spec.rb +0 -42
- data/spec/text_field_spec.rb +0 -323
- data/spec/text_fields_spec.rb +0 -44
- data/spec/ul_spec.rb +0 -88
- data/spec/uls_spec.rb +0 -40
- data/spec/watir_compatibility_spec.rb +0 -260
- data/support/spec_server.rb +0 -73
- data/tasks/rspec.rake +0 -30
- data/tasks/specserver.rake +0 -21
- metadata.gz.sig +0 -0
@@ -1,12 +1,53 @@
|
|
1
1
|
module Celerity
|
2
2
|
module ClickableElement
|
3
|
-
|
4
|
-
#
|
3
|
+
|
4
|
+
#
|
5
|
+
# click the element
|
6
|
+
#
|
7
|
+
|
5
8
|
def click
|
6
|
-
|
7
|
-
assert_enabled
|
9
|
+
assert_exists_and_enabled
|
8
10
|
@container.update_page(@object.click)
|
9
|
-
end
|
10
|
-
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# double click the element (Celerity only)
|
15
|
+
#
|
16
|
+
|
17
|
+
def double_click
|
18
|
+
assert_exists_and_enabled
|
19
|
+
@container.update_page(@object.dblClick)
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# right click the element (Celerity only)
|
24
|
+
#
|
25
|
+
|
26
|
+
def right_click
|
27
|
+
assert_exists_and_enabled
|
28
|
+
@container.update_page(@object.rightClick)
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Click the element and return a new Browser instance with the resulting page.
|
33
|
+
# This is useful for elements that trigger popups when clicked.
|
34
|
+
#
|
35
|
+
# @return [Celerity::Browser]
|
36
|
+
#
|
37
|
+
|
38
|
+
def click_and_attach
|
39
|
+
assert_exists_and_enabled
|
40
|
+
browser = Browser.new(:log_level => @browser.log_level)
|
41
|
+
browser.update_page(@object.click)
|
42
|
+
|
43
|
+
browser
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def assert_exists_and_enabled
|
49
|
+
assert_exists
|
50
|
+
assert_enabled if respond_to?(:assert_enabled)
|
51
|
+
end
|
11
52
|
end
|
12
|
-
end
|
53
|
+
end
|
data/lib/celerity/collections.rb
CHANGED
@@ -1,132 +1,156 @@
|
|
1
|
-
module Celerity
|
2
|
-
|
3
|
-
class Frames <
|
4
|
-
def element_class; Frame; end
|
5
|
-
end
|
6
|
-
|
7
|
-
class Buttons <
|
8
|
-
def element_class; Button; end
|
9
|
-
end
|
10
|
-
|
11
|
-
class FileFields <
|
12
|
-
def element_class; FileField; end
|
13
|
-
end
|
14
|
-
|
15
|
-
class CheckBoxes <
|
16
|
-
def element_class; CheckBox; end
|
17
|
-
end
|
18
|
-
|
19
|
-
class Radios <
|
20
|
-
def element_class; Radio; end
|
21
|
-
end
|
22
|
-
|
23
|
-
class SelectLists <
|
24
|
-
def element_class; SelectList; end
|
25
|
-
end
|
26
|
-
|
27
|
-
class Links <
|
28
|
-
def element_class; Link; end
|
29
|
-
end
|
30
|
-
|
31
|
-
class Uls <
|
32
|
-
def element_class; Ul; end
|
33
|
-
end
|
34
|
-
|
35
|
-
class Ols <
|
36
|
-
def element_class; Ol; end
|
37
|
-
end
|
38
|
-
|
39
|
-
class Lis <
|
40
|
-
def element_class; Li; end
|
41
|
-
end
|
42
|
-
|
43
|
-
class
|
44
|
-
def element_class;
|
45
|
-
end
|
46
|
-
|
47
|
-
class
|
48
|
-
def element_class;
|
49
|
-
end
|
50
|
-
|
51
|
-
class
|
52
|
-
def element_class;
|
53
|
-
end
|
54
|
-
|
55
|
-
class
|
56
|
-
def element_class;
|
57
|
-
end
|
58
|
-
|
59
|
-
class
|
60
|
-
def element_class;
|
61
|
-
end
|
62
|
-
|
63
|
-
class
|
64
|
-
def element_class;
|
65
|
-
end
|
66
|
-
|
67
|
-
class
|
68
|
-
def element_class;
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
class
|
90
|
-
def element_class;
|
91
|
-
end
|
92
|
-
|
93
|
-
class
|
94
|
-
def element_class;
|
95
|
-
end
|
96
|
-
|
97
|
-
class
|
98
|
-
def element_class;
|
99
|
-
end
|
100
|
-
|
101
|
-
class
|
102
|
-
def element_class;
|
103
|
-
end
|
104
|
-
|
105
|
-
class
|
106
|
-
def element_class;
|
107
|
-
end
|
108
|
-
|
109
|
-
class
|
110
|
-
def element_class;
|
111
|
-
end
|
112
|
-
|
113
|
-
class
|
114
|
-
def element_class;
|
115
|
-
end
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
class
|
126
|
-
def element_class;
|
127
|
-
end
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
1
|
+
module Celerity
|
2
|
+
|
3
|
+
class Frames < ElementCollection
|
4
|
+
def element_class; Frame; end
|
5
|
+
end
|
6
|
+
|
7
|
+
class Buttons < ElementCollection
|
8
|
+
def element_class; Button; end
|
9
|
+
end
|
10
|
+
|
11
|
+
class FileFields < ElementCollection
|
12
|
+
def element_class; FileField; end
|
13
|
+
end
|
14
|
+
|
15
|
+
class CheckBoxes < ElementCollection
|
16
|
+
def element_class; CheckBox; end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Radios < ElementCollection
|
20
|
+
def element_class; Radio; end
|
21
|
+
end
|
22
|
+
|
23
|
+
class SelectLists < ElementCollection
|
24
|
+
def element_class; SelectList; end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Links < ElementCollection
|
28
|
+
def element_class; Link; end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Uls < ElementCollection
|
32
|
+
def element_class; Ul; end
|
33
|
+
end
|
34
|
+
|
35
|
+
class Ols < ElementCollection
|
36
|
+
def element_class; Ol; end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Lis < ElementCollection
|
40
|
+
def element_class; Li; end
|
41
|
+
end
|
42
|
+
|
43
|
+
class Dds < ElementCollection
|
44
|
+
def element_class; Dd; end
|
45
|
+
end
|
46
|
+
|
47
|
+
class Dls < ElementCollection
|
48
|
+
def element_class; Dl; end
|
49
|
+
end
|
50
|
+
|
51
|
+
class Dts < ElementCollection
|
52
|
+
def element_class; Dt; end
|
53
|
+
end
|
54
|
+
|
55
|
+
class Ems < ElementCollection
|
56
|
+
def element_class; Em; end
|
57
|
+
end
|
58
|
+
|
59
|
+
class Maps < ElementCollection
|
60
|
+
def element_class; Map; end
|
61
|
+
end
|
62
|
+
|
63
|
+
class Areas < ElementCollection
|
64
|
+
def element_class; Area; end
|
65
|
+
end
|
66
|
+
|
67
|
+
class Images < ElementCollection
|
68
|
+
def element_class; Image; end
|
69
|
+
end
|
70
|
+
|
71
|
+
class TextFields < ElementCollection
|
72
|
+
def element_class; TextField; end
|
73
|
+
end
|
74
|
+
|
75
|
+
class Hiddens < ElementCollection
|
76
|
+
def element_class; Hidden; end
|
77
|
+
end
|
78
|
+
|
79
|
+
class Tables < ElementCollection
|
80
|
+
def element_class; Table; end
|
81
|
+
end
|
82
|
+
|
83
|
+
class TableHeaders < ElementCollection
|
84
|
+
def element_class; TableHeader; end
|
85
|
+
end
|
86
|
+
class TableBodies < ElementCollection
|
87
|
+
def element_class; TableBody; end
|
88
|
+
end
|
89
|
+
class TableFooters < ElementCollection
|
90
|
+
def element_class; TableFooter; end
|
91
|
+
end
|
92
|
+
|
93
|
+
class TableRows < ElementCollection
|
94
|
+
def element_class; TableRow; end
|
95
|
+
end
|
96
|
+
|
97
|
+
class TableCells < ElementCollection
|
98
|
+
def element_class; TableCell; end
|
99
|
+
end
|
100
|
+
|
101
|
+
class Labels < ElementCollection
|
102
|
+
def element_class; Label; end
|
103
|
+
end
|
104
|
+
|
105
|
+
class Pres < ElementCollection
|
106
|
+
def element_class; Pre; end
|
107
|
+
end
|
108
|
+
|
109
|
+
class Ps < ElementCollection
|
110
|
+
def element_class; P; end
|
111
|
+
end
|
112
|
+
|
113
|
+
class Spans < ElementCollection
|
114
|
+
def element_class; Span; end
|
115
|
+
end
|
116
|
+
|
117
|
+
class Strongs < ElementCollection
|
118
|
+
def element_class; Strong; end
|
119
|
+
end
|
120
|
+
|
121
|
+
class Divs < ElementCollection
|
122
|
+
def element_class; Div; end
|
123
|
+
end
|
124
|
+
|
125
|
+
class Forms < ElementCollection
|
126
|
+
def element_class; Form; end
|
127
|
+
end
|
128
|
+
|
129
|
+
class Options < ElementCollection
|
130
|
+
def element_class; Option; end
|
131
|
+
end
|
132
|
+
|
133
|
+
class Metas < ElementCollection
|
134
|
+
def element_class; Meta; end
|
135
|
+
end
|
136
|
+
|
137
|
+
class H1s < ElementCollection
|
138
|
+
def element_class; H1; end
|
139
|
+
end
|
140
|
+
class H2s < ElementCollection
|
141
|
+
def element_class; H2; end
|
142
|
+
end
|
143
|
+
class H3s < ElementCollection
|
144
|
+
def element_class; H3; end
|
145
|
+
end
|
146
|
+
class H4s < ElementCollection
|
147
|
+
def element_class; H4; end
|
148
|
+
end
|
149
|
+
class H5s < ElementCollection
|
150
|
+
def element_class; H5; end
|
151
|
+
end
|
152
|
+
class H6s < ElementCollection
|
153
|
+
def element_class; H6; end
|
154
|
+
end
|
155
|
+
|
132
156
|
end
|
data/lib/celerity/container.rb
CHANGED
@@ -1,385 +1,766 @@
|
|
1
|
-
module Celerity
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# The most common syntax is
|
7
|
-
# browser.elem(:attribute, 'value')
|
8
|
-
#
|
9
|
-
# Note that the element is located lazily, so no exceptions will be
|
10
|
-
# if the element doesn't exist until you call a method on the resulting object.
|
11
|
-
# To do this you would normally use
|
12
|
-
# like
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
def
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
end
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
end
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
def
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
end
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
def
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
end
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
def form(*args)
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
end
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
def
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
end
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
def
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
end
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
def
|
381
|
-
|
382
|
-
end
|
383
|
-
|
384
|
-
|
385
|
-
|
1
|
+
module Celerity
|
2
|
+
|
3
|
+
#
|
4
|
+
# This class contains methods for accessing elements inside a container,
|
5
|
+
# usually the Browser object, meaning the current page.
|
6
|
+
# The most common syntax is
|
7
|
+
# browser.elem(:attribute, 'value')
|
8
|
+
#
|
9
|
+
# Note that the element is located lazily, so no exceptions will be raised
|
10
|
+
# if the element doesn't exist until you call a method on the resulting object.
|
11
|
+
# To do this you would normally use Element#exists? or an action method,
|
12
|
+
# like ClickableElement#click.
|
13
|
+
# You can also pass in a hash:
|
14
|
+
#
|
15
|
+
# browser.link(:index => 1).click
|
16
|
+
#
|
17
|
+
# All elements support multiple attributes identification using the
|
18
|
+
# hash syntax (though this might not always be compatible with Watir):
|
19
|
+
#
|
20
|
+
# browser.span(:class_name => 'product', :index => 5).text
|
21
|
+
#
|
22
|
+
# Checkboxes and radio buttons support a special three-argument syntax:
|
23
|
+
#
|
24
|
+
# browser.check_box(:name, 'a_name', '1234').set
|
25
|
+
#
|
26
|
+
# You can also get all the elements of a certain type by using the plural form (@see Celerity::ElementCollection):
|
27
|
+
#
|
28
|
+
# browser.links # => #<Celerity::Links:0x7a1c2da2 ...>
|
29
|
+
#
|
30
|
+
|
31
|
+
module Container
|
32
|
+
include Celerity::Exception
|
33
|
+
|
34
|
+
# Points back to the Browser instance that contains this element
|
35
|
+
attr_reader :browser
|
36
|
+
|
37
|
+
#
|
38
|
+
# Check if the element contains the given text.
|
39
|
+
#
|
40
|
+
# @param [String, Regexp] expected_text The text to look for.
|
41
|
+
# @return [Fixnum, nil] The index of the matched text, or nil if it doesn't match.
|
42
|
+
#
|
43
|
+
|
44
|
+
def contains_text(expected_text)
|
45
|
+
assert_exists
|
46
|
+
return nil unless respond_to? :text
|
47
|
+
|
48
|
+
case expected_text
|
49
|
+
when Regexp
|
50
|
+
text() =~ expected_text
|
51
|
+
when String
|
52
|
+
text().index(expected_text)
|
53
|
+
else
|
54
|
+
raise TypeError, "expected String or Regexp, got #{expected_text.inspect}:#{expected_text.class}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Used internally to update the container object.
|
60
|
+
# @api private
|
61
|
+
#
|
62
|
+
|
63
|
+
def container=(container)
|
64
|
+
@container = container
|
65
|
+
@browser = container.browser
|
66
|
+
container
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# Used internally to update the page object.
|
71
|
+
# @api private
|
72
|
+
#
|
73
|
+
|
74
|
+
def update_page(page)
|
75
|
+
@browser.page = page
|
76
|
+
end
|
77
|
+
|
78
|
+
#
|
79
|
+
# Used internally.
|
80
|
+
#
|
81
|
+
# @param [String] string The string to match against.
|
82
|
+
# @param [Regexp, String, #to_s] what The match we're looking for.
|
83
|
+
# @return [Fixnum, true, false, nil]
|
84
|
+
#
|
85
|
+
# @api private
|
86
|
+
#
|
87
|
+
|
88
|
+
def matches?(string, what)
|
89
|
+
Regexp === what ? string =~ what : string == what.to_s
|
90
|
+
end
|
91
|
+
|
92
|
+
#--
|
93
|
+
# below methods sorted alphabetically
|
94
|
+
#++
|
95
|
+
|
96
|
+
#
|
97
|
+
# @return [Celerity::Area]
|
98
|
+
#
|
99
|
+
|
100
|
+
def area(*args)
|
101
|
+
Area.new(self, *args)
|
102
|
+
end
|
103
|
+
|
104
|
+
#
|
105
|
+
# @return [Celerity::Areas]
|
106
|
+
#
|
107
|
+
|
108
|
+
def areas
|
109
|
+
Areas.new(self)
|
110
|
+
end
|
111
|
+
|
112
|
+
#
|
113
|
+
# @return [Celerity::Button]
|
114
|
+
#
|
115
|
+
|
116
|
+
def button(*args)
|
117
|
+
Button.new(self, *args)
|
118
|
+
end
|
119
|
+
|
120
|
+
#
|
121
|
+
# @return [Celerity::Buttons]
|
122
|
+
#
|
123
|
+
|
124
|
+
def buttons
|
125
|
+
Buttons.new(self)
|
126
|
+
end
|
127
|
+
|
128
|
+
#
|
129
|
+
# @return [Celerity::TableCell]
|
130
|
+
#
|
131
|
+
|
132
|
+
def cell(*args)
|
133
|
+
TableCell.new(self, *args)
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# @return [Celerity::TableCells]
|
138
|
+
#
|
139
|
+
|
140
|
+
def cells
|
141
|
+
TableCells.new(self)
|
142
|
+
end
|
143
|
+
|
144
|
+
#
|
145
|
+
# Since finding checkboxes by value is very common, you can use this shorthand:
|
146
|
+
#
|
147
|
+
# browser.check_box(:name, 'a_name', '1234').set
|
148
|
+
#
|
149
|
+
# or
|
150
|
+
#
|
151
|
+
# browser.check_box(:name => 'a_name', :value => '1234').set
|
152
|
+
#
|
153
|
+
# @return [Celerity::CheckBox]
|
154
|
+
#
|
155
|
+
|
156
|
+
def check_box(*args)
|
157
|
+
CheckBox.new(self, *args)
|
158
|
+
end
|
159
|
+
|
160
|
+
#
|
161
|
+
# @return [Celerity::CheckBoxes]
|
162
|
+
#
|
163
|
+
|
164
|
+
def checkboxes
|
165
|
+
CheckBoxes.new(self)
|
166
|
+
end
|
167
|
+
|
168
|
+
#
|
169
|
+
# @return [Celerity::Dd]
|
170
|
+
#
|
171
|
+
|
172
|
+
def dd(*args)
|
173
|
+
Dd.new(self, *args)
|
174
|
+
end
|
175
|
+
|
176
|
+
#
|
177
|
+
# @return [Celerity::Dds]
|
178
|
+
#
|
179
|
+
|
180
|
+
def dds
|
181
|
+
Dds.new(self)
|
182
|
+
end
|
183
|
+
|
184
|
+
#
|
185
|
+
# @return [Celerity::Div]
|
186
|
+
#
|
187
|
+
|
188
|
+
def div(*args)
|
189
|
+
Div.new(self, *args)
|
190
|
+
end
|
191
|
+
|
192
|
+
#
|
193
|
+
# @return [Celerity::Divs]
|
194
|
+
#
|
195
|
+
|
196
|
+
def divs
|
197
|
+
Divs.new(self)
|
198
|
+
end
|
199
|
+
|
200
|
+
#
|
201
|
+
# @return [Celerity::Dl]
|
202
|
+
#
|
203
|
+
|
204
|
+
def dl(*args)
|
205
|
+
Dl.new(self, *args)
|
206
|
+
end
|
207
|
+
|
208
|
+
#
|
209
|
+
# @return [Celerity::Dls]
|
210
|
+
#
|
211
|
+
|
212
|
+
def dls
|
213
|
+
Dls.new(self)
|
214
|
+
end
|
215
|
+
|
216
|
+
#
|
217
|
+
# @return [Celerity::Dt]
|
218
|
+
#
|
219
|
+
|
220
|
+
def dt(*args)
|
221
|
+
Dt.new(self, *args)
|
222
|
+
end
|
223
|
+
|
224
|
+
#
|
225
|
+
# @return [Celerity::Dts]
|
226
|
+
#
|
227
|
+
|
228
|
+
def dts
|
229
|
+
Dts.new(self)
|
230
|
+
end
|
231
|
+
|
232
|
+
#
|
233
|
+
# @return [Celerity::Em]
|
234
|
+
#
|
235
|
+
|
236
|
+
def em(*args)
|
237
|
+
Em.new(self, *args)
|
238
|
+
end
|
239
|
+
|
240
|
+
#
|
241
|
+
# @return [Celerity::Ems]
|
242
|
+
#
|
243
|
+
|
244
|
+
def ems
|
245
|
+
Ems.new(self)
|
246
|
+
end
|
247
|
+
|
248
|
+
#
|
249
|
+
# @return [Celerity::FileField]
|
250
|
+
#
|
251
|
+
|
252
|
+
def file_field(*args)
|
253
|
+
FileField.new(self, *args)
|
254
|
+
end
|
255
|
+
|
256
|
+
#
|
257
|
+
# @return [Celerity::FileFields]
|
258
|
+
#
|
259
|
+
|
260
|
+
def file_fields
|
261
|
+
FileFields.new(self)
|
262
|
+
end
|
263
|
+
|
264
|
+
#
|
265
|
+
# @return [Celerity::Form]
|
266
|
+
#
|
267
|
+
|
268
|
+
def form(*args)
|
269
|
+
Form.new(self, *args)
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# @return [Celerity::Forms]
|
274
|
+
#
|
275
|
+
|
276
|
+
def forms
|
277
|
+
Forms.new(self)
|
278
|
+
end
|
279
|
+
|
280
|
+
#
|
281
|
+
# @return [Celerity::Frame]
|
282
|
+
#
|
283
|
+
|
284
|
+
def frame(*args)
|
285
|
+
Frame.new(self, *args)
|
286
|
+
end
|
287
|
+
|
288
|
+
#
|
289
|
+
# @return [Celerity::Frames]
|
290
|
+
#
|
291
|
+
|
292
|
+
def frames
|
293
|
+
Frames.new(self)
|
294
|
+
end
|
295
|
+
|
296
|
+
#
|
297
|
+
# @return [Celerity::H1]
|
298
|
+
#
|
299
|
+
|
300
|
+
def h1(*args)
|
301
|
+
H1.new(self, *args)
|
302
|
+
end
|
303
|
+
|
304
|
+
#
|
305
|
+
# @return [Celerity::H1s]
|
306
|
+
#
|
307
|
+
|
308
|
+
def h1s
|
309
|
+
H1s.new(self)
|
310
|
+
end
|
311
|
+
|
312
|
+
#
|
313
|
+
# @return [Celerity::H2]
|
314
|
+
#
|
315
|
+
|
316
|
+
def h2(*args)
|
317
|
+
H2.new(self, *args)
|
318
|
+
end
|
319
|
+
|
320
|
+
#
|
321
|
+
# @return [Celerity::H2s]
|
322
|
+
#
|
323
|
+
|
324
|
+
def h2s
|
325
|
+
H2s.new(self)
|
326
|
+
end
|
327
|
+
|
328
|
+
#
|
329
|
+
# @return [Celerity::H3]
|
330
|
+
#
|
331
|
+
|
332
|
+
def h3(*args)
|
333
|
+
H3.new(self, *args)
|
334
|
+
end
|
335
|
+
|
336
|
+
#
|
337
|
+
# @return [Celerity::H3s]
|
338
|
+
#
|
339
|
+
|
340
|
+
def h3s
|
341
|
+
H3s.new(self)
|
342
|
+
end
|
343
|
+
|
344
|
+
#
|
345
|
+
# @return [Celerity::H4]
|
346
|
+
#
|
347
|
+
|
348
|
+
def h4(*args)
|
349
|
+
H4.new(self, *args)
|
350
|
+
end
|
351
|
+
|
352
|
+
#
|
353
|
+
# @return [Celerity::H4s]
|
354
|
+
#
|
355
|
+
|
356
|
+
def h4s
|
357
|
+
H4s.new(self)
|
358
|
+
end
|
359
|
+
|
360
|
+
#
|
361
|
+
# @return [Celerity::H5]
|
362
|
+
#
|
363
|
+
|
364
|
+
def h5(*args)
|
365
|
+
H5.new(self, *args)
|
366
|
+
end
|
367
|
+
|
368
|
+
#
|
369
|
+
# @return [Celerity::H5s]
|
370
|
+
#
|
371
|
+
|
372
|
+
def h5s
|
373
|
+
H5s.new(self)
|
374
|
+
end
|
375
|
+
|
376
|
+
#
|
377
|
+
# @return [Celerity::H6]
|
378
|
+
#
|
379
|
+
|
380
|
+
def h6(*args)
|
381
|
+
H6.new(self, *args)
|
382
|
+
end
|
383
|
+
|
384
|
+
#
|
385
|
+
# @return [Celerity::H6s]
|
386
|
+
#
|
387
|
+
|
388
|
+
def h6s
|
389
|
+
H6s.new(self)
|
390
|
+
end
|
391
|
+
|
392
|
+
#
|
393
|
+
# @return [Celerity::Hidden]
|
394
|
+
#
|
395
|
+
|
396
|
+
def hidden(*args)
|
397
|
+
Hidden.new(self, *args)
|
398
|
+
end
|
399
|
+
|
400
|
+
#
|
401
|
+
# @return [Celerity::Hiddens]
|
402
|
+
#
|
403
|
+
|
404
|
+
def hiddens
|
405
|
+
Hiddens.new(self)
|
406
|
+
end
|
407
|
+
|
408
|
+
#
|
409
|
+
# @return [Celerity::Image]
|
410
|
+
#
|
411
|
+
|
412
|
+
def image(*args)
|
413
|
+
Image.new(self, *args)
|
414
|
+
end
|
415
|
+
|
416
|
+
#
|
417
|
+
# @return [Celerity::Images]
|
418
|
+
#
|
419
|
+
|
420
|
+
def images
|
421
|
+
Images.new(self)
|
422
|
+
end
|
423
|
+
|
424
|
+
#
|
425
|
+
# @return [Celerity::Label]
|
426
|
+
#
|
427
|
+
|
428
|
+
def label(*args)
|
429
|
+
Label.new(self, *args)
|
430
|
+
end
|
431
|
+
|
432
|
+
#
|
433
|
+
# @return [Celerity::Labels]
|
434
|
+
#
|
435
|
+
|
436
|
+
def labels
|
437
|
+
Labels.new(self)
|
438
|
+
end
|
439
|
+
|
440
|
+
#
|
441
|
+
# @return [Celerity::Li]
|
442
|
+
#
|
443
|
+
|
444
|
+
def li(*args)
|
445
|
+
Li.new(self, *args)
|
446
|
+
end
|
447
|
+
|
448
|
+
#
|
449
|
+
# @return [Celerity::Lis]
|
450
|
+
#
|
451
|
+
|
452
|
+
def lis
|
453
|
+
Lis.new(self)
|
454
|
+
end
|
455
|
+
|
456
|
+
#
|
457
|
+
# @return [Celerity::Link]
|
458
|
+
#
|
459
|
+
|
460
|
+
def link(*args)
|
461
|
+
Link.new(self, *args)
|
462
|
+
end
|
463
|
+
|
464
|
+
#
|
465
|
+
# @return [Celerity::Links]
|
466
|
+
#
|
467
|
+
|
468
|
+
def links
|
469
|
+
Links.new(self)
|
470
|
+
end
|
471
|
+
|
472
|
+
#
|
473
|
+
# @return [Celerity::Map]
|
474
|
+
#
|
475
|
+
|
476
|
+
def map(*args)
|
477
|
+
Map.new(self, *args)
|
478
|
+
end
|
479
|
+
|
480
|
+
#
|
481
|
+
# @return [Celerity::Maps]
|
482
|
+
#
|
483
|
+
|
484
|
+
def maps
|
485
|
+
Maps.new(self)
|
486
|
+
end
|
487
|
+
|
488
|
+
#
|
489
|
+
# @return [Celerity::Meta]
|
490
|
+
#
|
491
|
+
|
492
|
+
def meta(*args)
|
493
|
+
Meta.new(self, *args)
|
494
|
+
end
|
495
|
+
|
496
|
+
#
|
497
|
+
# @return [Celerity::Metas]
|
498
|
+
#
|
499
|
+
|
500
|
+
def metas(*args)
|
501
|
+
Metas.new(self, *args)
|
502
|
+
end
|
503
|
+
|
504
|
+
#
|
505
|
+
# @return [Celerity::Ol]
|
506
|
+
#
|
507
|
+
|
508
|
+
def ol(*args)
|
509
|
+
Ol.new(self, *args)
|
510
|
+
end
|
511
|
+
|
512
|
+
#
|
513
|
+
# @return [Celerity::Ols]
|
514
|
+
#
|
515
|
+
|
516
|
+
def ols
|
517
|
+
Ols.new(self)
|
518
|
+
end
|
519
|
+
|
520
|
+
#
|
521
|
+
# @return [Celerity::Option]
|
522
|
+
#
|
523
|
+
|
524
|
+
def option(*args)
|
525
|
+
Option.new(self, *args)
|
526
|
+
end
|
527
|
+
|
528
|
+
#
|
529
|
+
# @return [Celerity::P]
|
530
|
+
#
|
531
|
+
|
532
|
+
def p(*args)
|
533
|
+
P.new(self, *args)
|
534
|
+
end
|
535
|
+
|
536
|
+
#
|
537
|
+
# @return [Celerity::Ps]
|
538
|
+
#
|
539
|
+
|
540
|
+
def ps
|
541
|
+
Ps.new(self)
|
542
|
+
end
|
543
|
+
|
544
|
+
#
|
545
|
+
# @return [Celerity::Pre]
|
546
|
+
#
|
547
|
+
|
548
|
+
def pre(*args)
|
549
|
+
Pre.new(self, *args)
|
550
|
+
end
|
551
|
+
|
552
|
+
#
|
553
|
+
# @return [Celerity::Pres]
|
554
|
+
#
|
555
|
+
|
556
|
+
def pres
|
557
|
+
Pres.new(self)
|
558
|
+
end
|
559
|
+
|
560
|
+
#
|
561
|
+
# Since finding radios by value is very common, you can use this shorthand:
|
562
|
+
#
|
563
|
+
# browser.radio(:name, 'a_name', '1234').set
|
564
|
+
#
|
565
|
+
# or
|
566
|
+
#
|
567
|
+
# browser.radio(:name => 'a_name', :value => '1234').set
|
568
|
+
#
|
569
|
+
# @return [Celerity::Radio]
|
570
|
+
#
|
571
|
+
|
572
|
+
def radio(*args)
|
573
|
+
Radio.new(self, *args)
|
574
|
+
end
|
575
|
+
|
576
|
+
#
|
577
|
+
# @return [Celerity::Radios]
|
578
|
+
#
|
579
|
+
|
580
|
+
def radios
|
581
|
+
Radios.new(self)
|
582
|
+
end
|
583
|
+
|
584
|
+
#
|
585
|
+
# @return [Celerity::TableRow]
|
586
|
+
#
|
587
|
+
|
588
|
+
def row(*args)
|
589
|
+
TableRow.new(self, *args)
|
590
|
+
end
|
591
|
+
|
592
|
+
#
|
593
|
+
# @return [Celerity::TableRows]
|
594
|
+
#
|
595
|
+
|
596
|
+
def rows
|
597
|
+
TableRows.new(self)
|
598
|
+
end
|
599
|
+
|
600
|
+
#
|
601
|
+
# @return [Celerity::SelectList]
|
602
|
+
#
|
603
|
+
|
604
|
+
def select_list(*args)
|
605
|
+
SelectList.new(self, *args)
|
606
|
+
end
|
607
|
+
|
608
|
+
#
|
609
|
+
# @return [Celerity::SelectLists]
|
610
|
+
#
|
611
|
+
|
612
|
+
def select_lists
|
613
|
+
SelectLists.new(self)
|
614
|
+
end
|
615
|
+
|
616
|
+
#
|
617
|
+
# @return [Celerity::Span]
|
618
|
+
#
|
619
|
+
|
620
|
+
def span(*args)
|
621
|
+
Span.new(self, *args)
|
622
|
+
end
|
623
|
+
|
624
|
+
#
|
625
|
+
# @return [Celerity::Spans]
|
626
|
+
#
|
627
|
+
|
628
|
+
def spans
|
629
|
+
Spans.new(self)
|
630
|
+
end
|
631
|
+
|
632
|
+
#
|
633
|
+
# @return [Celerity::Spans]
|
634
|
+
#
|
635
|
+
|
636
|
+
def strong(*args)
|
637
|
+
Strong.new(self, *args)
|
638
|
+
end
|
639
|
+
|
640
|
+
#
|
641
|
+
# @return [Celerity::Strongs]
|
642
|
+
#
|
643
|
+
|
644
|
+
def strongs
|
645
|
+
Strongs.new(self)
|
646
|
+
end
|
647
|
+
|
648
|
+
#
|
649
|
+
# @return [Celerity::Table]
|
650
|
+
#
|
651
|
+
|
652
|
+
def table(*args)
|
653
|
+
Table.new(self, *args)
|
654
|
+
end
|
655
|
+
|
656
|
+
#
|
657
|
+
# @return [Celerity::Tables]
|
658
|
+
#
|
659
|
+
|
660
|
+
def tables
|
661
|
+
Tables.new(self)
|
662
|
+
end
|
663
|
+
|
664
|
+
#
|
665
|
+
# @return [Celerity::TableBody]
|
666
|
+
#
|
667
|
+
|
668
|
+
def tbody(*args)
|
669
|
+
TableBody.new(self, *args)
|
670
|
+
end
|
671
|
+
|
672
|
+
#
|
673
|
+
# @return [Celerity::TableBodies]
|
674
|
+
#
|
675
|
+
|
676
|
+
def tbodies
|
677
|
+
TableBodies.new(self)
|
678
|
+
end
|
679
|
+
|
680
|
+
#
|
681
|
+
# @return [Celerity::TextField]
|
682
|
+
#
|
683
|
+
|
684
|
+
def text_field(*args)
|
685
|
+
TextField.new(self, *args)
|
686
|
+
end
|
687
|
+
|
688
|
+
#
|
689
|
+
# @return [Celerity::TextFields]
|
690
|
+
#
|
691
|
+
|
692
|
+
def text_fields
|
693
|
+
TextFields.new(self)
|
694
|
+
end
|
695
|
+
|
696
|
+
#
|
697
|
+
# @return [Celerity::TableFooter]
|
698
|
+
#
|
699
|
+
|
700
|
+
def tfoot(*args)
|
701
|
+
TableFooter.new(self, *args)
|
702
|
+
end
|
703
|
+
|
704
|
+
#
|
705
|
+
# @return [Celerity::TableFooters]
|
706
|
+
#
|
707
|
+
|
708
|
+
def tfoots
|
709
|
+
TableFooters.new(self)
|
710
|
+
end
|
711
|
+
alias_method :tfeet, :tfoots # :-)
|
712
|
+
|
713
|
+
#
|
714
|
+
# Watir's cells() won't find <th> elements.
|
715
|
+
# This is a workaround.
|
716
|
+
#
|
717
|
+
# @return [Celerity::Th]
|
718
|
+
#
|
719
|
+
|
720
|
+
def th(*args)
|
721
|
+
Th.new(self, *args)
|
722
|
+
end
|
723
|
+
|
724
|
+
#
|
725
|
+
# FIXME: implement or change api,
|
726
|
+
# @see th
|
727
|
+
#
|
728
|
+
|
729
|
+
def ths
|
730
|
+
raise NotImplementedError
|
731
|
+
end
|
732
|
+
|
733
|
+
#
|
734
|
+
# @return [Celerity::TableHeader]
|
735
|
+
#
|
736
|
+
|
737
|
+
def thead(*args)
|
738
|
+
TableHeader.new(self, *args)
|
739
|
+
end
|
740
|
+
|
741
|
+
#
|
742
|
+
# @return [Celerity::TableHeaders]
|
743
|
+
#
|
744
|
+
|
745
|
+
def theads
|
746
|
+
TableHeaders.new(self)
|
747
|
+
end
|
748
|
+
|
749
|
+
#
|
750
|
+
# @return [Celerity::Ul]
|
751
|
+
#
|
752
|
+
|
753
|
+
def ul(*args)
|
754
|
+
Ul.new(self, *args)
|
755
|
+
end
|
756
|
+
|
757
|
+
#
|
758
|
+
# @return [Celerity::Uls]
|
759
|
+
#
|
760
|
+
|
761
|
+
def uls
|
762
|
+
Uls.new(self)
|
763
|
+
end
|
764
|
+
|
765
|
+
end # Container
|
766
|
+
end # Celerity
|