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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
6e8fd6be
Commit
6e8fd6be
authored
Sep 07, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui_test: test for worklists
parent
f2264935
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
393 additions
and
0 deletions
+393
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testWorklist.xml
..._tests/officejs_support_request_ui_zuite/testWorklist.xml
+58
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testWorklist.zpt
..._tests/officejs_support_request_ui_zuite/testWorklist.zpt
+90
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_cleanupSupportRequestUITestDataSet.py
...quest_test/ERP5Site_cleanupSupportRequestUITestDataSet.py
+26
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_cleanupSupportRequestUITestDataSet.xml
...uest_test/ERP5Site_cleanupSupportRequestUITestDataSet.xml
+62
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestDataSet.py
...equest_test/ERP5Site_createSupportRequestUITestDataSet.py
+16
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestDataSet.xml
...quest_test/ERP5Site_createSupportRequestUITestDataSet.xml
+62
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/Zuite_SupportRequestUITemplate.xml
...s_support_request_test/Zuite_SupportRequestUITemplate.xml
+58
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/Zuite_SupportRequestUITemplate.zpt
...s_support_request_test/Zuite_SupportRequestUITemplate.zpt
+21
-0
No files found.
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testWorklist.xml
0 → 100644
View file @
6e8fd6be
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testWorklist
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode>
Worklists on support request front page
</unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testWorklist.zpt
0 → 100644
View file @
6e8fd6be
<html>
<head>
<title
tal:content=
"template/title"
>
Worklists on support request front page
</title>
<meta
http-equiv=
"content-type"
content=
"text/html;charset=utf-8"
>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Worklists on support request front page
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/create_data"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//h1[@data-i18n="[value]Support Requests WorkList"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//section[@class="document_list"]//li[1]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Support Requests to Open")]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<!-- document count -->
<td>
//section[@class="document_list"]//li/a[contains(text(), "Support Requests to Open")]/span[text() = "1"]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Support Requests to Close")]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Support Requests to Close")]/span[text() = "1"]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Suspended Support Requests")]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Suspended Support Requests")]/span[text() = "1"]
</td>
<td></td>
</tr>
<!-- clicking on one worklist open the module -->
<tr>
<td>
click
</td>
<td>
//section[@class="document_list"]//li/a[contains(text(), "Suspended Support Requests")]/span[text() = "1"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//h1/a[@data-i18n="Support Request Module"]
</td>
<td></td>
</tr>
<!-- The module is filtered according to worklist definition, so it shows one document -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//h1[@data-i18n="Support Requests"]//span[text() = "(1)"]
</td>
<td></td>
</tr>
<!-- Query editor buttons are also present -->
<tr>
<td>
waitForElementPresent
</td>
<td>
div.search_parsed_value > button:nth-of-type(3)
</td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_cleanupSupportRequestUITestDataSet.py
0 → 100644
View file @
6e8fd6be
"""Cleanup the data from support request module.
So that test are isolated.
"""
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
portal
=
context
.
getPortalObject
()
test_project_set
=
set
((
portal
.
project_module
.
erp5_officejs_support_request_ui_test_project_001
,
portal
.
project_module
.
erp5_officejs_support_request_ui_test_project_002
))
to_delete_list
=
[]
for
brain
in
portal
.
portal_catalog
(
portal_type
=
"Support Request"
,
simulation_state
=
NegatedQuery
(
Query
(
simulation_state
=
(
"cancelled"
,)))):
support_request
=
brain
.
getObject
()
if
support_request
.
getId
().
startswith
(
'erp5_officejs_support_request_ui_test_'
):
continue
# business template data
assert
support_request
.
getSourceProjectValue
()
in
test_project_set
,
\
"Support request %s have unexpected project."
%
support_request
.
absolute_url
()
to_delete_list
.
append
(
support_request
.
getId
())
portal
.
support_request_module
.
manage_delObjects
(
to_delete_list
)
# Clear worklist cache
portal
.
portal_caches
.
clearAllCache
()
return
"Done."
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_cleanupSupportRequestUITestDataSet.xml
0 → 100644
View file @
6e8fd6be
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_cleanupSupportRequestUITestDataSet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestDataSet.py
0 → 100644
View file @
6e8fd6be
"""Create some data for support request UI test.
Logged in user needs to be Assignee / Assignor on the support requests
included in business template.
"""
portal
=
context
.
getPortalObject
()
for
support_request
in
portal
.
support_request_module
.
contentValues
():
if
support_request
.
getId
().
startswith
(
'erp5_officejs_support_request_ui_test'
):
support_request
.
manage_addLocalRoles
(
portal
.
portal_membership
.
getAuthenticatedMember
().
getId
(),
[
'Assignee'
,
'Assignor'
])
support_request
.
reindexObject
()
portal
.
portal_caches
.
clearAllCache
()
return
"Done."
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestDataSet.xml
0 → 100644
View file @
6e8fd6be
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_createSupportRequestUITestDataSet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/Zuite_SupportRequestUITemplate.xml
0 → 100644
View file @
6e8fd6be
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Zuite_SupportRequestUITemplate
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/Zuite_SupportRequestUITemplate.zpt
0 → 100644
View file @
6e8fd6be
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="cleanup_module">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr><td>openAndWait</td>
<td>${base_url}/ERP5Site_cleanupSupportRequestUITestDataSet</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
</tal:block>
<tal:block metal:define-macro="create_data">
<tr><td>openAndWait</td>
<td>${base_url}/ERP5Site_createSupportRequestUITestDataSet</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
</tal:block>
</tal:block>
\ 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