druid-ts 0.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +1 -2
  6. data/ChangeLog +218 -0
  7. data/Gemfile +2 -1
  8. data/README.md +64 -7
  9. data/Rakefile +1 -1
  10. data/druid.gemspec +25 -0
  11. data/features/async.feature +18 -0
  12. data/features/button.feature +42 -1
  13. data/features/checkbox.feature +7 -1
  14. data/features/div.feature +6 -0
  15. data/features/element.feature +100 -0
  16. data/features/file_field.feature +35 -0
  17. data/features/form.feature +12 -6
  18. data/features/frames.feature +57 -0
  19. data/features/heading.feature +164 -0
  20. data/features/hidden_field.feature +6 -0
  21. data/features/html/async.html +18 -0
  22. data/features/html/frame_1.html +18 -0
  23. data/features/html/frame_2.html +16 -0
  24. data/features/html/frame_3.html +14 -0
  25. data/features/html/frames.html +12 -0
  26. data/features/html/iframes.html +12 -0
  27. data/features/html/modal.html +17 -0
  28. data/features/html/modal_1.html +38 -0
  29. data/features/html/modal_2.html +27 -0
  30. data/features/html/nested_elements.html +52 -0
  31. data/features/html/nested_frame_1.html +1 -0
  32. data/features/html/nested_frame_2.html +11 -0
  33. data/features/html/nested_frame_3.html +14 -0
  34. data/features/html/nested_frames.html +10 -0
  35. data/features/html/static_elements.html +29 -23
  36. data/features/image.feature +8 -0
  37. data/features/link.feature +5 -0
  38. data/features/list_item.feature +5 -0
  39. data/features/modal_dialog.feature +9 -0
  40. data/features/nested_elements.feature +105 -0
  41. data/features/ordered_list.feature +6 -0
  42. data/features/page_level_actions.feature +48 -0
  43. data/features/paragraph.feature +33 -0
  44. data/features/radio_button.feature +6 -0
  45. data/features/select_list.feature +6 -1
  46. data/features/span.feature +6 -1
  47. data/features/step_definations/async_steps.rb +63 -0
  48. data/features/step_definations/button_steps.rb +25 -1
  49. data/features/step_definations/checkbox_steps.rb +5 -1
  50. data/features/step_definations/div_steps.rb +6 -1
  51. data/features/step_definations/element_steps.rb +55 -1
  52. data/features/step_definations/file_field_steps.rb +27 -0
  53. data/features/step_definations/form_steps.rb +8 -0
  54. data/features/step_definations/frame_steps.rb +112 -0
  55. data/features/step_definations/heading_steps.rb +39 -0
  56. data/features/step_definations/hidden_field_steps.rb +7 -3
  57. data/features/step_definations/image_steps.rb +7 -3
  58. data/features/step_definations/link_steps.rb +8 -3
  59. data/features/step_definations/list_item_steps.rb +9 -1
  60. data/features/step_definations/modal_dialog_steps.rb +38 -0
  61. data/features/step_definations/nested_elements_steps.rb +196 -0
  62. data/features/step_definations/ordered_list_steps.rb +11 -3
  63. data/features/step_definations/page_level_actions_steps.rb +72 -0
  64. data/features/step_definations/paragraph_steps.rb +15 -0
  65. data/features/step_definations/radio_button_steps.rb +5 -1
  66. data/features/step_definations/select_list_steps.rb +10 -2
  67. data/features/step_definations/span_steps.rb +5 -1
  68. data/features/step_definations/table_cell_steps.rb +5 -1
  69. data/features/step_definations/table_steps.rb +17 -3
  70. data/features/step_definations/text_area_steps.rb +18 -2
  71. data/features/step_definations/text_field_steps.rb +9 -1
  72. data/features/step_definations/unordered_list_steps.rb +11 -3
  73. data/features/support/env.rb +0 -15
  74. data/features/support/hooks.rb +7 -0
  75. data/features/support/page.rb +98 -1
  76. data/features/support/persistent_browser.rb +15 -0
  77. data/features/support/url_helper.rb +24 -1
  78. data/features/table.feature +7 -0
  79. data/features/table_cell.feature +6 -0
  80. data/features/text_area.feature +11 -0
  81. data/features/text_field.feature +6 -1
  82. data/features/unordered_list.feature +6 -0
  83. data/lib/druid.rb +251 -3
  84. data/lib/druid/accessors.rb +446 -158
  85. data/lib/druid/assist.rb +394 -0
  86. data/lib/druid/core_ext/string.rb +5 -0
  87. data/lib/druid/element_locators.rb +405 -0
  88. data/lib/druid/elements.rb +28 -0
  89. data/lib/druid/elements/button.rb +6 -1
  90. data/lib/druid/elements/check_box.rb +26 -0
  91. data/lib/druid/elements/div.rb +3 -1
  92. data/lib/druid/elements/element.rb +170 -5
  93. data/lib/druid/elements/file_field.rb +18 -0
  94. data/lib/druid/elements/form.rb +11 -0
  95. data/lib/druid/elements/heading.rb +14 -0
  96. data/lib/druid/elements/hidden_field.rb +12 -2
  97. data/lib/druid/elements/image.rb +13 -0
  98. data/lib/druid/elements/link.rb +2 -0
  99. data/lib/druid/elements/list_item.rb +3 -1
  100. data/lib/druid/elements/option.rb +9 -0
  101. data/lib/druid/elements/ordered_list.rb +4 -5
  102. data/lib/druid/elements/paragraph.rb +9 -0
  103. data/lib/druid/elements/radio_button.rb +25 -0
  104. data/lib/druid/elements/select_list.rb +10 -1
  105. data/lib/druid/elements/span.rb +3 -1
  106. data/lib/druid/elements/table.rb +20 -1
  107. data/lib/druid/elements/table_cell.rb +7 -0
  108. data/lib/druid/elements/table_row.rb +5 -1
  109. data/lib/druid/elements/text_area.rb +15 -1
  110. data/lib/druid/elements/text_field.rb +11 -1
  111. data/lib/druid/elements/unordered_list.rb +5 -5
  112. data/lib/druid/nested_elements.rb +103 -0
  113. data/lib/druid/page_factory.rb +4 -4
  114. data/lib/druid/page_populator.rb +71 -0
  115. data/spec/druid/accessors_spec.rb +789 -0
  116. data/spec/druid/druid_spec.rb +130 -7
  117. data/spec/druid/element_locators_spec.rb +160 -0
  118. data/spec/druid/elements/button_spec.rb +31 -0
  119. data/spec/druid/elements/check_box_spec.rb +38 -0
  120. data/spec/druid/elements/div_spec.rb +19 -0
  121. data/spec/druid/elements/element_spec.rb +150 -0
  122. data/spec/druid/elements/file_field_spec.rb +27 -0
  123. data/spec/druid/elements/form_spec.rb +27 -0
  124. data/spec/druid/elements/heading_spec.rb +39 -0
  125. data/spec/druid/elements/hidden_field_spec.rb +24 -0
  126. data/spec/druid/elements/image_spec.rb +32 -0
  127. data/spec/druid/elements/link_spec.rb +26 -0
  128. data/spec/druid/elements/list_item_spec.rb +19 -0
  129. data/spec/druid/elements/option_spec.rb +10 -0
  130. data/spec/druid/elements/ordered_list_spec.rb +42 -0
  131. data/spec/druid/elements/page_factory_spec.rb +40 -0
  132. data/spec/druid/elements/paragraph_spec.rb +21 -0
  133. data/spec/druid/elements/radio_button_spec.rb +38 -0
  134. data/spec/druid/elements/select_list_spec.rb +37 -0
  135. data/spec/druid/elements/span_spec.rb +19 -0
  136. data/spec/druid/elements/table_cell_spec.rb +23 -0
  137. data/spec/druid/elements/table_row_spec.rb +41 -0
  138. data/spec/druid/elements/table_spec.rb +52 -0
  139. data/spec/druid/elements/text_area_spec.rb +31 -0
  140. data/spec/druid/elements/text_field_spec.rb +31 -0
  141. data/spec/druid/elements/unordered_list_spec.rb +42 -0
  142. data/spec/druid/nested_element_spec.rb +128 -0
  143. data/spec/druid/page_populator_spec.rb +92 -0
  144. data/spec/spec_helper.rb +2 -1
  145. metadata +147 -27
@@ -0,0 +1,18 @@
1
+ <html>
2
+ <head>
3
+ <title>Async Page</title>
4
+ <script type="text/javascript">
5
+ function unhide() {
6
+ document.getElementById("target").style.display="block";
7
+ }
8
+ function hide() {
9
+ document.getElementById("target").style.display="none";
10
+ }
11
+ </script>
12
+ </head>
13
+ <body>
14
+ <input type="button" id="target" value="Target"/>
15
+ <input type="button" onclick="setTimeout(function() {hide();}, 2000);" value="Hide Button"/>
16
+ <input type="button" onclick="setTimeout(function() {unhide();}, 2000);" value="Unhide Button"/>
17
+ </body>
18
+ </html>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frame 1</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body onload="document.senderForm.senderElement.focus()">
8
+ <h1>Frame 1</h1>
9
+ <p>Nam accumsan. Donec nisi pede, interdum eget, ultrices ac, vulputate vitae, nunc. Nulla lorem. Duis cursus pharetra dolor. Nulla accumsan hendrerit leo. Vivamus commodo. Nullam dignissim adipiscing est. Aliquam vitae orci in risus lobortis luctus. Ut luctus fermentum ligula. Nullam ipsum. Suspendisse sit amet nisi.</p>
10
+ <form action="" method="post" name="senderForm">
11
+ <fieldset>
12
+ <input type="text" name="senderElement" id="senderElement" value="send_this_value" />
13
+ <input type="button" id="send" onclick="parent.frame2.document.recieverForm.recieverElement.value = document.senderForm.senderElement.value" value="Send!" />
14
+ </fieldset>
15
+ </form>
16
+ <div id="set_by_js" />
17
+ </body>
18
+ </html>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frame 2</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1>Frame 2</h1>
9
+ <p>Vestibulum dignissim mauris id tellus. Nulla volutpat bibendum ante. Nam malesuada, lacus vel ultrices luctus, lorem purus tristique magna, quis pharetra leo ipsum nec neque. Cras ornare tincidunt sem. In hac habitasse platea dictumst. Suspendisse commodo turpis at est. Sed quis tortor. Aenean non massa. Phasellus scelerisque nulla vel lectus. Quisque lorem. Praesent volutpat dignissim risus. Fusce vulputate ligula eu ipsum.</p>
10
+ <form action="" method="post" name="recieverForm">
11
+ <fieldset>
12
+ <input type="text" name="recieverElement" value="old_value" />
13
+ </fieldset>
14
+ </form>
15
+ </body>
16
+ </html>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frame 1</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1>Frame 3</h1>
9
+ <p>Nam accumsan. Donec nisi pede, interdum eget, ultrices ac, vulputate vitae, nunc. Nulla lorem. Duis cursus pharetra dolor. Nulla accumsan hendrerit leo. Vivamus commodo. Nullam dignissim adipiscing est. Aliquam vitae orci in risus lobortis luctus. Ut luctus fermentum ligula. Nullam ipsum. Suspendisse sit amet nisi.</p>
10
+ <input id=alert_button type=button onclick="alert('I am an alert')" value=Alert>
11
+ <input id=confirm_button type=button onclick="this.value = confirm('set the value')" value=Confirm>
12
+ <input id=prompt_button type=button onclick='this.value = prompt("enter your name", "John Doe")' value=Prompt>
13
+ </body>
14
+ </html>
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Frames</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <frameset cols="40%, 40%, 20%">
8
+ <frame src="frame_1.html" id="frame_1" name="frame1" />
9
+ <frame src="frame_2.html" id="frame_2" name="frame2" />
10
+ <frame src="frame_3.html" id="frame_3" name="frame3" />
11
+ </frameset>
12
+ </html>
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Iframes</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ </head>
7
+ <body>
8
+ <h1>Iframes</h1>
9
+ <iframe src="frame_1.html" id="frame_1" name="frame1" class="iframe"></iframe>
10
+ <iframe src="frame_2.html" id="frame_2" name="frame2" class="iframe"></iframe>
11
+ </body>
12
+ </html>
@@ -0,0 +1,17 @@
1
+ <html>
2
+ <head>
3
+ <title>modal dialog test page</title>
4
+ </head>
5
+ <body>
6
+
7
+ <script type="text/javascript">
8
+ function modal() {
9
+ var retValue = window.showModalDialog(
10
+ "modal_1.html", self,
11
+ "status:no;resizable:Yes;help:no;maximize:no;minimize:no;scrollbars:no;");
12
+ }
13
+ </script>
14
+
15
+ <input id=launch_modal_button type=button onclick='return modal();' value="Launch a modal" />
16
+ </body>
17
+ </html>
@@ -0,0 +1,38 @@
1
+ <html>
2
+
3
+ <head>
4
+ <title>Modal 1</title>
5
+
6
+ <script>
7
+ function delay_action(other_function) {
8
+ setTimeout(other_function, 3000);
9
+ }
10
+
11
+ function close_window() {
12
+ window.returnValue = 22
13
+ window.close()
14
+ }
15
+
16
+ function modal1() {
17
+ var retValue = window.showModalDialog(
18
+ "modal_2.html", self,
19
+ "status:no;resizable:Yes;help:no;maximize:no;minimize:no;scrollbars:no;");
20
+ }
21
+
22
+ </script>
23
+
24
+ </head>
25
+
26
+ <body>
27
+
28
+ <h2>Modal 1</h2>
29
+
30
+ <h3>Close buttons</h3>
31
+ <input id=close_window type=button onclick="close_window()" value="Close window"/>
32
+ <input id=delayed_close type=button onclick="delay_action('close_window()')" value="Close window with delay" />
33
+
34
+ <h3>Nested modal</h3>
35
+ <input id=launch_modal_button type=button onclick='return modal1();' value="Launch another modal"/>
36
+
37
+ </body>
38
+ </html>
@@ -0,0 +1,27 @@
1
+ <html>
2
+
3
+ <head>
4
+ <title>Modal 2</title>
5
+
6
+ <script>
7
+ function delay_action(other_function) {
8
+ setTimeout(other_function, 3000);
9
+ }
10
+
11
+ function close_window() {
12
+ self.close()
13
+ }
14
+ </script>
15
+
16
+ </head>
17
+
18
+ <body>
19
+
20
+ <h2>Modal 2</h2>
21
+
22
+ <h3>Close buttons</h3>
23
+ <input id=close_window2 type="button" onclick="close_window()" value="Close window"/>
24
+ <input id=delayed_close2 type=button onclick="delay_action('close_window()')" value="Close window with delay" />
25
+
26
+ </body>
27
+ </html>
@@ -0,0 +1,52 @@
1
+ <html>
2
+ <head>
3
+ <title>Nested Elements</title>
4
+ </head>
5
+ <body>
6
+ <div id="div_id">
7
+ <a href="success.html">Success</a>
8
+ <form method="get" action="success.html">
9
+ <input id='button_id' name='button_name' class='button_class' type="submit" value="Click Me">
10
+ </form>
11
+ <input size="40" type="text"/>
12
+ <input size="40" type="hidden" value="LeanDog"/>
13
+ <textarea rows="2" cols="20"></textarea>
14
+ <select>
15
+ <option value="option1">Test 1</option>
16
+ <option value="option2">Test 2</option>
17
+ </select>
18
+ <input type="checkbox" value="0"/>
19
+ <input type="radio" value="Milk"/>
20
+ <input type="file"/>
21
+ <div>
22
+ page-object rocks!
23
+ </div>
24
+ <span>
25
+ My alert
26
+ </span>
27
+ <table>
28
+ <tr>
29
+ <td>Data1</td>
30
+ <td>Data2</td>
31
+ </tr>
32
+ </table>
33
+ <img src="images/circle.png"/>
34
+ <p>This is a paragraph.</p>
35
+
36
+ <h1>h1's are cool</h1>
37
+ <h2>h2's are cool</h2>
38
+ <h3>h3's are cool</h3>
39
+ <h4>h4's are cool</h4>
40
+ <h5>h5's are cool</h5>
41
+ <h6>h6's are cool</h6>
42
+ <ol>
43
+ <li>Number One</li>
44
+ <li>Number Two</li>
45
+ </ol>
46
+ <ul>
47
+ <li>Item One</li>
48
+ <li>Item Two</li>
49
+ </ul>
50
+ </div>
51
+ </body>
52
+ </html>
@@ -0,0 +1 @@
1
+ frame 1
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ </head>
6
+ <body>
7
+ <p>
8
+ <iframe id="three" src="nested_frame_3.html"></iframe>
9
+ </p>
10
+ </body>
11
+ </html>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5
+ <title>
6
+ Title
7
+ </title>
8
+ </head>
9
+ <body>
10
+ <p>
11
+ <a id="four" href="success.html" target="_top">this link should open the page success page</a>
12
+ </p>
13
+ </body>
14
+ </html>
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+ </head>
6
+ <frameset cols="20%, 80%">
7
+ <frame id="one" src="nested_frame_1.html">
8
+ <frame id="two" src="nested_frame_2.html">
9
+ </frameset>
10
+ </html>
@@ -3,87 +3,93 @@
3
3
  <title>Static Elements Page</title>
4
4
  </head>
5
5
  <body>
6
- <h2>Static Elements Page</h2>
7
-
8
-
9
- <h3>Text Field</h3>
10
- <input id="text_field_id" name="text_field_name" class="text_field_class"
6
+ <p id="p_id" name="p_name" class="p_class">Static Elements Page</p>
7
+ <input id="text_field_id" name="text_field_name" class="text_field_class" title="text_field_title"
11
8
  size="40" type="text" />
12
9
 
13
- <h3>Hidden Field</h3>
14
10
  <input id="hidden_field_id" name="hidden_field_name" class="hidden_field_class"
15
11
  size="40" type="hidden" value="12345" />
16
12
 
17
- <h3>Text Area</h3>
18
13
  <textarea rows="2" cols="20" id="text_area_id" class="text_area_class" name="text_area_name"></textarea>
19
14
 
20
- <h3>Select List</h3>
21
15
  <select name="sel_list_name" id="sel_list_id", class="sel_list_class">
22
16
  <option value="option1">Test 1</option>
23
17
  <option value="option2">Test 2</option>
24
18
  </select>
25
19
 
26
20
 
27
- <h3>Link</h3>
28
21
  <a href="success.html" id="link_id" name="link_name" class="link_class" >Google Search</a>
29
22
 
30
- <h3>Check Boxes</h3>
31
23
  <input id="cb_id" name="cb_name" class="cb_class" type="checkbox" value="1" />
32
24
 
33
- <h3>Radio Buttons</h3>
34
25
  <input type="radio" id="milk_id" name="milk_name" class="milk_class" value="Milk"> Milk <br />
35
26
  <input type="radio" id="butter_id" name="butter_name" class="butter_class" value="Butter">Butter
36
27
 
37
- <h3>Div</h3>
38
28
  <div id="div_id" name="div_name" class="div_class">
39
29
  page-object rocks!
40
30
  </div>
41
31
 
42
- <h3>Span</h3>
43
32
  <span id="span_id" name="span_name" class="span_class">
44
33
  My alert
45
34
  </span>
46
35
 
47
- <h3>Table</h3>
48
36
  <table id='table_id' name='table_name' class='table_class' border='1'>
49
37
  <tr>
50
38
  <td>Data1</td><td>Data2</td>
51
39
  </tr>
52
40
  <tr>
53
- <td>Data3</td><td id='cell_id', name='cell_name' class='cell_class'>Data4</td>
41
+ <td>Data3</td>
42
+ <td id='cell_id', name='cell_name' class='cell_class'>Data4</td>
54
43
  </tr>
55
44
  </table>
56
45
 
57
- <h3>Button</h3>
58
46
  <form method="get" action="success.html">
59
- <input id='button_id' name='button_name' class='button_class' type="submit" value="Click Me">
47
+ <input id='button_id' name='button_name' class='button_class' type="submit" value="Click Me"/>
48
+ <input id='button_image_id' type='image' src='images/submit.gif' alt='Submit'/>
49
+ <button type='button' id='btn_id' name='btn_name' class='btn_class'>Click Me Too</button>
50
+ <input value="Disabled" disabled="true" type="submit"/>
60
51
  </form>
61
52
 
62
- <h3>Image</h3>
63
- <img src="images/circle.png" id="image_id" name="image_name" class="image_class">
53
+ <img src="images/circle.png" id="image_id" name="image_name" class="image_class", alt="image_alt">
64
54
 
65
- <h3>Form</h3>
66
55
  <form id="form_id" class="form_class" name="form_name" action="/">
67
56
  </form>
57
+ <input type="file" name="file_field_name" id="file_field_id" class="file_field_class" title="file_field_title" />
68
58
 
69
- <h3>Unordered List</h3>
70
59
  <ul id="ul_id" name="ul_name" class="ul_class">
71
60
  <li id="li_id" name="li_name" class="li_class">Item One</li>
72
61
  <li>Item Two</li>
73
62
  <li>Item Three</li>
74
63
  </ul>
75
64
 
76
- <h3>Ordered List</h3>
77
65
  <ol id="ol_id" name="ol_name" class="ol_class">
78
66
  <li>Number One</li>
79
67
  <li>Number Two</li>
80
68
  <li>Number Three</li>
81
69
  </ol>
82
70
 
83
- <h3>Links for multi select</h3>
84
71
  <a href="success.html">Hello</a>
85
72
  <a href="success.html">Hello</a>
86
73
  <a href="success.html">Hello</a>
87
74
 
75
+ <input id=alert_button type=button onclick="alert('I am an alert')" value=Alert>
76
+ <input id=confirm_button type=button onclick="this.value = confirm('set the value')" value=Confirm>
77
+ <input id=prompt_button type=button onclick="this.value = prompt('enter your name','John Doe')" value=Prompt>
78
+
79
+ <h1 id="h1_id" class="h1_class" name="h1_name">h1's are cool</h1>
80
+ <h2 id="h2_id" class="h2_class" name="h2_name">h2's are cool</h2>
81
+ <h3 id="h3_id" class="h3_class" name="h3_name">h3's are cool</h3>
82
+ <h4 id="h4_id" class="h4_class" name="h4_name">h4's are cool</h4>
83
+ <h5 id="h5_id" class="h5_class" name="h5_name">h5's are cool</h5>
84
+ <h6 id="h6_id" class="h6_class" name="h6_name">h6's are cool</h6>
85
+
86
+ <a href="success.html" target="_blank">New Window</a>
87
+ <input type="text" id="onfocus_text_field" onfocus="document.getElementById('onfocus_test').innerHTML = 'changed by onfocus event'" />
88
+ <div id="onfocus_test"></div>
89
+
90
+ <div id="parent_div">
91
+ <a href="success.html" id="child">Success</a>
92
+ </div>
93
+
88
94
  </body>
89
95
  </html>
@@ -20,6 +20,8 @@ Feature: Image
20
20
  | name |
21
21
  | xpath |
22
22
  | index |
23
+ | alt |
24
+ | src |
23
25
 
24
26
  @multi
25
27
  Scenario Outline: Locating an image using multiple parameters
@@ -31,3 +33,9 @@ Feature: Image
31
33
  | param1 | param2 |
32
34
  | class | index |
33
35
  | name | index |
36
+
37
+ @locator
38
+ Scenario: Finding an image dynamically
39
+ When I get the image element while the script is executing
40
+ Then the image should be "106" pixels wide
41
+ And the image should be "106" pixels tall
@@ -37,3 +37,8 @@ Feature: Links
37
37
  Given I am on the static elements page
38
38
  When I select a link labeled "Hello" and index "1"
39
39
  Then the page should contain the text "Success"
40
+
41
+ @locator
42
+ Scenario: Finding a link dynamically
43
+ When I select a link while the script is executing
44
+ Then the page should contain the text "Success"
@@ -29,3 +29,8 @@ Feature: List item
29
29
  | param1 | param2 |
30
30
  | class | index |
31
31
  | name | index |
32
+
33
+ @locator
34
+ Scenario: Finding a list item dynamically
35
+ When I search for the list item while the script is executing
36
+ Then the text should be "Item One"
@@ -0,0 +1,9 @@
1
+ Feature: handing modal dialog
2
+
3
+ Background:
4
+ Given I am on the modal page
5
+
6
+
7
+ Scenario: Interacting with a modal dialog
8
+ When I open a modal dialog
9
+ Then I should be able to close the modal