page-object 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,52 @@
1
+ === Version 0.7.1 / 2012-7-15
2
+ * Enhancements
3
+ * Added support for the following new elements
4
+ Area
5
+ * Added the following aliased methods to their corresponding Accessors method
6
+ a => link
7
+ hidden => hidden_field
8
+ img => image
9
+ li => list_item
10
+ ol => ordered_list
11
+ p => paragraph
12
+ radio => radio_button
13
+ select => select_list
14
+ td => cell
15
+ textarea => text_area
16
+ ul => unordered_list
17
+ * Added the following methods to return generic Element objects
18
+ abbr
19
+ address
20
+ article
21
+ aside
22
+ bdi
23
+ bdo
24
+ cite
25
+ code
26
+ dd
27
+ dfn
28
+ dt
29
+ em
30
+ figcaption
31
+ figure
32
+ footer
33
+ header
34
+ hgroup
35
+ kbd
36
+ mark
37
+ nav
38
+ noscript
39
+ rp
40
+ rt
41
+ ruby
42
+ samp
43
+ section
44
+ sub
45
+ summary
46
+ sup
47
+ var
48
+ wbr
49
+
1
50
  === Version 0.7.0 / 2012-6-30
2
51
  * Enhancements
3
52
  * Updated Table [] method to return a row that has matching partial text in any column (Thanks George Shakhnazaryan)
data/Guardfile CHANGED
@@ -13,8 +13,8 @@ end
13
13
 
14
14
  guard 'cucumber', :notification => true, :all_after_pass => false, :all_on_start => false, :cli => '--profile focus' do
15
15
  watch(%r{^features/.+\.feature$})
16
- watch(%r{^features/support/.+$}) { features }
16
+ watch(%r{^features/support/.+$}) { "features" }
17
17
  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
18
- watch(%r{^lib/.+\.rb$}) { features }
19
- watch(%r{^cucumber.yml$}) { features }
18
+ watch(%r{^lib/.+\.rb$}) { "features" }
19
+ watch(%r{^cucumber.yml$}) { "features" }
20
20
  end
@@ -0,0 +1,34 @@
1
+ Feature: Area
2
+
3
+ Background:
4
+ Given I am on the static elements page
5
+
6
+ Scenario: Retrieve an area element
7
+ When I retrieve the area element
8
+ Then I should know it exists
9
+ And I should know it is visible
10
+
11
+ Scenario Outline: Locating areas on the page
12
+ When I search for the area by "<search_by>"
13
+ Then I should be able to click the area
14
+
15
+ Examples:
16
+ | search_by |
17
+ | id |
18
+ | class |
19
+ | name |
20
+ | xpath |
21
+ | index |
22
+
23
+ Scenario: Getting the coordinates for the area
24
+ When I retrieve the area element
25
+ Then I should see the coordinates are "0,0,82,126"
26
+
27
+ Scenario: Getting the shape for the area
28
+ When I retrieve the area element
29
+ Then I should see the shape is "rect"
30
+
31
+ Scenario: Getting the href from the area
32
+ When I retrieve the area element
33
+ Then I should see the href is "sun.html"
34
+
Binary file
@@ -25,6 +25,13 @@
25
25
  <option value="option3" selected="true">Test 3</option>
26
26
  </select>
27
27
 
28
+ <img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"/>
29
+ <map id ="map" name="planetmap">
30
+ <area id="area" name="area" class="area" shape="rect" coords="0,0,82,126" href="sun.html"/>
31
+ <area shape="circle" coords="90,58,3" href="mercur.html"/>
32
+ <area shape="circle" coords="124,58,8" href="venus.html"/>
33
+ </map>
34
+
28
35
  <a href="success.html" id="link_id" name="link_name" class="link_class" title="link_title">Google Search</a>
29
36
 
30
37
  <input id="cb_id" name="cb_name" class="cb_class" type="checkbox" value="1"/>
Binary file
@@ -0,0 +1,7 @@
1
+ <html>
2
+ <head>
3
+ </head>
4
+ <body>
5
+ <p><img border="0" src="sun.gif" width="99" height="98"></p>
6
+ </body>
7
+ </html>
@@ -0,0 +1,19 @@
1
+ When /^I search for the area by "([^\"]*)"$/ do |how|
2
+ @how = how
3
+ end
4
+
5
+ Then /^I should be able to click the area$/ do
6
+ @page.send("area_#{@how}")
7
+ end
8
+
9
+ Then /^I should see the coordinates are "([^\"]*)"$/ do |coords|
10
+ @element.coords.should == coords
11
+ end
12
+
13
+ Then /^I should see the shape is "([^\"]*)"$/ do |shape|
14
+ @element.shape.should == shape
15
+ end
16
+
17
+ Then /^I should see the href is "([^\"]*)"$/ do |href|
18
+ @element.href.should include href
19
+ end
@@ -42,6 +42,10 @@ When /^I retrieve a heading element$/ do
42
42
  @element = @page.h1_id_element
43
43
  end
44
44
 
45
+ When /^I retrieve the area element$/ do
46
+ @element = @page.area_id_element
47
+ end
48
+
45
49
  When /^I locate the form$/ do
46
50
  @element = @page.form_id_element
47
51
  end
@@ -150,13 +150,14 @@ class Page
150
150
  button(:btn_class_index, :class => "btn_class", :index => 0)
151
151
  button(:btn_name_index, :name => "btn_name", :index => 0)
152
152
 
153
+
153
154
  button(:disabled_button, :value => 'Disabled')
154
155
 
155
156
  image(:image_id, :id => 'image_id')
156
157
  image(:image_name, :name => 'image_name')
157
158
  image(:image_class, :class => 'image_class')
158
- image(:image_index, :index => 0)
159
- image(:image_xpath, :xpath => '//img')
159
+ image(:image_index, :index => 1)
160
+ image(:image_xpath, :xpath => '//img[2]')
160
161
  image(:image_alt, :alt => 'image_alt')
161
162
  image(:image_src, :src => 'images/circle.png')
162
163
  image(:image_class_index, :class => "image_class", :index => 0)
@@ -276,10 +277,19 @@ class Page
276
277
  link(:open_window, :text => 'New Window')
277
278
  link(:child, :id => 'child')
278
279
 
280
+ area(:area_id, :id => 'area')
281
+ area(:area_name, :name => 'area')
282
+ area(:area_class, :class => 'area')
283
+ area(:area_index, :index => 0)
284
+ area(:area_xpath, :xpath => '//area')
285
+ area(:area_class_index, :class => 'area', :index => 0)
286
+ area(:area_name_index, :name => 'area', :index => 0)
287
+
279
288
  element(:article_id, :article, :id => 'article_id')
280
289
  element(:header_id, :header, :id => 'header_id')
281
290
  element(:footer_id, :footer, :id => 'footer_id')
282
291
  element(:summary_id, :summary, :id => 'summary_id')
283
292
  element(:details_id, :details, :id => 'details_id')
293
+
284
294
  end
285
295
 
@@ -163,6 +163,7 @@ module PageObject
163
163
  end
164
164
  alias_method "#{name}_hidden_field".to_sym, "#{name}_element".to_sym
165
165
  end
166
+ alias_method :hidden, :hidden_field
166
167
 
167
168
  #
168
169
  # adds four methods to the page object - one to set text in a text area,
@@ -203,6 +204,7 @@ module PageObject
203
204
  end
204
205
  alias_method "#{name}_text_area".to_sym, "#{name}_element".to_sym
205
206
  end
207
+ alias_method :textarea, :text_area
206
208
 
207
209
  #
208
210
  # adds four methods - one to select an item in a drop-down,
@@ -245,6 +247,7 @@ module PageObject
245
247
  end
246
248
  alias_method "#{name}_select_list".to_sym, "#{name}_element".to_sym
247
249
  end
250
+ alias_method :select, :select_list
248
251
 
249
252
  #
250
253
  # adds three methods - one to select a link, another
@@ -286,6 +289,7 @@ module PageObject
286
289
  end
287
290
  alias_method "#{name}_link".to_sym, "#{name}_element".to_sym
288
291
  end
292
+ alias_method :a, :link
289
293
 
290
294
  #
291
295
  # adds five methods - one to check, another to uncheck, another
@@ -379,6 +383,7 @@ module PageObject
379
383
  end
380
384
  alias_method "#{name}_radio_button".to_sym, "#{name}_element".to_sym
381
385
  end
386
+ alias_method :radio, :radio_button
382
387
 
383
388
  #
384
389
  # adds three methods - one to click a button, another to
@@ -470,6 +475,8 @@ module PageObject
470
475
  # * :id => Watir and Selenium
471
476
  # * :index => Watir and Selenium
472
477
  # * :name => Watir and Selenium
478
+ # * :text => Watir and Selenium
479
+ # * :title => Watir and Selenium
473
480
  # * :xpath => Watir and Selenium
474
481
  # @param optional block to be invoked when element method is called
475
482
  #
@@ -555,6 +562,7 @@ module PageObject
555
562
  end
556
563
  alias_method "#{name}_cell".to_sym, "#{name}_element".to_sym
557
564
  end
565
+ alias_method :td, :cell
558
566
 
559
567
  #
560
568
  # adds two methods - one to retrieve the image element, and another to
@@ -587,6 +595,7 @@ module PageObject
587
595
  end
588
596
  alias_method "#{name}_image".to_sym, "#{name}_element".to_sym
589
597
  end
598
+ alias_method :img, :image
590
599
 
591
600
  #
592
601
  # adds two methods - one to retrieve the form element, and another to
@@ -652,6 +661,7 @@ module PageObject
652
661
  end
653
662
  alias_method "#{name}_list_item".to_sym, "#{name}_element".to_sym
654
663
  end
664
+ alias_method :li, :list_item
655
665
 
656
666
  #
657
667
  # adds two methods - one to retrieve the unordered list element, and another to
@@ -682,6 +692,7 @@ module PageObject
682
692
  end
683
693
  alias_method "#{name}_unordered_list".to_sym, "#{name}_element".to_sym
684
694
  end
695
+ alias_method :ul, :unordered_list
685
696
 
686
697
  #
687
698
  # adds two methods - one to retrieve the ordered list element, and another to
@@ -712,6 +723,7 @@ module PageObject
712
723
  end
713
724
  alias_method "#{name}_ordered_list".to_sym, "#{name}_element".to_sym
714
725
  end
726
+ alias_method :ol, :ordered_list
715
727
 
716
728
  #
717
729
  # adds three methods - one to retrieve the text of a h1 element, another to
@@ -950,6 +962,7 @@ module PageObject
950
962
  end
951
963
  alias_method "#{name}_paragraph".to_sym, "#{name}_element".to_sym
952
964
  end
965
+ alias_method :p, :paragraph
953
966
 
954
967
  #
955
968
  # adds three methods - one to set the file for a file field, another to retrieve
@@ -1020,6 +1033,40 @@ module PageObject
1020
1033
  alias_method "#{name}_label".to_sym, "#{name}_element".to_sym
1021
1034
  end
1022
1035
 
1036
+ #
1037
+ # adds three methods - one to click the area,
1038
+ # another to return the area element, and another to check the area's existence.
1039
+ #
1040
+ # @example
1041
+ # area(:message, :id => 'message')
1042
+ # # will generate 'message', 'message_element', and 'message?' methods
1043
+ #
1044
+ # @param [Symbol] the name used for the generated methods
1045
+ # @param [Hash] identifier how we find an area. You can use a multiple paramaters
1046
+ # by combining of any of the following except xpath. The valid keys are:
1047
+ # * :class => Watir and Selenium
1048
+ # * :id => Watir and Selenium
1049
+ # * :index => Watir and Selenium
1050
+ # * :name => Watir and Selenium
1051
+ # * :text => Watir and Selenium
1052
+ # * :xpath => Watir and Selenium
1053
+ # @param optional block to be invoked when element method is called
1054
+ #
1055
+ def area(name, identifier={:index => 0}, &block)
1056
+ define_method(name) do
1057
+ return platform.click_area_for identifier.clone unless block_given?
1058
+ self.send("#{name}_element").click
1059
+ end
1060
+ define_method("#{name}_element") do
1061
+ return call_block(&block) if block_given?
1062
+ platform.area_for(identifier.clone)
1063
+ end
1064
+ define_method("#{name}?") do
1065
+ return call_block(&block).exists? if block_given?
1066
+ platform.area_for(identifier.clone).exists?
1067
+ end
1068
+ end
1069
+
1023
1070
  #
1024
1071
  # adds three methods - one to retrieve the text of an element, another
1025
1072
  # to retrieve an element, and another to check the element's existence.
@@ -1052,6 +1099,688 @@ module PageObject
1052
1099
  end
1053
1100
  end
1054
1101
 
1102
+ #
1103
+ # adds three methods - one to retrieve the text of an abbr, another
1104
+ # to retrieve an abbr, and another to check the abbr's existence.
1105
+ #
1106
+ # @example
1107
+ # abbr(:title, :id => 'title')
1108
+ # # will generate 'title', 'title_element', and 'title?' methods
1109
+ #
1110
+ # @param [Symbol] the name used for the generated methods
1111
+ # @param [Hash] identifier how we find an abbr. You can use a multiple paramaters
1112
+ # by combining of any of the following except xpath. The valid keys are:
1113
+ # * :class => Watir and Selenium
1114
+ # * :id => Watir and Selenium
1115
+ # * :index => Watir and Selenium
1116
+ # * :name => Watir and Selenium
1117
+ # * :xpath => Watir and Selenium
1118
+ # @param optional block to be invoked when abbr method is called
1119
+ #
1120
+ def abbr(name, identifier={:index => 0}, &block)
1121
+ element(name, :abbr, identifier, &block)
1122
+ end
1123
+
1124
+ #
1125
+ # adds three methods - one to retrieve the text of an address, another
1126
+ # to retrieve an address, and another to check the address's existence.
1127
+ #
1128
+ # @example
1129
+ # address(:title, :id => 'title')
1130
+ # # will generate 'title', 'title_element', and 'title?' methods
1131
+ #
1132
+ # @param [Symbol] the name used for the generated methods
1133
+ # @param [Hash] identifier how we find an address. You can use a multiple paramaters
1134
+ # by combining of any of the following except xpath. The valid keys are:
1135
+ # * :class => Watir and Selenium
1136
+ # * :id => Watir and Selenium
1137
+ # * :index => Watir and Selenium
1138
+ # * :name => Watir and Selenium
1139
+ # * :xpath => Watir and Selenium
1140
+ # @param optional block to be invoked when address method is called
1141
+ #
1142
+ def address(name, identifier={:index => 0}, &block)
1143
+ element(name, :address, identifier, &block)
1144
+ end
1145
+
1146
+ #
1147
+ # adds three methods - one to retrieve the text of an article, another
1148
+ # to retrieve an article, and another to check the article's existence.
1149
+ #
1150
+ # @example
1151
+ # article(:title, :id => 'title')
1152
+ # # will generate 'title', 'title_element', and 'title?' methods
1153
+ #
1154
+ # @param [Symbol] the name used for the generated methods
1155
+ # @param [Hash] identifier how we find an article. You can use a multiple paramaters
1156
+ # by combining of any of the following except xpath. The valid keys are:
1157
+ # * :class => Watir and Selenium
1158
+ # * :id => Watir and Selenium
1159
+ # * :index => Watir and Selenium
1160
+ # * :name => Watir and Selenium
1161
+ # * :xpath => Watir and Selenium
1162
+ # @param optional block to be invoked when article method is called
1163
+ #
1164
+ def article(name, identifier={:index => 0}, &block)
1165
+ element(name, :article, identifier, &block)
1166
+ end
1167
+
1168
+ #
1169
+ # adds three methods - one to retrieve the text of an aside, another
1170
+ # to retrieve an aside, and another to check the aside's existence.
1171
+ #
1172
+ # @example
1173
+ # aside(:title, :id => 'title')
1174
+ # # will generate 'title', 'title_element', and 'title?' methods
1175
+ #
1176
+ # @param [Symbol] the name used for the generated methods
1177
+ # @param [Hash] identifier how we find an aside. You can use a multiple paramaters
1178
+ # by combining of any of the following except xpath. The valid keys are:
1179
+ # * :class => Watir and Selenium
1180
+ # * :id => Watir and Selenium
1181
+ # * :index => Watir and Selenium
1182
+ # * :name => Watir and Selenium
1183
+ # * :xpath => Watir and Selenium
1184
+ # @param optional block to be invoked when aside method is called
1185
+ #
1186
+ def aside(name, identifier={:index => 0}, &block)
1187
+ element(name, :aside, identifier, &block)
1188
+ end
1189
+
1190
+ #
1191
+ # adds three methods - one to retrieve the text of an bdi, another
1192
+ # to retrieve an bdi, and another to check the bdi's existence.
1193
+ #
1194
+ # @example
1195
+ # bdi(:title, :id => 'title')
1196
+ # # will generate 'title', 'title_element', and 'title?' methods
1197
+ #
1198
+ # @param [Symbol] the name used for the generated methods
1199
+ # @param [Hash] identifier how we find an bdi. You can use a multiple paramaters
1200
+ # by combining of any of the following except xpath. The valid keys are:
1201
+ # * :class => Watir and Selenium
1202
+ # * :id => Watir and Selenium
1203
+ # * :index => Watir and Selenium
1204
+ # * :name => Watir and Selenium
1205
+ # * :xpath => Watir and Selenium
1206
+ # @param optional block to be invoked when bdi method is called
1207
+ #
1208
+ def bdi(name, identifier={:index => 0}, &block)
1209
+ element(name, :bdi, identifier, &block)
1210
+ end
1211
+
1212
+ #
1213
+ # adds three methods - one to retrieve the text of an bdo, another
1214
+ # to retrieve an bdo, and another to check the bdo's existence.
1215
+ #
1216
+ # @example
1217
+ # bdo(:title, :id => 'title')
1218
+ # # will generate 'title', 'title_element', and 'title?' methods
1219
+ #
1220
+ # @param [Symbol] the name used for the generated methods
1221
+ # @param [Hash] identifier how we find an bdo. You can use a multiple paramaters
1222
+ # by combining of any of the following except xpath. The valid keys are:
1223
+ # * :class => Watir and Selenium
1224
+ # * :id => Watir and Selenium
1225
+ # * :index => Watir and Selenium
1226
+ # * :name => Watir and Selenium
1227
+ # * :xpath => Watir and Selenium
1228
+ # @param optional block to be invoked when bdo method is called
1229
+ #
1230
+ def bdo(name, identifier={:index => 0}, &block)
1231
+ element(name, :bdo, identifier, &block)
1232
+ end
1233
+
1234
+ #
1235
+ # adds three methods - one to retrieve the text of an cite, another
1236
+ # to retrieve an cite, and another to check the cite's existence.
1237
+ #
1238
+ # @example
1239
+ # cite(:title, :id => 'title')
1240
+ # # will generate 'title', 'title_element', and 'title?' methods
1241
+ #
1242
+ # @param [Symbol] the name used for the generated methods
1243
+ # @param [Hash] identifier how we find an cite. You can use a multiple paramaters
1244
+ # by combining of any of the following except xpath. The valid keys are:
1245
+ # * :class => Watir and Selenium
1246
+ # * :id => Watir and Selenium
1247
+ # * :index => Watir and Selenium
1248
+ # * :name => Watir and Selenium
1249
+ # * :xpath => Watir and Selenium
1250
+ # @param optional block to be invoked when cite method is called
1251
+ #
1252
+ def cite(name, identifier={:index => 0}, &block)
1253
+ element(name, :cite, identifier, &block)
1254
+ end
1255
+
1256
+ #
1257
+ # adds three methods - one to retrieve the text of an code, another
1258
+ # to retrieve an code, and another to check the code's existence.
1259
+ #
1260
+ # @example
1261
+ # code(:title, :id => 'title')
1262
+ # # will generate 'title', 'title_element', and 'title?' methods
1263
+ #
1264
+ # @param [Symbol] the name used for the generated methods
1265
+ # @param [Hash] identifier how we find an code. You can use a multiple paramaters
1266
+ # by combining of any of the following except xpath. The valid keys are:
1267
+ # * :class => Watir and Selenium
1268
+ # * :id => Watir and Selenium
1269
+ # * :index => Watir and Selenium
1270
+ # * :name => Watir and Selenium
1271
+ # * :xpath => Watir and Selenium
1272
+ # @param optional block to be invoked when code method is called
1273
+ #
1274
+ def code(name, identifier={:index => 0}, &block)
1275
+ element(name, :code, identifier, &block)
1276
+ end
1277
+
1278
+ #
1279
+ # adds three methods - one to retrieve the text of an dd, another
1280
+ # to retrieve an dd, and another to check the dd's existence.
1281
+ #
1282
+ # @example
1283
+ # dd(:title, :id => 'title')
1284
+ # # will generate 'title', 'title_element', and 'title?' methods
1285
+ #
1286
+ # @param [Symbol] the name used for the generated methods
1287
+ # @param [Hash] identifier how we find an dd. You can use a multiple paramaters
1288
+ # by combining of any of the following except xpath. The valid keys are:
1289
+ # * :class => Watir and Selenium
1290
+ # * :id => Watir and Selenium
1291
+ # * :index => Watir and Selenium
1292
+ # * :name => Watir and Selenium
1293
+ # * :xpath => Watir and Selenium
1294
+ # @param optional block to be invoked when dd method is called
1295
+ #
1296
+ def dd(name, identifier={:index => 0}, &block)
1297
+ element(name, :dd, identifier, &block)
1298
+ end
1299
+
1300
+ #
1301
+ # adds three methods - one to retrieve the text of an dfn, another
1302
+ # to retrieve an dfn, and another to check the dfn's existence.
1303
+ #
1304
+ # @example
1305
+ # dfn(:title, :id => 'title')
1306
+ # # will generate 'title', 'title_element', and 'title?' methods
1307
+ #
1308
+ # @param [Symbol] the name used for the generated methods
1309
+ # @param [Hash] identifier how we find an dfn. You can use a multiple paramaters
1310
+ # by combining of any of the following except xpath. The valid keys are:
1311
+ # * :class => Watir and Selenium
1312
+ # * :id => Watir and Selenium
1313
+ # * :index => Watir and Selenium
1314
+ # * :name => Watir and Selenium
1315
+ # * :xpath => Watir and Selenium
1316
+ # @param optional block to be invoked when dfn method is called
1317
+ #
1318
+ def dfn(name, identifier={:index => 0}, &block)
1319
+ element(name, :dfn, identifier, &block)
1320
+ end
1321
+
1322
+ #
1323
+ # adds three methods - one to retrieve the text of an dt, another
1324
+ # to retrieve an dt, and another to check the dt's existence.
1325
+ #
1326
+ # @example
1327
+ # dt(:title, :id => 'title')
1328
+ # # will generate 'title', 'title_element', and 'title?' methods
1329
+ #
1330
+ # @param [Symbol] the name used for the generated methods
1331
+ # @param [Hash] identifier how we find an dt. You can use a multiple paramaters
1332
+ # by combining of any of the following except xpath. The valid keys are:
1333
+ # * :class => Watir and Selenium
1334
+ # * :id => Watir and Selenium
1335
+ # * :index => Watir and Selenium
1336
+ # * :name => Watir and Selenium
1337
+ # * :xpath => Watir and Selenium
1338
+ # @param optional block to be invoked when dt method is called
1339
+ #
1340
+ def dt(name, identifier={:index => 0}, &block)
1341
+ element(name, :dt, identifier, &block)
1342
+ end
1343
+
1344
+ #
1345
+ # adds three methods - one to retrieve the text of an em, another
1346
+ # to retrieve an em, and another to check the em's existence.
1347
+ #
1348
+ # @example
1349
+ # em(:title, :id => 'title')
1350
+ # # will generate 'title', 'title_element', and 'title?' methods
1351
+ #
1352
+ # @param [Symbol] the name used for the generated methods
1353
+ # @param [Hash] identifier how we find an em. You can use a multiple paramaters
1354
+ # by combining of any of the following except xpath. The valid keys are:
1355
+ # * :class => Watir and Selenium
1356
+ # * :id => Watir and Selenium
1357
+ # * :index => Watir and Selenium
1358
+ # * :name => Watir and Selenium
1359
+ # * :xpath => Watir and Selenium
1360
+ # @param optional block to be invoked when em method is called
1361
+ #
1362
+ def em(name, identifier={:index => 0}, &block)
1363
+ element(name, :em, identifier, &block)
1364
+ end
1365
+
1366
+ #
1367
+ # adds three methods - one to retrieve the text of an figcaption, another
1368
+ # to retrieve an figcaption, and another to check the figcaption's existence.
1369
+ #
1370
+ # @example
1371
+ # figcaption(:title, :id => 'title')
1372
+ # # will generate 'title', 'title_elfigcaptionent', and 'title?' methods
1373
+ #
1374
+ # @param [Symbol] the name used for the generated methods
1375
+ # @param [Hash] identifier how we find an figcaption. You can use a multiple paramaters
1376
+ # by combining of any of the following except xpath. The valid keys are:
1377
+ # * :class => Watir and Selenium
1378
+ # * :id => Watir and Selenium
1379
+ # * :index => Watir and Selenium
1380
+ # * :name => Watir and Selenium
1381
+ # * :xpath => Watir and Selenium
1382
+ # @param optional block to be invoked when figcaption method is called
1383
+ #
1384
+ def figcaption(name, identifier={:index => 0}, &block)
1385
+ element(name, :figcaption, identifier, &block)
1386
+ end
1387
+
1388
+ #
1389
+ # adds three methods - one to retrieve the text of an figure, another
1390
+ # to retrieve an figure, and another to check the figure's existence.
1391
+ #
1392
+ # @example
1393
+ # figure(:title, :id => 'title')
1394
+ # # will generate 'title', 'title_elfigureent', and 'title?' methods
1395
+ #
1396
+ # @param [Symbol] the name used for the generated methods
1397
+ # @param [Hash] identifier how we find an figure. You can use a multiple paramaters
1398
+ # by combining of any of the following except xpath. The valid keys are:
1399
+ # * :class => Watir and Selenium
1400
+ # * :id => Watir and Selenium
1401
+ # * :index => Watir and Selenium
1402
+ # * :name => Watir and Selenium
1403
+ # * :xpath => Watir and Selenium
1404
+ # @param optional block to be invoked when figure method is called
1405
+ #
1406
+ def figure(name, identifier={:index => 0}, &block)
1407
+ element(name, :figure, identifier, &block)
1408
+ end
1409
+
1410
+ #
1411
+ # adds three methods - one to retrieve the text of an footer, another
1412
+ # to retrieve an footer, and another to check the footer's existence.
1413
+ #
1414
+ # @example
1415
+ # footer(:title, :id => 'title')
1416
+ # # will generate 'title', 'title_elfooterent', and 'title?' methods
1417
+ #
1418
+ # @param [Symbol] the name used for the generated methods
1419
+ # @param [Hash] identifier how we find an footer. You can use a multiple paramaters
1420
+ # by combining of any of the following except xpath. The valid keys are:
1421
+ # * :class => Watir and Selenium
1422
+ # * :id => Watir and Selenium
1423
+ # * :index => Watir and Selenium
1424
+ # * :name => Watir and Selenium
1425
+ # * :xpath => Watir and Selenium
1426
+ # @param optional block to be invoked when footer method is called
1427
+ #
1428
+ def footer(name, identifier={:index => 0}, &block)
1429
+ element(name, :footer, identifier, &block)
1430
+ end
1431
+
1432
+ #
1433
+ # adds three methods - one to retrieve the text of an header, another
1434
+ # to retrieve an header, and another to check the header's existence.
1435
+ #
1436
+ # @example
1437
+ # header(:title, :id => 'title')
1438
+ # # will generate 'title', 'title_elheaderent', and 'title?' methods
1439
+ #
1440
+ # @param [Symbol] the name used for the generated methods
1441
+ # @param [Hash] identifier how we find an header. You can use a multiple paramaters
1442
+ # by combining of any of the following except xpath. The valid keys are:
1443
+ # * :class => Watir and Selenium
1444
+ # * :id => Watir and Selenium
1445
+ # * :index => Watir and Selenium
1446
+ # * :name => Watir and Selenium
1447
+ # * :xpath => Watir and Selenium
1448
+ # @param optional block to be invoked when header method is called
1449
+ #
1450
+ def header(name, identifier={:index => 0}, &block)
1451
+ element(name, :header, identifier, &block)
1452
+ end
1453
+
1454
+ #
1455
+ # adds three methods - one to retrieve the text of an hgroup, another
1456
+ # to retrieve an hgroup, and another to check the hgroup's existence.
1457
+ #
1458
+ # @example
1459
+ # hgroup(:title, :id => 'title')
1460
+ # # will generate 'title', 'title_elhgroupent', and 'title?' methods
1461
+ #
1462
+ # @param [Symbol] the name used for the generated methods
1463
+ # @param [Hash] identifier how we find an hgroup. You can use a multiple paramaters
1464
+ # by combining of any of the following except xpath. The valid keys are:
1465
+ # * :class => Watir and Selenium
1466
+ # * :id => Watir and Selenium
1467
+ # * :index => Watir and Selenium
1468
+ # * :name => Watir and Selenium
1469
+ # * :xpath => Watir and Selenium
1470
+ # @param optional block to be invoked when hgroup method is called
1471
+ #
1472
+ def hgroup(name, identifier={:index => 0}, &block)
1473
+ element(name, :hgroup, identifier, &block)
1474
+ end
1475
+
1476
+ #
1477
+ # adds three methods - one to retrieve the text of an kbd, another
1478
+ # to retrieve an kbd, and another to check the kbd's existence.
1479
+ #
1480
+ # @example
1481
+ # kbd(:title, :id => 'title')
1482
+ # # will generate 'title', 'title_elkbdent', and 'title?' methods
1483
+ #
1484
+ # @param [Symbol] the name used for the generated methods
1485
+ # @param [Hash] identifier how we find an kbd. You can use a multiple paramaters
1486
+ # by combining of any of the following except xpath. The valid keys are:
1487
+ # * :class => Watir and Selenium
1488
+ # * :id => Watir and Selenium
1489
+ # * :index => Watir and Selenium
1490
+ # * :name => Watir and Selenium
1491
+ # * :xpath => Watir and Selenium
1492
+ # @param optional block to be invoked when kbd method is called
1493
+ #
1494
+ def kbd(name, identifier={:index => 0}, &block)
1495
+ element(name, :kbd, identifier, &block)
1496
+ end
1497
+
1498
+ #
1499
+ # adds three methods - one to retrieve the text of an mark, another
1500
+ # to retrieve an mark, and another to check the mark's existence.
1501
+ #
1502
+ # @example
1503
+ # mark(:title, :id => 'title')
1504
+ # # will generate 'title', 'title_elmarkent', and 'title?' methods
1505
+ #
1506
+ # @param [Symbol] the name used for the generated methods
1507
+ # @param [Hash] identifier how we find an mark. You can use a multiple paramaters
1508
+ # by combining of any of the following except xpath. The valid keys are:
1509
+ # * :class => Watir and Selenium
1510
+ # * :id => Watir and Selenium
1511
+ # * :index => Watir and Selenium
1512
+ # * :name => Watir and Selenium
1513
+ # * :xpath => Watir and Selenium
1514
+ # @param optional block to be invoked when mark method is called
1515
+ #
1516
+ def mark(name, identifier={:index => 0}, &block)
1517
+ element(name, :mark, identifier, &block)
1518
+ end
1519
+
1520
+ #
1521
+ # adds three methods - one to retrieve the text of an nav, another
1522
+ # to retrieve an nav, and another to check the nav's existence.
1523
+ #
1524
+ # @example
1525
+ # nav(:title, :id => 'title')
1526
+ # # will generate 'title', 'title_elnavent', and 'title?' methods
1527
+ #
1528
+ # @param [Symbol] the name used for the generated methods
1529
+ # @param [Hash] identifier how we find an nav. You can use a multiple paramaters
1530
+ # by combining of any of the following except xpath. The valid keys are:
1531
+ # * :class => Watir and Selenium
1532
+ # * :id => Watir and Selenium
1533
+ # * :index => Watir and Selenium
1534
+ # * :name => Watir and Selenium
1535
+ # * :xpath => Watir and Selenium
1536
+ # @param optional block to be invoked when nav method is called
1537
+ #
1538
+ def nav(name, identifier={:index => 0}, &block)
1539
+ element(name, :nav, identifier, &block)
1540
+ end
1541
+
1542
+ #
1543
+ # adds three methods - one to retrieve the text of an noscript, another
1544
+ # to retrieve an noscript, and another to check the noscript's existence.
1545
+ #
1546
+ # @example
1547
+ # noscript(:title, :id => 'title')
1548
+ # # will generate 'title', 'title_elnoscriptent', and 'title?' methods
1549
+ #
1550
+ # @param [Symbol] the name used for the generated methods
1551
+ # @param [Hash] identifier how we find an noscript. You can use a multiple paramaters
1552
+ # by combining of any of the following except xpath. The valid keys are:
1553
+ # * :class => Watir and Selenium
1554
+ # * :id => Watir and Selenium
1555
+ # * :index => Watir and Selenium
1556
+ # * :name => Watir and Selenium
1557
+ # * :xpath => Watir and Selenium
1558
+ # @param optional block to be invoked when noscript method is called
1559
+ #
1560
+ def noscript(name, identifier={:index => 0}, &block)
1561
+ element(name, :noscript, identifier, &block)
1562
+ end
1563
+
1564
+ #
1565
+ # adds three methods - one to retrieve the text of an rp, another
1566
+ # to retrieve an rp, and another to check the rp's existence.
1567
+ #
1568
+ # @example
1569
+ # rp(:title, :id => 'title')
1570
+ # # will generate 'title', 'title_elrpent', and 'title?' methods
1571
+ #
1572
+ # @param [Symbol] the name used for the generated methods
1573
+ # @param [Hash] identifier how we find an rp. You can use a multiple paramaters
1574
+ # by combining of any of the following except xpath. The valid keys are:
1575
+ # * :class => Watir and Selenium
1576
+ # * :id => Watir and Selenium
1577
+ # * :index => Watir and Selenium
1578
+ # * :name => Watir and Selenium
1579
+ # * :xpath => Watir and Selenium
1580
+ # @param optional block to be invoked when rp method is called
1581
+ #
1582
+ def rp(name, identifier={:index => 0}, &block)
1583
+ element(name, :rp, identifier, &block)
1584
+ end
1585
+
1586
+ #
1587
+ # adds three methods - one to retrieve the text of an rt, another
1588
+ # to retrieve an rt, and another to check the rt's existence.
1589
+ #
1590
+ # @example
1591
+ # rt(:title, :id => 'title')
1592
+ # # will generate 'title', 'title_elrtent', and 'title?' methods
1593
+ #
1594
+ # @param [Symbol] the name used for the generated methods
1595
+ # @param [Hash] identifier how we find an rt. You can use a multiple paramaters
1596
+ # by combining of any of the following except xpath. The valid keys are:
1597
+ # * :class => Watir and Selenium
1598
+ # * :id => Watir and Selenium
1599
+ # * :index => Watir and Selenium
1600
+ # * :name => Watir and Selenium
1601
+ # * :xpath => Watir and Selenium
1602
+ # @param optional block to be invoked when rt method is called
1603
+ #
1604
+ def rt(name, identifier={:index => 0}, &block)
1605
+ element(name, :rt, identifier, &block)
1606
+ end
1607
+
1608
+ #
1609
+ # adds three methods - one to retrieve the text of an ruby, another
1610
+ # to retrieve an ruby, and another to check the ruby's existence.
1611
+ #
1612
+ # @example
1613
+ # ruby(:title, :id => 'title')
1614
+ # # will generate 'title', 'title_elrubyent', and 'title?' methods
1615
+ #
1616
+ # @param [Symbol] the name used for the generated methods
1617
+ # @param [Hash] identifier how we find an ruby. You can use a multiple paramaters
1618
+ # by combining of any of the following except xpath. The valid keys are:
1619
+ # * :class => Watir and Selenium
1620
+ # * :id => Watir and Selenium
1621
+ # * :index => Watir and Selenium
1622
+ # * :name => Watir and Selenium
1623
+ # * :xpath => Watir and Selenium
1624
+ # @param optional block to be invoked when ruby method is called
1625
+ #
1626
+ def ruby(name, identifier={:index => 0}, &block)
1627
+ element(name, :ruby, identifier, &block)
1628
+ end
1629
+
1630
+ #
1631
+ # adds three methods - one to retrieve the text of an samp, another
1632
+ # to retrieve an samp, and another to check the samp's existence.
1633
+ #
1634
+ # @example
1635
+ # samp(:title, :id => 'title')
1636
+ # # will generate 'title', 'title_elsampent', and 'title?' methods
1637
+ #
1638
+ # @param [Symbol] the name used for the generated methods
1639
+ # @param [Hash] identifier how we find an samp. You can use a multiple paramaters
1640
+ # by combining of any of the following except xpath. The valid keys are:
1641
+ # * :class => Watir and Selenium
1642
+ # * :id => Watir and Selenium
1643
+ # * :index => Watir and Selenium
1644
+ # * :name => Watir and Selenium
1645
+ # * :xpath => Watir and Selenium
1646
+ # @param optional block to be invoked when samp method is called
1647
+ #
1648
+ def samp(name, identifier={:index => 0}, &block)
1649
+ element(name, :samp, identifier, &block)
1650
+ end
1651
+
1652
+ #
1653
+ # adds three methods - one to retrieve the text of an section, another
1654
+ # to retrieve an section, and another to check the section's existence.
1655
+ #
1656
+ # @example
1657
+ # section(:title, :id => 'title')
1658
+ # # will generate 'title', 'title_elsectionent', and 'title?' methods
1659
+ #
1660
+ # @param [Symbol] the name used for the generated methods
1661
+ # @param [Hash] identifier how we find an section. You can use a multiple paramaters
1662
+ # by combining of any of the following except xpath. The valid keys are:
1663
+ # * :class => Watir and Selenium
1664
+ # * :id => Watir and Selenium
1665
+ # * :index => Watir and Selenium
1666
+ # * :name => Watir and Selenium
1667
+ # * :xpath => Watir and Selenium
1668
+ # @param optional block to be invoked when section method is called
1669
+ #
1670
+ def section(name, identifier={:index => 0}, &block)
1671
+ element(name, :section, identifier, &block)
1672
+ end
1673
+
1674
+ #
1675
+ # adds three methods - one to retrieve the text of an sub, another
1676
+ # to retrieve an sub, and another to check the sub's existence.
1677
+ #
1678
+ # @example
1679
+ # sub(:title, :id => 'title')
1680
+ # # will generate 'title', 'title_elsubent', and 'title?' methods
1681
+ #
1682
+ # @param [Symbol] the name used for the generated methods
1683
+ # @param [Hash] identifier how we find an sub. You can use a multiple paramaters
1684
+ # by combining of any of the following except xpath. The valid keys are:
1685
+ # * :class => Watir and Selenium
1686
+ # * :id => Watir and Selenium
1687
+ # * :index => Watir and Selenium
1688
+ # * :name => Watir and Selenium
1689
+ # * :xpath => Watir and Selenium
1690
+ # @param optional block to be invoked when sub method is called
1691
+ #
1692
+ def sub(name, identifier={:index => 0}, &block)
1693
+ element(name, :sub, identifier, &block)
1694
+ end
1695
+
1696
+ #
1697
+ # adds three methods - one to retrieve the text of an summary, another
1698
+ # to retrieve an summary, and another to check the summary's existence.
1699
+ #
1700
+ # @example
1701
+ # summary(:title, :id => 'title')
1702
+ # # will generate 'title', 'title_elsummaryent', and 'title?' methods
1703
+ #
1704
+ # @param [Symbol] the name used for the generated methods
1705
+ # @param [Hash] identifier how we find an summary. You can use a multiple paramaters
1706
+ # by combining of any of the following except xpath. The valid keys are:
1707
+ # * :class => Watir and Selenium
1708
+ # * :id => Watir and Selenium
1709
+ # * :index => Watir and Selenium
1710
+ # * :name => Watir and Selenium
1711
+ # * :xpath => Watir and Selenium
1712
+ # @param optional block to be invoked when summary method is called
1713
+ #
1714
+ def summary(name, identifier={:index => 0}, &block)
1715
+ element(name, :summary, identifier, &block)
1716
+ end
1717
+
1718
+ #
1719
+ # adds three methods - one to retrieve the text of an sup, another
1720
+ # to retrieve an sup, and another to check the sup's existence.
1721
+ #
1722
+ # @example
1723
+ # sup(:title, :id => 'title')
1724
+ # # will generate 'title', 'title_elsupent', and 'title?' methods
1725
+ #
1726
+ # @param [Symbol] the name used for the generated methods
1727
+ # @param [Hash] identifier how we find an sup. You can use a multiple paramaters
1728
+ # by combining of any of the following except xpath. The valid keys are:
1729
+ # * :class => Watir and Selenium
1730
+ # * :id => Watir and Selenium
1731
+ # * :index => Watir and Selenium
1732
+ # * :name => Watir and Selenium
1733
+ # * :xpath => Watir and Selenium
1734
+ # @param optional block to be invoked when sup method is called
1735
+ #
1736
+ def sup(name, identifier={:index => 0}, &block)
1737
+ element(name, :sup, identifier, &block)
1738
+ end
1739
+
1740
+ #
1741
+ # adds three methods - one to retrieve the text of an var, another
1742
+ # to retrieve an var, and another to check the var's existence.
1743
+ #
1744
+ # @example
1745
+ # var(:title, :id => 'title')
1746
+ # # will generate 'title', 'title_elvarent', and 'title?' methods
1747
+ #
1748
+ # @param [Symbol] the name used for the generated methods
1749
+ # @param [Hash] identifier how we find an var. You can use a multiple paramaters
1750
+ # by combining of any of the following except xpath. The valid keys are:
1751
+ # * :class => Watir and Selenium
1752
+ # * :id => Watir and Selenium
1753
+ # * :index => Watir and Selenium
1754
+ # * :name => Watir and Selenium
1755
+ # * :xpath => Watir and Selenium
1756
+ # @param optional block to be invoked when var method is called
1757
+ #
1758
+ def var(name, identifier={:index => 0}, &block)
1759
+ element(name, :var, identifier, &block)
1760
+ end
1761
+
1762
+ #
1763
+ # adds three methods - one to retrieve the text of an wbr, another
1764
+ # to retrieve an wbr, and another to check the wbr's existence.
1765
+ #
1766
+ # @example
1767
+ # wbr(:title, :id => 'title')
1768
+ # # will generate 'title', 'title_elwbrent', and 'title?' methods
1769
+ #
1770
+ # @param [Symbol] the name used for the generated methods
1771
+ # @param [Hash] identifier how we find an wbr. You can use a multiple paramaters
1772
+ # by combining of any of the following except xpath. The valid keys are:
1773
+ # * :class => Watir and Selenium
1774
+ # * :id => Watir and Selenium
1775
+ # * :index => Watir and Selenium
1776
+ # * :name => Watir and Selenium
1777
+ # * :xpath => Watir and Selenium
1778
+ # @param optional block to be invoked when wbr method is called
1779
+ #
1780
+ def wbr(name, identifier={:index => 0}, &block)
1781
+ element(name, :wbr, identifier, &block)
1782
+ end
1783
+
1055
1784
  #
1056
1785
  # adds a method that will return an indexed property. The property will respond to
1057
1786
  # the [] method with an object that has a set of normal page_object properties that