watir 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/readme.rb +211 -0
  2. data/unittests/WindowLogonExample.rb +30 -0
  3. data/unittests/WindowLogonExtra.rb +7 -0
  4. data/unittests/all_tests.rb +10 -0
  5. data/unittests/all_tests_concurrent.rb +57 -0
  6. data/unittests/attachToExistingWindow_test.rb +40 -0
  7. data/unittests/buttons_test.rb +131 -0
  8. data/unittests/checkbox_test.rb +149 -0
  9. data/unittests/core_tests.rb +9 -0
  10. data/unittests/css_test.rb +60 -0
  11. data/unittests/div_test.rb +179 -0
  12. data/unittests/errorchecker_test.rb +29 -0
  13. data/unittests/filefield_test.rb +35 -0
  14. data/unittests/form_test.rb +279 -0
  15. data/unittests/frame_test.rb +141 -0
  16. data/unittests/html/blankpage.html +12 -0
  17. data/unittests/html/buttons1.html +40 -0
  18. data/unittests/html/checkboxes1.html +69 -0
  19. data/unittests/html/complex_table.html +36 -0
  20. data/unittests/html/cssTest.html +42 -0
  21. data/unittests/html/div.html +105 -0
  22. data/unittests/html/fileupload.html +45 -0
  23. data/unittests/html/formTest1.html +39 -0
  24. data/unittests/html/forms2.html +45 -0
  25. data/unittests/html/forms3.html +132 -0
  26. data/unittests/html/forms4.html +27 -0
  27. data/unittests/html/frame_buttons.html +4 -0
  28. data/unittests/html/frame_links.html +4 -0
  29. data/unittests/html/frame_multi.html +5 -0
  30. data/unittests/html/iframeTest.html +13 -0
  31. data/unittests/html/iframeTest1.html +7 -0
  32. data/unittests/html/iframeTest2.html +6 -0
  33. data/unittests/html/images/1.gif +0 -0
  34. data/unittests/html/images/2.GIF +0 -0
  35. data/unittests/html/images/3.GIF +0 -0
  36. data/unittests/html/images/button.jpg +0 -0
  37. data/unittests/html/images/circle.jpg +0 -0
  38. data/unittests/html/images/minus.GIF +0 -0
  39. data/unittests/html/images/originaltriangle.jpg +0 -0
  40. data/unittests/html/images/plus.gif +0 -0
  41. data/unittests/html/images/square.jpg +0 -0
  42. data/unittests/html/images/triangle.jpg +0 -0
  43. data/unittests/html/images1.html +52 -0
  44. data/unittests/html/javascriptevents.html +39 -0
  45. data/unittests/html/link_pass.html +11 -0
  46. data/unittests/html/links1.html +37 -0
  47. data/unittests/html/links2.html +11 -0
  48. data/unittests/html/nestedFrames.html +6 -0
  49. data/unittests/html/pass.html +10 -0
  50. data/unittests/html/popups1.html +60 -0
  51. data/unittests/html/radioButtons1.html +71 -0
  52. data/unittests/html/select_tealeaf.html +54 -0
  53. data/unittests/html/selectboxes1.html +55 -0
  54. data/unittests/html/simple_table.html +26 -0
  55. data/unittests/html/simple_table_buttons.html +104 -0
  56. data/unittests/html/simple_table_columns.html +76 -0
  57. data/unittests/html/table1.html +142 -0
  58. data/unittests/html/textarea.html +30 -0
  59. data/unittests/html/textfields1.html +87 -0
  60. data/unittests/html/textsearch.html +44 -0
  61. data/unittests/ie_mock.rb +93 -0
  62. data/unittests/ie_test.rb +50 -0
  63. data/unittests/images_test.rb +179 -0
  64. data/unittests/iostring.rb +30 -0
  65. data/unittests/iostring_test.rb +48 -0
  66. data/unittests/js_events_test.rb +77 -0
  67. data/unittests/jscriptExtraAlert.rb +6 -0
  68. data/unittests/jscriptExtraConfirmCancel.rb +7 -0
  69. data/unittests/jscriptExtraConfirmOk.rb +7 -0
  70. data/unittests/jscriptPushButton.rb +5 -0
  71. data/unittests/jscript_test.rb +57 -0
  72. data/unittests/links_test.rb +169 -0
  73. data/unittests/minmax_test.rb +31 -0
  74. data/unittests/navigate_test.rb +56 -0
  75. data/unittests/non_core_tests.rb +9 -0
  76. data/unittests/pagecontainstext_test.rb +49 -0
  77. data/unittests/popups_test.rb +44 -0
  78. data/unittests/radios_test.rb +164 -0
  79. data/unittests/screen_capture_test.rb +53 -0
  80. data/unittests/selectbox_test.rb +197 -0
  81. data/unittests/send_keys_test.rb +29 -0
  82. data/unittests/setup.rb +47 -0
  83. data/unittests/table_test.rb +306 -0
  84. data/unittests/textAreafields_test.rb +81 -0
  85. data/unittests/textfields_test.rb +239 -0
  86. data/watir.rb +3744 -0
  87. data/watir/AutoItX3.dll +0 -0
  88. data/watir/WindowHelper.rb +47 -0
  89. data/watir/camel_case.rb +37 -0
  90. data/watir/clickJSDialog.rb +19 -0
  91. data/watir/cookiemanager.rb +53 -0
  92. data/watir/exceptions.rb +60 -0
  93. data/watir/screen_capture.rb +115 -0
  94. data/watir/setFileDialog.rb +16 -0
  95. data/watir/testUnitAddons.rb +47 -0
  96. data/watir/watir_simple.rb +475 -0
  97. data/watir/winClicker.rb +505 -0
  98. metadata +152 -0
@@ -0,0 +1,55 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for select boxes
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: $Revision" $
9
+ <br>
10
+ <br>
11
+ <table>
12
+
13
+ <tr>
14
+ <td>
15
+ <select name = sel1 >
16
+ <option value=o1>Option 1
17
+ <option value=o2>Option 2
18
+ <option value=o3 SELECTED >Option 3
19
+ <option value=o4>Option 4
20
+ </select>
21
+ <tr>
22
+ <td>
23
+ <select name = sel2 multiple>
24
+ <option value=o1>Option 1
25
+ <option value=o2>Option 2
26
+ <option value=o3 SELECTED >Option 3
27
+ <option value=o4>Option 4
28
+ <option value=o6>Option 5
29
+ <option value=o6 SELECTED >Option 6
30
+
31
+
32
+ </form>
33
+
34
+ <tr>
35
+ <td>
36
+ <select name = sel3 onChange = 'javascript:document.location="pass.html";'>
37
+ <option value = o1>Option 1
38
+ <option value = o2>Option 2
39
+ <option value = o3 selected>Option 3
40
+ <option value = o4>Option 4
41
+ </select>
42
+
43
+ <td> This box is used for testing the onchange event
44
+
45
+ <tr>
46
+ <td><select id = 'selectbox_4' disabled><option value = o1>Option 1<option value = o2>Option 2
47
+
48
+ <td>This box has an id
49
+
50
+ </table>
51
+
52
+
53
+
54
+
55
+ </html>
@@ -0,0 +1,26 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Tables
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.1 $"
9
+ <br>
10
+ <br>
11
+ <table >
12
+ <tr>
13
+ <td> Row 1 Col1 </td>
14
+ <td> Row 1 Col2 </td>
15
+ </tr>
16
+ <tr>
17
+ <td> Row 2 Col1 </td>
18
+ <td> Row 2 Col2 </td>
19
+ </tr>
20
+ <tr>
21
+ <td> Row 3 Col1 </td>
22
+ <td> Row 3 Col2 </td>
23
+ </tr>
24
+ </table>
25
+ </body>
26
+ </html>
@@ -0,0 +1,104 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ simple table buttons
5
+ </title>
6
+ </head>
7
+ <body>
8
+
9
+ <input type = text name="confirmtext">
10
+ <table >
11
+ <tr>
12
+ <td> <input type = button value = "Click" id = "b1" onClick = "document.all.confirmtext.value = 'CLICK1';"><td>Click1 </td>
13
+ </tr>
14
+ <tr>
15
+ <td> <input type = button value = "Click" onClick = "document.all.confirmtext.value = 'CLICK2';"><td>Click2 </td>
16
+ </tr>
17
+ <tr>
18
+ <td> <input type = button value = "Click" onClick = "document.all.confirmtext.value = 'CLICK3';">
19
+ <input type = button value = "Click too" onClick = "document.all.confirmtext.value = 'CLICK TOO';">
20
+ <td>Click3</td>
21
+ </tr>
22
+ <tr>
23
+ <td> <input type = text value = "Im a text field" ></td>
24
+ </tr>
25
+
26
+
27
+ <tr>
28
+ <td>An input field and a button in the same cell<br> <input type = text name='same_cell' value = "Click ->" ><input type=button value = "Click To Change <-" onClick = "document.all.same_cell.value = '';" </td>
29
+ </tr>
30
+
31
+ </table>
32
+
33
+ This table has 3 images in each row. Each is a seperate cell
34
+ <table>
35
+ <tr>
36
+ <td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
37
+ <tr>
38
+ <td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
39
+ <tr>
40
+ <td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
41
+ </table>
42
+
43
+ This table has 3 images in each row. They are all in the same cell
44
+ <table>
45
+ <tr>
46
+ <td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
47
+ <tr>
48
+ <td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
49
+ <tr>
50
+ <td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
51
+ </table>
52
+
53
+
54
+ <style type="text/css">
55
+ div.hide { display: none; margin-left: auto; margin-right: auto; }
56
+ div.show { display: block; margin-left: auto; margin-right: auto; }
57
+
58
+ tr.hide { display: none; margin-left: auto; margin-right: auto; }
59
+ tr.show { display: block; margin-left: auto; margin-right: auto; }
60
+
61
+ </style>
62
+
63
+
64
+ <script language=javascript>
65
+
66
+ function expand_or_shrink_row( row ) {
67
+
68
+ which_row = 'r' + row;
69
+ which_image = 'i' + row;
70
+ if ( document.getElementById(which_row).className=='hide' ){
71
+ document.getElementById(which_row).className='show';
72
+ document.getElementById(which_image).src='images/minus.gif';
73
+
74
+ }
75
+ else {
76
+ document.getElementById(which_row).className='hide'
77
+ document.getElementById(which_image).src='images/plus.gif'
78
+ }
79
+
80
+ }
81
+
82
+ </script>
83
+
84
+ The table below can show or hide its rows. Click the + (or -) to show or hide the row
85
+ <table id=show_hide>
86
+ <tr><td><img id=i1 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("1")'>
87
+ <tr class = hide id=r1><td>Line 1
88
+ <tr><td><img id=i2 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("2")'>
89
+ <tr class = hide id=r2><td>Line 2
90
+ <tr><td><img id=i3 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("3")'>
91
+ <tr class = hide id=r3><td>Line 3
92
+ <tr><td><img id=i4 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("4")'>
93
+ <tr class = hide id=r4><td>Line 4
94
+ <tr><td><img id=i5 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("5")'>
95
+ <tr class = hide id=r5><td>Line 5
96
+ </table>
97
+
98
+
99
+
100
+
101
+
102
+ </body>
103
+
104
+ </html>
@@ -0,0 +1,76 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for testing column value extraction
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.2 $"
9
+ <br>
10
+ <br>
11
+ <b>Test page for testing column value extraction</b>
12
+ <br>
13
+ <br>
14
+ Single Column
15
+ <table border="1">
16
+ <tr>
17
+ <td>R1C1</td>
18
+ </tr>
19
+ <tr>
20
+ <td>R2C1</td>
21
+ </tr>
22
+ <tr>
23
+ <td>R3C1</td>
24
+ </tr>
25
+ </table>
26
+ <br>
27
+ Multiple Column
28
+ <table border="1">
29
+ <tr>
30
+ <td>R1C1</td>
31
+ <td>R1C2</td>
32
+ <td>R1C3</td>
33
+ </tr>
34
+ <tr>
35
+ <td>R2C1</td>
36
+ <td>R2C2</td>
37
+ <td>R2C3</td>
38
+ </tr>
39
+ <tr>
40
+ <td>R3C1</td>
41
+ <td>R3C2</td>
42
+ <td>R3C3</td>
43
+ </tr>
44
+ </table>
45
+ <br>
46
+ Multiple Column With Jagged ColSpan
47
+ <table border="1">
48
+ <tr>
49
+ <td>R1C1</td>
50
+ <td>R1C2</td>
51
+ <td>R1C3</td>
52
+ </tr>
53
+ <tr>
54
+ <td colspan="2">R2C1</td>
55
+ <td>R2C2</td>
56
+ </tr>
57
+ <tr>
58
+ <td>R3C1</td>
59
+ <td>R3C2</td>
60
+ <td>R3C3</td>
61
+ </tr>
62
+ <tr>
63
+ <td colspan="3">R4C1</td>
64
+ </tr>
65
+ <tr>
66
+ <td rowspan="2">R5C1</td>
67
+ <td>R5C2</td>
68
+ <td>R5C3</td>
69
+ </tr>
70
+ <tr>
71
+ <td>R6C2</td>
72
+ <td>R6C3</td>
73
+ </tr>
74
+ </table>
75
+ </body>
76
+ </html>
@@ -0,0 +1,142 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Tables
5
+ </title>
6
+ </head>
7
+ <body>
8
+
9
+ <script language=javascript>
10
+
11
+ function addRow() {
12
+
13
+ var tbody = document.getElementById('t1' ).getElementsByTagName("TBODY")[0];
14
+
15
+ // Create a TR
16
+ var row = document.createElement("TR");
17
+ row.setAttribute("class", "normal");
18
+ row.setAttribute("border", "1");
19
+
20
+ for (j=0 ; j < document.getElementById('t1' ).rows(1).cells.length; j++) {
21
+ // Create a TD
22
+ var td = document.createElement("TD");
23
+ td.setAttribute("border","1");
24
+ td.innerHTML = "New Cell";
25
+
26
+ // Assign TD to TR and then assign TR to TBODY
27
+ row.appendChild(td);
28
+ }
29
+ tbody.appendChild(row);
30
+ }
31
+
32
+ </script>
33
+
34
+
35
+ CVS Revision: "$Revision: 1.8 $"
36
+ <br>
37
+ <br>
38
+ <table >
39
+ <tr>
40
+ <td> Row 1 Col1
41
+ <td> Row 1 Col2
42
+ <tr>
43
+ <td> Row 2 Col1
44
+ <td> Row 2 Col2
45
+ </table>
46
+
47
+
48
+ <br>
49
+ <br>
50
+ <table id= 't1'>
51
+ <Tr><td colspan=2>Table 2
52
+ <tr>
53
+ <td id=cell1> Row 1 Col1
54
+ <td> Row 1 Col2
55
+ <tr id=row1>
56
+ <td> Row 2 Col1
57
+ <td> Row 2 Col2
58
+ <tr>
59
+ <td> Row 3 Col1
60
+ <td> Row 3 Col2
61
+ <tr>
62
+ <td> Row 4 Col1
63
+ <td> Row 4 Col2
64
+
65
+ </table>
66
+ <br>
67
+ <input type=button value='add row' onClick='javascript:addRow()'>
68
+
69
+ <br>
70
+ <br>
71
+
72
+ The following has a nested table
73
+ <table id='t2' border=1>
74
+ <tr>
75
+ <td>
76
+ cell 1
77
+ <td>
78
+ cell2
79
+ <tr>
80
+ <td>
81
+ <table><tr><td>nest1<td>nest2</table>
82
+ <td>
83
+ Normal
84
+
85
+ </table>
86
+
87
+
88
+ <br>
89
+ This table has 3 body tags. Mostly based on http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/tbody.asp?frame=true
90
+ <br><br>
91
+ <table id=body_test>
92
+ <THEAD>
93
+ <TR>
94
+ <TD>
95
+ This text is in the THEAD.
96
+ </TD>
97
+ </TR>
98
+ </THEAD>
99
+ <TBODY>
100
+ <TR>
101
+ <TD>
102
+ This text is in the FRST TBODY.
103
+ </TD>
104
+ </TR>
105
+ </TBODY>
106
+
107
+ <TBODY>
108
+ <TR>
109
+ <TD>
110
+ This text is in the SECOND TBODY.
111
+ </TD>
112
+ </TR>
113
+ <TR>
114
+ <TD>
115
+ This text is also in the SECOND TBODY.
116
+ </TD>
117
+ </TR>
118
+ </TBODY>
119
+
120
+ <TBODY>
121
+ <TR>
122
+ <TD>
123
+ This text is in the THIRD TBODY.
124
+ </TD>
125
+ </TR>
126
+ </TBODY>
127
+
128
+ </TABLE>
129
+
130
+ <table id=pic_table>
131
+ <tr>
132
+ <td> A picture is in the next cell
133
+ <td><img src=images/circle.jpg>
134
+
135
+ <td> A link is in the next cell
136
+ <td><a href = http://google.com>Google</a>
137
+
138
+
139
+
140
+
141
+ </body>
142
+ </html>
@@ -0,0 +1,30 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
3
+ <HTML>
4
+ <HEAD>
5
+ <title>TextArea-MultiLine</title>
6
+ </HEAD>
7
+ <body MS_POSITIONING="FlowLayout">
8
+
9
+ <form name="Form1" method="post" action="textArea.html" id="Form1">
10
+
11
+ <textarea name="txtMultiLine1" id="txtMultiLine1" style="height:152px;width:248px;">Hello World</textarea>
12
+ <textarea name="txtReadOnly" id="txtReadOnly" style="height:152px;width:248px;" readonly></textarea>
13
+ </form>
14
+ <form name="Form2" method="post" action="textArea.html" id="Form1">
15
+
16
+ <textarea name="txtMultiLine2" id="txtMultiLine2" style="height:152px;width:248px;">
17
+ IExplore.exe is at the top level; it is a small application that is instantiated when Internet Explorer is loaded. This executable application uses Internet Explorer components to perform the navigation, history maintenance, favorites maintenance, HTML parsing and rendering, and so on, while it supplies the toolbar and frame for the stand-alone browser. IExplorer.exe directly hosts the Shdocvw.dll component.
18
+ </textarea>
19
+ <textarea name="txtDisabled" id="txtDisabled" disabled>
20
+ Disabled here </textarea>
21
+ <form name="Form3" method="post" action="textArea.html" id="Form1">
22
+
23
+ <textarea name="txtMultiLine3" id="txtMultiLine3" style="height:152px;width:248px;">
24
+ Shdocvw.dll in turn hosts the Mshtml.dll component, as well as any other Active Document component (such as a Microsoft Office application) that can be loaded in place in the browser when the user navigates to a specific document type. Shdocvw.dll supplies the functionality associated with navigation, in-place linking, favorites and history management, and PICS support. This dynamic-link library (DLL) also exposes interfaces to its host to allow it to be hosted separately as an ActiveX control. The Shdocvw.dll component is more frequently referred to as the WebBrowser Control. In-place linking refers to the ability to click a link in the HTML of the loaded document and to load a new HTML document in the same instance of the WebBrowser Control. If only Mshtml.dll is being hosted, a click on the link results in a new instance of the browser.
25
+ </textarea>
26
+ </form>
27
+ </form>
28
+ </body>
29
+ </HTML>
30
+
@@ -0,0 +1,87 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Text Fields
5
+ </title>
6
+ </head>
7
+ <body>
8
+ CVS Revision: "$Revision: 1.6 $"
9
+
10
+ <script>
11
+ function addEvent(e) {
12
+ document.all.events_text.value = document.all.events_text.value + "\n" + e
13
+ }
14
+ </script>
15
+
16
+
17
+
18
+ <br>
19
+ <br>
20
+ <table>
21
+
22
+ <tr>
23
+ <td>
24
+ <input type = text name = text1 value = 'Hello World'>number 1
25
+ <br>
26
+ <label for=text2>Label For this Field </label><input type = text id= text2 value = 'goodbye all'>
27
+
28
+
29
+ <td>These text fields are not in a form
30
+
31
+
32
+ <tr>
33
+ <td>
34
+ <input type = text name = disabled value = "Cant enter text in me" disabled>
35
+ <td>
36
+ Disabled text box
37
+
38
+ <tr>
39
+ <td>
40
+ <input type = text name = readOnly value = "Cant enter text in me" readonly>
41
+ <br>
42
+ <label for=readOnly2 id=label2>Another Label (pointless- its a readonly box!) </label><input type = text id= readOnly2 value = "Cant enter text in me" readonly>
43
+ <td>
44
+ readonly text boxes
45
+
46
+
47
+
48
+
49
+ <form name = test1 method = get action = pass.html>
50
+ <tr>
51
+ <td>
52
+ <input type = text name = text1 value = 'Ruby'>
53
+ <td> This is used in text1 in form test1
54
+
55
+
56
+
57
+ </form>
58
+ </table>
59
+
60
+ These text fields are used to test :beforeText and :afterText
61
+ <br>
62
+ <input type = text name = beforetest value = 'Before Text Test'>This Text After
63
+ <br>
64
+ This Text Before<input type = text name=aftertest value = 'AfterText Test' title = "This used to test :afterText">
65
+
66
+ <br>
67
+ <br>
68
+
69
+ This Field has javascript events in it
70
+ <input type = text name= events_tester onKeyUp='javascript:addEvent("keyup")' onKeyDown='javascript:addEvent("keydown")' onKeyPress='javascript:addEvent("keypress")'>
71
+ <br>
72
+
73
+ <textarea name = events_text cols = 20 rows = 10 ></textarea>
74
+ <input type=button onClick='document.all.events_text.value=""' value="Clear Events Box">
75
+
76
+
77
+ <br>
78
+ Password Fields
79
+ <br>
80
+
81
+ Password With Name<input type = password name =password1>
82
+ <br>
83
+ <label for=password1>Password With ID ( the text here is a label for it )</label><input type = password id =password1>
84
+
85
+
86
+
87
+ </html>