Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lukas Niegsch
erp5
Commits
e920ddfd
Commit
e920ddfd
authored
Feb 29, 2012
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for Selenium Test Generation
parent
4e478cef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
1 deletion
+93
-1
bt5/erp5_run_my_doc/TestTemplateItem/testRunMyDoc.py
bt5/erp5_run_my_doc/TestTemplateItem/testRunMyDoc.py
+92
-0
bt5/erp5_run_my_doc/bt/revision
bt5/erp5_run_my_doc/bt/revision
+1
-1
No files found.
bt5/erp5_run_my_doc/TestTemplateItem/testRunMyDoc.py
View file @
e920ddfd
...
@@ -135,3 +135,95 @@ class TestRunMyDoc(ERP5TypeTestCase):
...
@@ -135,3 +135,95 @@ class TestRunMyDoc(ERP5TypeTestCase):
self
.
assertEquals
(
image_page_2
.
getData
(),
image_upload
.
read
().
decode
(
"base64"
))
self
.
assertEquals
(
image_page_2
.
getData
(),
image_upload
.
read
().
decode
(
"base64"
))
self
.
assertEquals
(
image_page_2
.
getFilename
(),
image_reference
+
'.png'
)
self
.
assertEquals
(
image_page_2
.
getFilename
(),
image_reference
+
'.png'
)
self
.
assertEquals
(
image_page
.
getData
(),
''
)
self
.
assertEquals
(
image_page
.
getData
(),
''
)
def
test_getSeleniumTest
(
self
):
"""
Test the script that extracts Selenium Test from HTML body.
"""
test_page_html
=
"""<section><h1>TITLE</h1><details>DETAILS<details>
<test><table class="test" style="display: none;"> <tbody> </tbody></table> </test>
</section>
<section><h1>TITLE</h1><details>DETAILS<details><test>
<table class="test" style="display: none;">
<tbody>
<tr>
<td colspan="3"><span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>name=select_module</td>
<td>label=Test Pages</td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Test Pages</td>
<td> <br /> </td>
</tr>
<tr style="opacity: 1;">
<td>clickAndWait</td>
<td>css=a.fast_input > span.image</td>
<td> <br /> </td>
</tr> </tbody></table> </test>
</section>
<section><h1>TITLE</h1><details>DETAILS<details><test>
<table class="test" style="display: none;"> <tbody>
<tr>
<td>verifyTextPresent</td>
<td>Test Pages</td>
<td> <br /> </td>
</tr> </tbody></table> </test>
</section>"""
expected_test_html
=
"""
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TEST</title>
</head>
<body>
<table name="SELENIUM-TEST" cellpadding="1" cellspacing="1" border="1">
<thead>
<tr class="title">
<td colspan="3">TEST</td>
</tr>
</thead>
<tbody>
<span metal:use-macro="container/Zuite_viewTestMacroLibrary/macros/init_test_environment" style="display: none;">init</span><tr><td>selectAndWait</td>
<td>name=select_module</td>
<td>label=Test Pages</td>
</tr><tr><td>verifyTextPresent</td>
<td>Test Pages</td>
<td> <br></td>
</tr><tr style="opacity: 1;"><td>clickAndWait</td>
<td>css=a.fast_input > span.image</td>
<td> <br></td>
</tr><tr><td>verifyTextPresent</td>
<td>Test Pages</td>
<td> <br></td>
</tr>
</tbody>
</table>
</body>
</html>"""
test_page
=
self
.
portal
.
test_page_module
.
newContent
(
title
=
"TEST"
,
reference
=
'TESTPAGEREFERENCE'
,
text_content
=
test_page_html
)
self
.
assertEquals
(
test_page
.
TestPage_getSeleniumTest
(),
expected_test_html
)
self
.
stepTic
()
test_page
.
TestPage_runSeleniumTest
()
zuite
=
getattr
(
self
.
portal
.
portal_tests
,
'TESTPAGEREFERENCE'
,
None
)
self
.
assertNotEquals
(
zuite
,
None
)
zptest
=
getattr
(
zuite
,
"TEST"
,
None
)
self
.
assertNotEquals
(
zptest
,
None
)
self
.
assertEquals
(
zptest
.
_text
,
expected_test_html
.
strip
())
bt5/erp5_run_my_doc/bt/revision
View file @
e920ddfd
52
53
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment