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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
erp5
Commits
d5564ccf
Commit
d5564ccf
authored
Jan 11, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_run_my_doc: move extension and test to portal_components
Also remove unused broken function
parent
44380d16
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
228 additions
and
78 deletions
+228
-78
bt5/erp5_run_my_doc/ExtensionTemplateItem/portal_components/extension.erp5.ERP5RunMyDocs.py
...ateItem/portal_components/extension.erp5.ERP5RunMyDocs.py
+8
-62
bt5/erp5_run_my_doc/ExtensionTemplateItem/portal_components/extension.erp5.ERP5RunMyDocs.xml
...teItem/portal_components/extension.erp5.ERP5RunMyDocs.xml
+102
-0
bt5/erp5_run_my_doc/TestTemplateItem/portal_components/test.erp5.testRunMyDoc.py
...tTemplateItem/portal_components/test.erp5.testRunMyDoc.py
+14
-14
bt5/erp5_run_my_doc/TestTemplateItem/portal_components/test.erp5.testRunMyDoc.xml
...TemplateItem/portal_components/test.erp5.testRunMyDoc.xml
+102
-0
bt5/erp5_run_my_doc/bt/template_extension_id_list
bt5/erp5_run_my_doc/bt/template_extension_id_list
+1
-1
bt5/erp5_run_my_doc/bt/template_test_id_list
bt5/erp5_run_my_doc/bt/template_test_id_list
+1
-1
No files found.
bt5/erp5_run_my_doc/ExtensionTemplateItem/ERP5RunMyDocs.py
→
bt5/erp5_run_my_doc/ExtensionTemplateItem/
portal_components/extension.erp5.
ERP5RunMyDocs.py
View file @
d5564ccf
...
@@ -7,7 +7,7 @@ def parseTestReport(text):
...
@@ -7,7 +7,7 @@ def parseTestReport(text):
parser
.
feed
(
text
)
parser
.
feed
(
text
)
root
=
parser
.
close
()
root
=
parser
.
close
()
table
=
root
.
xpath
(
'//table[@id="SELENIUM-TEST"]'
)[
0
]
table
=
root
.
xpath
(
'//table[@id="SELENIUM-TEST"]'
)[
0
]
report
=
{}
report
=
dict
()
header
=
table
[
0
][
0
]
header
=
table
[
0
][
0
]
report
[
'status'
]
=
header
.
attrib
[
'class'
].
find
(
'passed'
)
>
-
1
report
[
'status'
]
=
header
.
attrib
[
'class'
].
find
(
'passed'
)
>
-
1
report
[
'name'
]
=
header
[
0
].
text
report
[
'name'
]
=
header
[
0
].
text
...
@@ -53,56 +53,6 @@ def parseTestReport(text):
...
@@ -53,56 +53,6 @@ def parseTestReport(text):
return dict(title = title, text = lxml.html.tostring(html))
return dict(title = title, text = lxml.html.tostring(html))
"""
"""
"""
Parse a HTML page and return a list of dictionnaries with the chapters and the tests they contain
"""
def
parseTutorial
(
text
):
from
Products.ERP5Type.Document
import
newTempBase
from
lxml
import
etree
parser
=
etree
.
HTMLParser
(
remove_comments
=
True
)
parser
.
feed
(
text
)
root
=
parser
.
close
()
table_list
=
root
.
xpath
(
'//table[@id="SELENIUM-TEST"]'
)
table
=
table_list
[
0
]
listbox
=
[]
i
=
0
# Insert only the content of tbody
for
table
in
table_list
:
listbox
.
append
(
newTempBase
(
context
.
getPortalObject
(),
''
,
title
=
"Tested Chapter "
+
str
(
i
),
tag
=
'h1'
))
if
len
(
table
)
>
0
:
for
row
in
table
[
-
1
]:
if
(
row
.
tag
.
lower
()
==
'tr'
):
listbox
.
append
(
newTempBase
(
context
.
getPortalObject
(),
''
,
title
=
row
[
0
][
0
].
text
,
tag
=
'tr'
,
arg0
=
row
[
0
][
1
].
text
,
arg1
=
row
[
0
][
2
].
text
))
else
:
listbox
.
append
(
newTempBase
(
context
.
getPortalObject
(),
''
,
title
=
row
[
0
][
0
].
text
,
tag
=
'tr'
,
arg0
=
row
[
0
][
1
].
text
,
arg1
=
row
[
0
][
2
].
text
))
stack
=
[
html
[
1
]]
# Let's display everything in the test by removing the style attributes (they're not supposed to have any style attributes at all during the tests)
while
stack
:
element
=
stack
.
pop
()
if
element
.
attrib
.
has_key
(
'style'
):
del
element
.
attrib
[
'style'
]
for
child
in
element
:
stack
.
append
(
child
)
return
dict
(
title
=
title
,
text
=
lxml
.
html
.
tostring
(
html
))
"""
"""
Return the content of a web page
Return the content of a web page
"""
"""
...
@@ -115,7 +65,6 @@ def urlread(url):
...
@@ -115,7 +65,6 @@ def urlread(url):
"""
"""
def
extractTest
(
text
):
def
extractTest
(
text
):
import
lxml.html
import
lxml.html
from
lxml
import
etree
root
=
lxml
.
html
.
fromstring
(
text
)
root
=
lxml
.
html
.
fromstring
(
text
)
table_list
=
root
.
xpath
(
'//test'
)
table_list
=
root
.
xpath
(
'//test'
)
testcode
=
""
testcode
=
""
...
@@ -135,7 +84,6 @@ def extractTest(text):
...
@@ -135,7 +84,6 @@ def extractTest(text):
"""
"""
def
validateHTML5Document
(
text
):
def
validateHTML5Document
(
text
):
import
lxml.html
import
lxml.html
from
lxml
import
etree
root
=
lxml
.
html
.
fromstring
(
text
)
root
=
lxml
.
html
.
fromstring
(
text
)
section_list
=
root
.
xpath
(
'//section'
)
section_list
=
root
.
xpath
(
'//section'
)
count
=
0
count
=
0
...
@@ -160,5 +108,3 @@ def validateHTML5Document(text):
...
@@ -160,5 +108,3 @@ def validateHTML5Document(text):
error_list
.
append
(
"Section %s has no details tag."
%
(
count
))
error_list
.
append
(
"Section %s has no details tag."
%
(
count
))
return
error_list
return
error_list
bt5/erp5_run_my_doc/ExtensionTemplateItem/portal_components/extension.erp5.ERP5RunMyDocs.xml
0 → 100644
View file @
d5564ccf
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Extension Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ERP5RunMyDocs
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.ERP5RunMyDocs
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Extension Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_run_my_doc/TestTemplateItem/testRunMyDoc.py
→
bt5/erp5_run_my_doc/TestTemplateItem/
portal_components/test.erp5.
testRunMyDoc.py
View file @
d5564ccf
bt5/erp5_run_my_doc/TestTemplateItem/portal_components/test.erp5.testRunMyDoc.xml
0 → 100644
View file @
d5564ccf
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testRunMyDoc
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testRunMyDoc
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_run_my_doc/bt/template_extension_id_list
View file @
d5564ccf
ERP5RunMyDocs
extension.erp5.ERP5RunMyDocs
\ No newline at end of file
\ No newline at end of file
bt5/erp5_run_my_doc/bt/template_test_id_list
View file @
d5564ccf
testRunMyDoc
test.erp5.testRunMyDoc
\ 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