author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 29 Jun 2016 21:40:53 +0100 | |
branch | jv |
changeset 1499 | 26a16a04219b |
parent 360 | 9956901550ae |
child 1500 | d406a10b2965 |
permissions | -rw-r--r-- |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
360
diff
changeset
|
1 |
"{ Package: 'stx:goodies/regression' }" |
359 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#HTMLParserTests |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'XML-Presentation' |
|
10 |
! |
|
11 |
||
12 |
!HTMLParserTests class methodsFor:'documentation'! |
|
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
documentation to be added. |
|
17 |
||
18 |
[author:] |
|
19 |
mb (mb@SUNGSAM) |
|
20 |
||
21 |
[instance variables:] |
|
22 |
||
23 |
[class variables:] |
|
24 |
||
25 |
[see also:] |
|
26 |
||
27 |
" |
|
28 |
! |
|
29 |
||
30 |
history |
|
31 |
"Created: / 15-01-2009 / 12:44:33 / mb" |
|
32 |
! ! |
|
33 |
||
34 |
!HTMLParserTests methodsFor:'initialize / release'! |
|
35 |
||
36 |
setUp |
|
37 |
"common setup - invoked before testing." |
|
38 |
||
39 |
super setUp |
|
40 |
! |
|
41 |
||
42 |
tearDown |
|
43 |
"common cleanup - invoked after testing." |
|
44 |
||
45 |
super tearDown |
|
46 |
! ! |
|
47 |
||
48 |
!HTMLParserTests methodsFor:'tests'! |
|
49 |
||
50 |
test01 |
|
51 |
|el| |
|
52 |
||
53 |
el := HTML::HTMLParser parseText:' |
|
54 |
<HEAD> |
|
55 |
</HEAD> |
|
56 |
'. |
|
57 |
el inspect. |
|
58 |
||
59 |
" |
|
60 |
self new test01 |
|
61 |
" |
|
62 |
! |
|
63 |
||
64 |
test02 |
|
65 |
|doc| |
|
66 |
||
67 |
doc := HTML::HTMLParser parseText:' |
|
68 |
<!!-- |
|
69 |
Copyright 2004 ThoughtWorks, Inc |
|
70 |
||
71 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
72 |
you may not use this file except in compliance with the License. |
|
73 |
You may obtain a copy of the License at |
|
74 |
||
75 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
76 |
||
77 |
Unless required by applicable law or agreed to in writing, software |
|
78 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
79 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
80 |
See the License for the specific language governing permissions and |
|
81 |
limitations under the License. |
|
82 |
--> |
|
83 |
<html> |
|
84 |
<head> |
|
85 |
<meta content="text/html; charset=ISO-8859-1" |
|
86 |
http-equiv="content-type"> |
|
87 |
<title>Test Open</title> |
|
88 |
</head> |
|
89 |
<body> |
|
90 |
<table cellpadding="1" cellspacing="1" border="1"> |
|
91 |
<tbody> |
|
92 |
<tr> |
|
93 |
<td rowspan="1" colspan="3">Google Test Search<br> |
|
94 |
</td> |
|
95 |
</tr> |
|
96 |
<tr> |
|
97 |
<td>open</td> |
|
98 |
<td>http://www.google.com/webhp?hl=en</td> |
|
99 |
<td> </td> |
|
100 |
</tr> |
|
101 |
<tr> |
|
102 |
<td>verifyTitle</td> |
|
103 |
<td>Google</td> |
|
104 |
<td> </td> |
|
105 |
</tr> |
|
106 |
<tr> |
|
107 |
<td>type</td> |
|
108 |
<td>q</td> |
|
109 |
<td>Selenium OpenQA</td> |
|
110 |
</tr> |
|
111 |
<tr> |
|
112 |
<td>verifyValue</td> |
|
113 |
<td>q</td> |
|
114 |
<td>Selenium OpenQA</td> |
|
115 |
</tr> |
|
116 |
<tr> |
|
117 |
<td>clickAndWait</td> |
|
118 |
<td>btnG</td> |
|
119 |
<td> </td> |
|
120 |
</tr> |
|
121 |
<tr> |
|
122 |
<td>verifyTextPresent</td> |
|
123 |
<td>openqa.org</td> |
|
124 |
<td> </td> |
|
125 |
</tr> |
|
126 |
<tr> |
|
127 |
<td>verifyTitle</td> |
|
128 |
<td>Selenium OpenQA - Google Search</td> |
|
129 |
<td> </td> |
|
130 |
</tr> |
|
131 |
</tbody> |
|
132 |
||
133 |
</table> |
|
134 |
</body> |
|
135 |
</html> |
|
136 |
'. |
|
137 |
self assert:(doc first tag = '!!DOCTYPE'). |
|
138 |
||
139 |
" |
|
140 |
self new test02 |
|
141 |
" |
|
142 |
! |
|
143 |
||
144 |
test03 |
|
145 |
|doc| |
|
146 |
||
147 |
doc := HTML::HTMLParser parseText:' |
|
148 |
<!!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
149 |
<!!-- |
|
150 |
Copyright 2004 ThoughtWorks, Inc |
|
151 |
||
152 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
153 |
you may not use this file except in compliance with the License. |
|
154 |
You may obtain a copy of the License at |
|
155 |
||
156 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
157 |
||
158 |
Unless required by applicable law or agreed to in writing, software |
|
159 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
160 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
161 |
See the License for the specific language governing permissions and |
|
162 |
limitations under the License. |
|
163 |
--> |
|
164 |
<html> |
|
165 |
<head> |
|
166 |
<meta content="text/html; charset=ISO-8859-1" |
|
167 |
http-equiv="content-type"> |
|
168 |
<title>Test Open</title> |
|
169 |
</head> |
|
170 |
<body> |
|
171 |
<table cellpadding="1" cellspacing="1" border="1"> |
|
172 |
<tbody> |
|
173 |
<tr> |
|
174 |
<td rowspan="1" colspan="3">Google Test Search<br> |
|
175 |
</td> |
|
176 |
</tr> |
|
177 |
<tr> |
|
178 |
<td>open</td> |
|
179 |
<td>http://www.google.com/webhp?hl=en</td> |
|
180 |
<td> </td> |
|
181 |
</tr> |
|
182 |
<tr> |
|
183 |
<td>verifyTitle</td> |
|
184 |
<td>Google</td> |
|
185 |
<td> </td> |
|
186 |
</tr> |
|
187 |
<tr> |
|
188 |
<td>type</td> |
|
189 |
<td>q</td> |
|
190 |
<td>Selenium OpenQA</td> |
|
191 |
</tr> |
|
192 |
<tr> |
|
193 |
<td>verifyValue</td> |
|
194 |
<td>q</td> |
|
195 |
<td>Selenium OpenQA</td> |
|
196 |
</tr> |
|
197 |
<tr> |
|
198 |
<td>clickAndWait</td> |
|
199 |
<td>btnG</td> |
|
200 |
<td> </td> |
|
201 |
</tr> |
|
202 |
<tr> |
|
203 |
<td>verifyTextPresent</td> |
|
204 |
<td>openqa.org</td> |
|
205 |
<td> </td> |
|
206 |
</tr> |
|
207 |
<tr> |
|
208 |
<td>verifyTitle</td> |
|
209 |
<td>Selenium OpenQA - Google Search</td> |
|
210 |
<td> </td> |
|
211 |
</tr> |
|
212 |
</tbody> |
|
213 |
||
214 |
</table> |
|
215 |
</body> |
|
216 |
</html> |
|
217 |
'. |
|
360 | 218 |
self assert:(doc children first tagName = 'head'). |
219 |
self assert:(doc docType = '-//W3C//DTD HTML 4.01 Transitional//EN'). |
|
359 | 220 |
|
221 |
" |
|
222 |
self new test03 |
|
223 |
" |
|
224 |
! ! |
|
225 |
||
226 |
!HTMLParserTests class methodsFor:'documentation'! |
|
227 |
||
228 |
version |
|
229 |
^ '$Header$' |
|
230 |
! ! |