watir 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,69 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ Test page for Check Boxes
5
+ </title>
6
+
7
+ <script>
8
+
9
+ function setButtonState( )
10
+ {
11
+ if (document.all.foo.disabled )
12
+ document.all.foo.disabled = false
13
+ else
14
+ document.all.foo.disabled = true
15
+ }
16
+ </script>
17
+
18
+ </head>
19
+ <body>
20
+ CVS Revision: $Revision $
21
+ <br>
22
+ <br>
23
+ <table>
24
+ <tr>
25
+ <td>
26
+ CheckBox 1 <input type = checkbox name = box1>
27
+
28
+ <tr>
29
+ <td>
30
+ Disabled<input type = checkbox name = box2 disabled>
31
+
32
+ <tr>
33
+ <td>
34
+ Set<input type = checkbox name = box3 checked>
35
+
36
+ <tr>
37
+ <td>
38
+ These 2 have ids
39
+ <br>
40
+ id= box4 value=1 <input type = checkbox id = box4 name= verify1 value = 1 checked>
41
+ <br>
42
+ id = box4 value=2 <input type = checkbox id = box4 name= verify2 value = 2 checked>
43
+
44
+ <br>
45
+ <br>
46
+ These boxes have the same name, but different values
47
+ <br>
48
+ Name = box4 value=1 <input type = checkbox name = box4 value = 1 checked>
49
+ <br>
50
+ Name = box4 value=2 <input type = checkbox name = box4 value = 2>
51
+ <br>
52
+ Name = box4 value=3 <input type = checkbox name = box4 value = 3>
53
+ <br>
54
+ Name = box4 value=4 <input type = checkbox name = box4 value = 4>
55
+ <br>
56
+ Name = box4 value=5 <input type = checkbox name = box4 value = 5 disabled title="box4-value5">
57
+
58
+ <tr>
59
+ <td>
60
+ Name = box5 value=1 <input type = checkbox name = box5 value = 1 onClick='javascript:setButtonState( )'>
61
+
62
+
63
+ <tr>
64
+ <td>
65
+ <input type = button name = foo value = foo disabled ><td> This button is used with checkbox box5. This button is enabled if the checkbox is enabled
66
+
67
+ </table>
68
+ </body>
69
+ </html>
@@ -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.2 $"
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,105 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>Test page for Div</title>
5
+
6
+ <STYLE TYPE="text/css">
7
+ DIV {font-size: 24pt;}
8
+ .redText {color: red;}
9
+ .blueText {color: blue;}
10
+ .italicText {font-style: italic;}
11
+
12
+ SPAN {font-size: 18pt;}
13
+ .redText {color: red;}
14
+ .blueText {color: blue;}
15
+ .italicText {font-style: italic;}
16
+
17
+
18
+ P{font-size: 24pt;}
19
+ .redText {color: red;}
20
+ .blueText {color: blue;}
21
+ .italicText {font-style: italic;}
22
+
23
+
24
+ </STYLE>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ CVS Revision: "$Revision: 1.5 $"
30
+ <br>
31
+ <br>
32
+ <div id = div1 title = "Test1" >This text is in a div with an id of div1 and title of test1</div>
33
+ <br>
34
+ <div id = div2 class="blueText">This text is in a div with an id of div2</div>
35
+ <br>
36
+ <div id = div3 onClick = "javascript:document.all.text1.value=parseInt(document.all.text1.value)+1">This div has an onClick that increments text1</div>
37
+ <div id = div4 onClick = "javascript:document.all.text1.value=parseInt(document.all.text1.value)-1">This div has an onClick that decrements text1</div>
38
+
39
+ This input field gets its value from div3. Its name is text1<input type = text name = text1 value = 0>
40
+ <br>
41
+ <br> The following DIVS are used to test buttons and other objects in a div
42
+
43
+ <div id=buttons1>
44
+ <input type=button name=b1 value="Button 1" onClick="javascript:document.all.div_text1.value='button1';">
45
+ </div>
46
+ <div id=buttons2>
47
+ <input type=button name=b2 value="Button 2" onClick="javascript:document.all.div_text1.value='button2';">
48
+ <input type=button name=b3 value="Button 3" onClick="javascript:document.all.div_text1.value='button3';">
49
+ </div>
50
+
51
+ <div id=text_fields1>
52
+ Text1: <input type=text name=div_text1 >&nbsp;&nbsp;&nbsp;&nbsp; Text2: <input type=text name=div_text2 >&nbsp;&nbsp;&nbsp;&nbsp; Text3: <input type=text name=div_text3>
53
+ </div>
54
+
55
+
56
+
57
+
58
+ <br>
59
+ <hr>
60
+ Span Tests
61
+ <br>
62
+ <br>
63
+ <span id = span1 title = "Test2" >This text is in a span with an id of span1 and title of test2</span>
64
+ <br>
65
+ <span id = span2 class="blueText">This text is in a span with an id of span2</span>
66
+ <br>
67
+ <span id = span3 onClick = "javascript:document.all.text2.value=parseInt(document.all.text2.value)+1">This span has an onClick that increments text2</span>
68
+ <br>
69
+ <span id = span4 onClick = "javascript:document.all.text2.value=parseInt(document.all.text2.value)-1">This span has an onClick that decrements text2</span>
70
+ <br>
71
+ This input field gets its value from span3. Its name is text1<input type = text name = text2 value = 0>
72
+
73
+ <br>
74
+ <br> The following spans are used to test buttons and other objects in a span
75
+ <br>
76
+ <span id=buttons1>
77
+ <input type=button name=b1 value="Button 1" onClick="javascript:document.all.span_text1.value='button1';">
78
+ </span>
79
+ <br>
80
+ <span id=buttons2>
81
+ <input type=button name=b2 value="Button 2" onClick="javascript:document.all.span_text1.value='button2';">
82
+ <input type=button name=b3 value="Button 3" onClick="javascript:document.all.span_text1.value='button3';">
83
+ </span>
84
+ <br>
85
+ <span id=text_fields1>
86
+ 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>
87
+ </span>
88
+
89
+
90
+
91
+ <br>
92
+ <br>
93
+ <p id = number1 title = "P_tag_1" class=redText >This text is in a p with an id of number1 and title of P_tag_1</p>
94
+ <br>
95
+ <p id = number2 title = "P_tag_2" class=italicText >This text is in a p with an id of number2</p>
96
+ <br>
97
+ <p id = number3 title = "test_3" class=blueText >This text is in a p with an id of number3</p>
98
+
99
+
100
+
101
+
102
+
103
+
104
+ </body>
105
+ </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.1 $"
9
+ <br>
10
+ <br>
11
+ <table>
12
+
13
+ <tr>
14
+ <td>
15
+ <input type = file name = file1 value = 'fileupload.html'>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 = file1 value = 'fileupload.html'>
33
+ <td> This is used in file1 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 $
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.3 $"
9
+ <br>
10
+ <br>
11
+ <table>
12
+ <tr>
13
+ <td>
14
+ <form method = get action = pass.html border=1>
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 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.6 $"
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
+ This form is has a submit button that is an image
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>