mk_firewatir 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/LICENSE +32 -0
  2. data/lib/firewatir.rb +41 -0
  3. data/lib/firewatir/container.rb +491 -0
  4. data/lib/firewatir/document.rb +239 -0
  5. data/lib/firewatir/element.rb +1369 -0
  6. data/lib/firewatir/element_collections.rb +314 -0
  7. data/lib/firewatir/elements/button.rb +15 -0
  8. data/lib/firewatir/elements/file_field.rb +29 -0
  9. data/lib/firewatir/elements/form.rb +40 -0
  10. data/lib/firewatir/elements/frame.rb +55 -0
  11. data/lib/firewatir/elements/hidden.rb +56 -0
  12. data/lib/firewatir/elements/image.rb +139 -0
  13. data/lib/firewatir/elements/input_element.rb +44 -0
  14. data/lib/firewatir/elements/link.rb +76 -0
  15. data/lib/firewatir/elements/non_control_element.rb +53 -0
  16. data/lib/firewatir/elements/non_control_elements.rb +108 -0
  17. data/lib/firewatir/elements/not_used.rb +278 -0
  18. data/lib/firewatir/elements/option.rb +131 -0
  19. data/lib/firewatir/elements/radio_check_common.rb +163 -0
  20. data/lib/firewatir/elements/select_list.rb +188 -0
  21. data/lib/firewatir/elements/table.rb +218 -0
  22. data/lib/firewatir/elements/table_cell.rb +54 -0
  23. data/lib/firewatir/elements/table_row.rb +100 -0
  24. data/lib/firewatir/elements/text_field.rb +218 -0
  25. data/lib/firewatir/exceptions.rb +10 -0
  26. data/lib/firewatir/firefox.rb +984 -0
  27. data/lib/firewatir/jssh_socket.rb +101 -0
  28. data/lib/firewatir/version.rb +5 -0
  29. data/lib/firewatir/winClicker.rb +122 -0
  30. data/lib/firewatir/x11.rb +192 -0
  31. data/unittests/attach_to_new_window_test.rb +49 -0
  32. data/unittests/bug_fixes_test.rb +195 -0
  33. data/unittests/buttons_xpath_test.rb +88 -0
  34. data/unittests/checkbox_test.rb +158 -0
  35. data/unittests/checkbox_xpath_test.rb +107 -0
  36. data/unittests/div_test.rb +275 -0
  37. data/unittests/ff_test.rb +47 -0
  38. data/unittests/filefield_test.rb +49 -0
  39. data/unittests/filefield_xpath_test.rb +35 -0
  40. data/unittests/form_test.rb +296 -0
  41. data/unittests/frame_test.rb +159 -0
  42. data/unittests/hidden_test.rb +85 -0
  43. data/unittests/hidden_xpath_test.rb +72 -0
  44. data/unittests/html/JavascriptClick.html +42 -0
  45. data/unittests/html/blankpage.html +12 -0
  46. data/unittests/html/buttons1.html +61 -0
  47. data/unittests/html/checkboxes1.html +71 -0
  48. data/unittests/html/complex_table.html +36 -0
  49. data/unittests/html/cssTest.html +42 -0
  50. data/unittests/html/div.html +72 -0
  51. data/unittests/html/div_xml.html +21 -0
  52. data/unittests/html/fileupload.html +45 -0
  53. data/unittests/html/formTest1.html +39 -0
  54. data/unittests/html/forms2.html +45 -0
  55. data/unittests/html/forms3.html +132 -0
  56. data/unittests/html/forms4.html +27 -0
  57. data/unittests/html/frame_buttons.html +4 -0
  58. data/unittests/html/frame_links.html +4 -0
  59. data/unittests/html/frame_multi.html +5 -0
  60. data/unittests/html/iframeTest.html +15 -0
  61. data/unittests/html/iframeTest1.html +14 -0
  62. data/unittests/html/iframeTest2.html +6 -0
  63. data/unittests/html/images/1.gif +0 -0
  64. data/unittests/html/images/2.GIF +0 -0
  65. data/unittests/html/images/3.GIF +0 -0
  66. data/unittests/html/images/button.jpg +0 -0
  67. data/unittests/html/images/circle.jpg +0 -0
  68. data/unittests/html/images/minus.GIF +0 -0
  69. data/unittests/html/images/originaltriangle.jpg +0 -0
  70. data/unittests/html/images/plus.gif +0 -0
  71. data/unittests/html/images/square.jpg +0 -0
  72. data/unittests/html/images/triangle.jpg +0 -0
  73. data/unittests/html/images1.html +67 -0
  74. data/unittests/html/javascriptevents.html +35 -0
  75. data/unittests/html/link_pass.html +11 -0
  76. data/unittests/html/links1.html +42 -0
  77. data/unittests/html/links2.html +11 -0
  78. data/unittests/html/modal_dialog.html +8 -0
  79. data/unittests/html/modal_dialog_launcher.html +12 -0
  80. data/unittests/html/nestedFrames.html +6 -0
  81. data/unittests/html/new_browser.html +18 -0
  82. data/unittests/html/new_browser_popup.html +8 -0
  83. data/unittests/html/pass.html +10 -0
  84. data/unittests/html/popups1.html +60 -0
  85. data/unittests/html/pre.html +28 -0
  86. data/unittests/html/radioButtons1.html +71 -0
  87. data/unittests/html/redirect.html +10 -0
  88. data/unittests/html/redirect1.html +9 -0
  89. data/unittests/html/redirect2.html +9 -0
  90. data/unittests/html/redirect3.html +9 -0
  91. data/unittests/html/select_tealeaf.html +54 -0
  92. data/unittests/html/selectboxes1.html +55 -0
  93. data/unittests/html/simple_table.html +26 -0
  94. data/unittests/html/simple_table_buttons.html +104 -0
  95. data/unittests/html/simple_table_columns.html +74 -0
  96. data/unittests/html/table1.html +165 -0
  97. data/unittests/html/tableCell_using_xpath.html +19 -0
  98. data/unittests/html/textarea.html +30 -0
  99. data/unittests/html/textfields1.html +62 -0
  100. data/unittests/html/textsearch.html +44 -0
  101. data/unittests/images_test.rb +198 -0
  102. data/unittests/images_xpath_test.rb +118 -0
  103. data/unittests/javascript_test.rb +75 -0
  104. data/unittests/links_test.rb +231 -0
  105. data/unittests/links_xpath_test.rb +79 -0
  106. data/unittests/mozilla_all_tests.rb +7 -0
  107. data/unittests/pre_test.rb +75 -0
  108. data/unittests/radios_test.rb +166 -0
  109. data/unittests/radios_xpath_test.rb +101 -0
  110. data/unittests/redirect_test.rb +41 -0
  111. data/unittests/selectbox_test.rb +142 -0
  112. data/unittests/selectbox_xpath_test.rb +129 -0
  113. data/unittests/setup.rb +29 -0
  114. data/unittests/table_test.rb +385 -0
  115. data/unittests/table_xpath_test.rb +185 -0
  116. data/unittests/textfields_test.rb +234 -0
  117. data/unittests/textfields_xpath_test.rb +113 -0
  118. metadata +208 -0
@@ -0,0 +1,36 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Tables
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.0 $"
9
+ <br>
10
+ <br>
11
+
12
+ The table below has 2 smaller tables, one on each row
13
+ <br>
14
+ red is the main table
15
+ green is a table and grey is also a table
16
+
17
+ <table border =1 bgcolor=red>
18
+ <tr>
19
+ <td><table bgcolor=grey ><tr>
20
+ <td> subtable1 Row 1 Col1 </td>
21
+ <td> subtable1 Row 1 Col2 </td>
22
+ </tr>
23
+ </table>
24
+ </td>
25
+ </tr>
26
+ <tr>
27
+ <td><table bgcolor=silver><tr>
28
+ <td> subtable2 Row 1 Col1 </td>
29
+ <td> subtable2 Row 1 Col2 </td>
30
+ </tr>
31
+ </table>
32
+ </td>
33
+ </tr>
34
+ </table>
35
+ </body>
36
+ </html>
@@ -0,0 +1,42 @@
1
+ <html>
2
+ <head>
3
+ <title>Test Hidden Message</title>
4
+
5
+ <style type="text/css">
6
+ div.hide { display: none; margin-left: auto; margin-right: auto; }
7
+ div.show { display: block; margin-left: auto; margin-right: auto; }
8
+ #Container { background: #f00; color: #fff; width: 300px; height: 300px; padding-top: 100px; text-align: center; font: bold 2em Verdana, Helvetica, sans-serif; }
9
+
10
+ </style>
11
+
12
+ <script type="text/javascript">
13
+ function show(divId)
14
+ {
15
+ var divContainer = document.getElementById("Container");
16
+ var divArr = divContainer.getElementsByTagName("div");
17
+ for (var i = 0; i < divArr.length; i++)
18
+ {
19
+ if ( divArr[i].id == divId )
20
+ {
21
+ divArr[i].className = "show";
22
+ }
23
+ else
24
+ {
25
+ divArr[i].className = "hide";
26
+ }
27
+ }
28
+ }
29
+ </script>
30
+ </head>
31
+
32
+ <body>
33
+ <div id="Container">
34
+ <div id="successError" class="hide">Success!</div><div id="failureError" class="hide">Failure!</div>
35
+ </div>
36
+ <form style="width: 300px; text-align: center;">
37
+ <p>Click on a button to display a message.</p>
38
+ <input type="button" name="success" value="Success" onclick="show( this.name + 'Error' );" />
39
+ <input type="button" name="failure" value="Failure" onclick="show( this.name + 'Error' );" />
40
+ </form>
41
+ </body>
42
+ </html>
@@ -0,0 +1,72 @@
1
+ <DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>Test page for Div</title>
5
+ <link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.0 $"
9
+ <br>
10
+ <br>
11
+ <div id="div1" title="Test1" attribute="attribute" ondblclick="javascript: window.location.href='pass.html';">This text is in a div with an id of div1 and title of test1</div>
12
+ <br>
13
+ <div id="div2" class="blueText">This text is in a div with an id of div2</div>
14
+ <br>
15
+ <div id="div3" onClick="javascript:document.all.text1.value=parseInt(document.all.text1.value)+1">This div has an onClick that increments text1</div>
16
+ <div id="div4" onClick="javascript:document.all.text1.value=parseInt(document.all.text1.value)-1">This div has an onClick that decrements text1</div>
17
+ This input field gets its value from div3. Its name is text1<input type="text" name="text1" value="0">
18
+ <br>
19
+ <br>
20
+ The following DIVS are used to test buttons and other objects in a div
21
+ <div id="buttons1">
22
+ <input type="button" name="b1" value="Button 1" onClick="javascript:document.all.div_text1.value='button1';">
23
+ </div>
24
+ <div id="buttons2">
25
+ <input type="button" name="b2" value="Button 2" onClick="javascript:document.all.div_text1.value='button2';">
26
+ <input type="button" name="b3" value="Button 3" onClick="javascript:document.all.div_text1.value='button3';">
27
+ </div>
28
+ <div id="text_fields1" class="divClass" name="divName">
29
+ Text1: <input type="text" name="div_text1">&nbsp;&nbsp;&nbsp;&nbsp; Text2: <input type="text" name="div_text2">&nbsp;&nbsp;&nbsp;&nbsp;
30
+ Text3: <input type="text" name="div_text3">
31
+ </div>
32
+ <br>
33
+ <hr>
34
+ Span Tests
35
+ <br>
36
+ <br>
37
+ <span id="span1" title="Test2" onClick="window.location.href='pass.html'">This text is in a span with an id of span1 and title of test2</span>
38
+ <br>
39
+ <span id="span2" class="blueText">This text is in a span with an id of span2</span>
40
+ <br>
41
+ <span id="span3" onClick="javascript:document.all.text2.value=parseInt(document.all.text2.value)+1">This span has an onClick that increments text2</span>
42
+ <br>
43
+ <span id="span4" onClick="javascript:document.all.text2.value=parseInt(document.all.text2.value)-1">This span has an onClick that decrements text2</span>
44
+ <br>
45
+ This input field gets its value from span3. Its name is text1<input type="text" name="text2" value="0">
46
+ <br>
47
+ <br>
48
+ The following spans are used to test buttons and other objects in a span
49
+ <br>
50
+ <span id="buttons1">
51
+ <input type="button" name="b1" value="Button 1" onClick="javascript:document.all.span_text1.value='button1';">
52
+ </span>
53
+ <br>
54
+ <span id="buttons2">
55
+ <input type="button" name="b2" value="Button 2" onClick="javascript:document.all.span_text1.value='button2';">
56
+ <input type="button" name="b3" value="Button 3" onClick="javascript:document.all.span_text1.value='button3';">
57
+ </span>
58
+ <br>
59
+ <span id="text_fields1" name="spanName" class="spanClass">
60
+ Text1: <input type="text" name="span_text1">&nbsp;&nbsp;&nbsp;&nbsp; Text2: <input type="text" name="span_text2">&nbsp;&nbsp;&nbsp;&nbsp; Text3: <input type="text" name="span_text3">
61
+ </span>
62
+ <br>
63
+ <br>
64
+ <p id="number1" title="P_tag_1" class="redText">This text is in a p with an id of
65
+ number1 and title of P_tag_1</p>
66
+ <br>
67
+ <p id="number2" title="P_tag_2" class="italicText">This text is in a p with an id of number2</p>
68
+ <br>
69
+ <p id="number3" title="test_3" class="blueText">This text is in a p with an id of
70
+ number3</p>
71
+ </body>
72
+ </html>
@@ -0,0 +1,21 @@
1
+ <html>
2
+ <head>
3
+ <title>Test</title>
4
+ </head>
5
+
6
+ <XML ID="Tags">
7
+ <Data>
8
+ <ButtonList>List</ButtonList>
9
+ <ButtonCreate>Create</ButtonCreate>
10
+ </Data>
11
+ </XML>
12
+
13
+
14
+ <body bgcolor="#ffff80">
15
+ This is the main portal screen
16
+ <div class="ButtonAction">
17
+ <a href="missing.html" ONMOUSEOVER="Gen_img_act('ButtonList','')" ONMOUSEOUT="Gen_img_inact('ButtonList','')" NAME="ButtonList" ID="ButtonList" style="text-decoration: none; position:relative"><span ID="ButtonListSpan" class="ButtonLabelOn" style="position:absolute; right:25; text-align: right; top:2; z-index:2; width:60px; height:20px; cursor:hand" ONMOUSEOVER="Gen_img_act('ButtonList','')" ONMOUSEOUT="Gen_img_inact('ButtonList','')" datasrc="#Tags" datafld="ButtonList"></span></a><br>
18
+ <a href="missing2.html" ONMOUSEOVER="Gen_img_act('ButtonCreate','')" ONMOUSEOUT="Gen_img_inact('ButtonCreate','')" NAME="ButtonCreate" ID="ButtonCreate" style="text-decoration: none; position:relative"><span ID="ButtonCreateSpan" class="ButtonLabelOn" style="position:absolute; right:25; text-align: right; top:2; z-index:2; width:60px; height:20px; cursor:hand" ONMOUSEOVER="Gen_img_act('ButtonCreate','')" ONMOUSEOUT="Gen_img_inact('ButtonCreate','')" datasrc="#Tags" datafld="ButtonCreate"></span></a>
19
+ </div>
20
+ </body>
21
+ </html>
@@ -0,0 +1,45 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for File Fields
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.0 $"
9
+ <br>
10
+ <br>
11
+ <table>
12
+
13
+ <tr>
14
+ <td>
15
+ <input type = file name = file1 value = 'fileupload.html' class='file_class' >number 1
16
+ <br>
17
+ <input type = file id= file2 value = 'fileupload.html'>
18
+
19
+
20
+ <td>These file fields are not in a form
21
+
22
+
23
+ <tr>
24
+ <td>
25
+ <input type = file name = disabled value = 'fileupload.html' disabled>
26
+ <td>
27
+ Disabled file box
28
+
29
+ <form name = test1 method = get action = pass.html>
30
+ <tr>
31
+ <td>
32
+ <input type = file name = file3 value = 'fileupload.html' onchange="this.alt = 'changed'">
33
+ <td> This is used in file3 in form test1
34
+
35
+ <input name="upload" type="submit" value="upload">
36
+ </form>
37
+ </table>
38
+
39
+ These file fields are used to test :beforeText and :afterText
40
+ <br>
41
+ <input type = file name = beforetest value = 'fileupload.html'>This Text After
42
+ <br>
43
+ This Text Before<input type = file name=aftertest value = 'fileupload.html'>
44
+
45
+ </html>
@@ -0,0 +1,39 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for forms
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: $Revision 1.0$
9
+ <br>
10
+ <br>
11
+ <table>
12
+ <tr>
13
+ <td>
14
+ <form name = test1 method = get action = pass.html>
15
+
16
+ <input type = button name = b1 id = b2 value = "Click Me" onClick="javascript:document.location='pass.html';">
17
+ <br><input type = button name = b4 id=b5 value = "Disabled Button" onClick="javascript:document.location='fail.html';" disabled>
18
+
19
+ </form>
20
+ <td> this form has name = test1 method = get action = pass.html
21
+
22
+
23
+ <tr>
24
+ <td>
25
+ <form name = test2 method = get action = pass2.html>
26
+ <br><input type = submit value=Submit>
27
+ </form>
28
+ <td> this form has name = test2 method = get action = pass2.html
29
+
30
+ <tr>
31
+ <td>
32
+ <form id = test3 method = post action = pass3.html>
33
+ <br><input type = image src=images/image1.gif name =sub3>
34
+ </form>
35
+ <td> this form has id = test3 method = post action = pass3.html
36
+
37
+
38
+
39
+ </html>
@@ -0,0 +1,45 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Forms
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.0 $"
9
+ <br>
10
+ <br>
11
+ <table>
12
+ <tr>
13
+ <td>
14
+ <form method = get action = pass.html>
15
+ <input type = button name = b1 id = b2 value = "Click Me" >
16
+ </form>
17
+
18
+ <td> Form with no name
19
+
20
+
21
+ <tr>
22
+ <td>
23
+ <form name = test2 id = f2 method = get action = pass2.html>
24
+ <br><input type = submit value=Submit>
25
+ </form>
26
+ <td> This form is identical to the one above
27
+
28
+
29
+
30
+ <tr>
31
+ <td>
32
+ <form name = test3 method = get action = pass2.html>
33
+ <br><input type = submit value=Submit>
34
+ </form>
35
+ <td> This form has a name
36
+ <tr>
37
+ <td>
38
+ <form name = test2 method = get action = pass2.html>
39
+ <br><input type = submit value=Submit>
40
+ </form>
41
+ <td> This form has a name
42
+
43
+
44
+ </body>
45
+ </html>
@@ -0,0 +1,132 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Forms
5
+ </title>
6
+
7
+ <script>
8
+ function showHidden(){
9
+
10
+ document.all.vis1.value = document.all.hid1.value;
11
+ document.all.vis2.value = document.getElementById("hidden_1").value;
12
+
13
+ }
14
+
15
+
16
+ </script>
17
+
18
+ </head>
19
+ <body>
20
+ CVS Revision: "$Revision: 1.0 $"
21
+ <br>
22
+ <br>
23
+ <table>
24
+ <tr>
25
+ <td>
26
+ <form method = get action = pass.html>
27
+ <input type = button name = b1 id = b2 value = "Click Me" >
28
+ </form>
29
+
30
+ <td>
31
+
32
+
33
+ <tr>
34
+ <td>
35
+ <form name = test2 method = get action = pass2.html>
36
+ <ul>
37
+ <li>ListItem1 </li>
38
+ <li><span>ListItem2</span></li>
39
+ </ul>
40
+
41
+
42
+ <br><input type = checkbox name = check1 value = 10 >
43
+ <br><input type = checkbox name = check1 value = 20 >
44
+ <br><input type = checkbox name = check1 value = 30 >
45
+
46
+ <br><input selected type = radio name = r1 value = 'a' >
47
+ <br><input type = radio name = r1 value = 'b' >
48
+ <br><input type = radio name = r1 value = 'c' >
49
+ <br><input type = radio name = r1 value = 'd' >
50
+
51
+ <br><input type = text id = t1>
52
+ <br><input type = text id = t2>
53
+
54
+ <br><select name = s1>
55
+ <option>1</option>
56
+ <option>2</option>
57
+ </select>
58
+
59
+ <br><select multiple visible=3 name = s2>
60
+ <option>1</option>
61
+ <option>2</option>
62
+ <option>3</option>
63
+ <option>4</option>
64
+ <option>5</option>
65
+ <option>6</option>
66
+
67
+ </select>
68
+
69
+
70
+
71
+ <br><input type = submit value=Submit><input type = reset id = reset_button>
72
+
73
+
74
+
75
+
76
+ </form>
77
+ <td>
78
+ <tr bgcolor=blue>
79
+ <td>
80
+ <input type = text name = g1 value = 'textfield' >
81
+ <br>
82
+ <input type = button name = g1 value ='button'>
83
+ <br>
84
+ <input type = checkbox name = g1 value='1'>
85
+ <br>
86
+ <input type = radio name = g1 value = '2'>
87
+ <br>
88
+
89
+ <td> These objects all have the same name
90
+
91
+
92
+ <tr bgcolor=lightblue>
93
+ <td >
94
+ <input type = text id = g1 value = 'textfield_id' >
95
+ <br>
96
+ <input type = button id = g1 value ='button_id'>
97
+ <br>
98
+ <input type = checkbox id= g1 value='1_id'>
99
+ <br>
100
+ <input type = radio id = g1 value = '2_id'>
101
+ <br>
102
+
103
+ <td> These objects all have the same id
104
+
105
+ <tr>
106
+ <td>
107
+ <form name = buttonsubmit method = get action = pass.html>
108
+ <p>This form is has a submit button that is an image</p>
109
+ <input type = text name = tt1>
110
+ <input type = image src = images/button.jpg alt = "submit" name=imm>
111
+ </form>
112
+
113
+ <form name = has_a_hidden>
114
+ This is in a form. The form has hidden objects.
115
+ <br>
116
+ The first has a name - hid1<input type = hidden name = hid1>
117
+ <br>
118
+ The second has an id- hidden_1<input type = hidden id= hidden_1>
119
+
120
+ Click This Button to see the values in these boxes
121
+ <input type = button value='Show Hidden' onClick='javascript:showHidden();'>
122
+ <br>
123
+ <input type = text name = vis1>
124
+ <br>
125
+ <input type = text name = vis2>
126
+
127
+ </form>
128
+
129
+
130
+
131
+ </body>
132
+ </html>
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>Test page for forms</title>
5
+ </head>
6
+ <body>
7
+ CVS Revision: $Revision 1.0$
8
+ <br>
9
+ <br>
10
+ <table>
11
+ <tbody>
12
+ <tr>
13
+ <td>
14
+ <form name="apple_form" method="get" action="pass.html"> <input
15
+ name="name" value="apple" type="text"> </form>
16
+ </td>
17
+ </tr>
18
+ <tr>
19
+ <td>
20
+ <form name="banana_form" method="get" action="pass2.html"> <input
21
+ name="name" value="banana" type="text"> </form>
22
+ </td>
23
+ </tr>
24
+ </tbody>
25
+ </table>
26
+ </body>
27
+ </html>