#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Fri, 29 Mar 2019 11:56:40 +0100
changeset 2202 145d31a73d22
parent 2201 f5fa86b51075
child 2203 ffb4367518c1
#UI_ENHANCEMENT by cg class: RegressionTests::HTMLParserTests added: #test01a #test01b #test01c #test02a #test02b
RegressionTests__HTMLParserTests.st
--- a/RegressionTests__HTMLParserTests.st	Thu Mar 28 17:00:23 2019 +0100
+++ b/RegressionTests__HTMLParserTests.st	Fri Mar 29 11:56:40 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/regression' }"
 
 "{ NameSpace: RegressionTests }"
@@ -54,7 +56,9 @@
 
 !HTMLParserTests methodsFor:'tests'!
 
-test01
+test01a
+    "test the new parser"
+    
     |el|
 
     el := HTML::HTMLParser parseText:'
@@ -64,11 +68,52 @@
     "/ el inspect.
 
     "
-     self new test01
+     self new test01a
     "
+
+    "Created: / 29-03-2019 / 10:35:20 / Claus Gittinger"
 !
 
-test02
+test01b
+    "test the old parser"
+
+    |el|
+
+    el := HTMLParser parseText:'
+<HEAD>
+</HEAD>
+'.
+    "/ el inspect.
+
+    "
+     self new test01b
+    "
+
+    "Created: / 29-03-2019 / 10:35:27 / Claus Gittinger"
+!
+
+test01c
+    "test the old parser"
+
+    |el|
+
+    el := HTMLParser parseText:'
+<HTML>
+<HEAD>
+</HEAD>
+</HTML>
+'.
+
+    "
+     self new test01c
+    "
+
+    "Created: / 29-03-2019 / 11:22:27 / Claus Gittinger"
+!
+
+test02a
+    "test the new parser"
+
     |doc|
 
     doc := HTML::HTMLParser parseText:'
@@ -144,8 +189,99 @@
     self assert:(doc children first tagName = 'head').
 
     "
-     self new test02
+     self new test02a
     "
+
+    "Created: / 29-03-2019 / 10:35:45 / Claus Gittinger"
+!
+
+test02b
+    "test the old parser"
+
+    |doc firstMarkup|
+
+    doc := HTMLParser parseText:'
+<!!--
+Copyright 2004 ThoughtWorks, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>Test Open</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+  <tbody>
+    <tr>
+      <td rowspan="1" colspan="3">Google Test Search<br>
+      </td>
+    </tr>
+    <tr>
+      <td>open</td>
+      <td>http://www.google.com/webhp?hl=en</td>
+      <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td>verifyTitle</td>
+      <td>Google</td>
+      <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td>type</td>
+      <td>q</td>
+      <td>Selenium OpenQA</td>
+    </tr>
+    <tr>
+      <td>verifyValue</td>
+      <td>q</td>
+      <td>Selenium OpenQA</td>
+    </tr>
+    <tr>
+      <td>clickAndWait</td>
+      <td>btnG</td>
+      <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td>verifyTextPresent</td>
+      <td>openqa.org</td>
+      <td>&nbsp;</td>
+    </tr>
+    <tr>
+      <td>verifyTitle</td>
+      <td>Selenium OpenQA - Google Search</td>
+      <td>&nbsp;</td>
+    </tr>
+  </tbody>
+
+</table>
+</body>
+</html>
+'.
+    firstMarkup := doc markup.
+    firstMarkup isTextElement ifTrue:[
+        firstMarkup := firstMarkup next
+    ].    
+    self assert:(firstMarkup tagName = 'html').
+
+    "
+     self new test02b
+    "
+
+    "Created: / 29-03-2019 / 10:35:55 / Claus Gittinger"
+    "Modified: / 29-03-2019 / 11:54:05 / Claus Gittinger"
 !
 
 test03