Commit cc1f687f authored by Jérome Perrin's avatar Jérome Perrin

run_my_doc: strip unnecessary whitespace in generated zelenium tests

parent 2ed3c9e0
...@@ -77,7 +77,7 @@ def extractTest(text): ...@@ -77,7 +77,7 @@ def extractTest(text):
testcode += row[0].text testcode += row[0].text
else: else:
testcode += lxml.html.tostring(row) testcode += lxml.html.tostring(row)
return testcode return testcode.strip()
""" """
HTML5 Presentation validador HTML5 Presentation validador
......
...@@ -34,7 +34,7 @@ class TestRunMyDoc(ERP5TypeTestCase): ...@@ -34,7 +34,7 @@ class TestRunMyDoc(ERP5TypeTestCase):
""" """
Basic Test for internal implementation of RunMyDocs Basic Test for internal implementation of RunMyDocs
""" """
maxDiff = None
def getTitle(self): def getTitle(self):
return "Run My Doc" return "Run My Doc"
...@@ -141,37 +141,37 @@ class TestRunMyDoc(ERP5TypeTestCase): ...@@ -141,37 +141,37 @@ class TestRunMyDoc(ERP5TypeTestCase):
Test the script that extracts Selenium Test from HTML body. Test the script that extracts Selenium Test from HTML body.
""" """
test_page_html = """<section><h1>TITLE</h1><details>DETAILS<details> test_page_html = """<section><h1>TITLE</h1><details>DETAILS<details>
<test><table class="test" style="display: none;"> <tbody> </tbody></table> </test> <test><table class="test" style="display: none;"> <tbody> </tbody></table> </test>
</section> </section>
<section><h1>TITLE</h1><details>DETAILS<details><test> <section><h1>TITLE</h1><details>DETAILS<details><test>
<table class="test" style="display: none;"> <table class="test" style="display: none;">
<tbody> <tbody>
<tr> <tr>
<td colspan="3">&lt;span metal:use-macro=&quot;container/Zuite_viewTestMacroLibrary/macros/init_test_environment&quot; style=&quot;display: none;&quot;&gt;init&lt;/span&gt;</td> <td colspan="3">&lt;span metal:use-macro=&quot;container/Zuite_viewTestMacroLibrary/macros/init_test_environment&quot; style=&quot;display: none;&quot;&gt;init&lt;/span&gt;</td>
</tr> </tr>
<tr> <tr>
<td>selectAndWait</td> <td>selectAndWait</td>
<td>name=select_module</td> <td>name=select_module</td>
<td>label=Test Pages</td> <td>label=Test Pages</td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br /> </td> <td> <br /> </td>
</tr> </tr>
<tr style="opacity: 1;"> <tr style="opacity: 1;">
<td>clickAndWait</td> <td>clickAndWait</td>
<td>css=a.fast_input &gt; span.image</td> <td>css=a.fast_input &gt; span.image</td>
<td> <br /> </td> <td> <br /> </td>
</tr> </tbody></table> </test> </tr> </tbody></table> </test>
</section> </section>
<section><h1>TITLE</h1><details>DETAILS<details><test> <section><h1>TITLE</h1><details>DETAILS<details><test>
<table class="test" style="display: none;"> <tbody> <table class="test" style="display: none;"> <tbody>
<tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br /> </td> <td> <br /> </td>
</tr> </tbody></table> </test> </tr> </tbody></table> </test>
</section>""" </section>"""
expected_test_html = u"""<html> expected_test_html = u"""<html>
...@@ -198,25 +198,25 @@ class TestRunMyDoc(ERP5TypeTestCase): ...@@ -198,25 +198,25 @@ class TestRunMyDoc(ERP5TypeTestCase):
<td>%s</td> <td>%s</td>
<td>base_password</td> <td>base_password</td>
</tr> </tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span><tr> <span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span><tr>
<td>selectAndWait</td> <td>selectAndWait</td>
<td>name=select_module</td> <td>name=select_module</td>
<td>label=Test Pages</td> <td>label=Test Pages</td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br> </td> <td> <br> </td>
</tr> </tr>
<tr style="opacity: 1;"> <tr style="opacity: 1;">
<td>clickAndWait</td> <td>clickAndWait</td>
<td>css=a.fast_input &gt; span.image</td> <td>css=a.fast_input &gt; span.image</td>
<td> <br> </td> <td> <br> </td>
</tr> <tr> </tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br> </td> <td> <br> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</body> </body>
...@@ -270,25 +270,25 @@ class TestRunMyDoc(ERP5TypeTestCase): ...@@ -270,25 +270,25 @@ class TestRunMyDoc(ERP5TypeTestCase):
<td>%s</td> <td>%s</td>
<td>base_password</td> <td>base_password</td>
</tr> </tr>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span><tr> <span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span><tr>
<td>selectAndWait</td> <td>selectAndWait</td>
<td>name=select_module</td> <td>name=select_module</td>
<td>label=Test Pages</td> <td>label=Test Pages</td>
</tr> </tr>
<tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br> </td> <td> <br> </td>
</tr> </tr>
<tr style="opacity: 1;"> <tr style="opacity: 1;">
<td>clickAndWait</td> <td>clickAndWait</td>
<td>css=a.fast_input &gt; span.image</td> <td>css=a.fast_input &gt; span.image</td>
<td> <br> </td> <td> <br> </td>
</tr> <tr> </tr> <tr>
<td>verifyTextPresent</td> <td>verifyTextPresent</td>
<td>Test Pages</td> <td>Test Pages</td>
<td> <br> </td> <td> <br> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</body> </body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment