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
Paul Graydon
erp5
Commits
f5eb9713
Commit
f5eb9713
authored
Dec 09, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui_test: test fields interactions on "New Support Request"
Possible services depend on the selected project.
parent
888adb89
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
416 additions
and
0 deletions
+416
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithMultipleProjectsAvailableForUser.xml
...AddSupportRequestWithMultipleProjectsAvailableForUser.xml
+58
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithMultipleProjectsAvailableForUser.zpt
...AddSupportRequestWithMultipleProjectsAvailableForUser.zpt
+117
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithOnlyOneProjectAvailableForUser.xml
...stAddSupportRequestWithOnlyOneProjectAvailableForUser.xml
+58
-0
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithOnlyOneProjectAvailableForUser.zpt
...stAddSupportRequestWithOnlyOneProjectAvailableForUser.zpt
+94
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_cleanupSupportRequestUITestDataSet.py
...quest_test/ERP5Site_cleanupSupportRequestUITestDataSet.py
+7
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestSecondProject.py
..._test/ERP5Site_createSupportRequestUITestSecondProject.py
+12
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestSecondProject.xml
...test/ERP5Site_createSupportRequestUITestSecondProject.xml
+62
-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
+8
-0
No files found.
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithMultipleProjectsAvailableForUser.xml
0 → 100644
View file @
f5eb9713
<?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>
testAddSupportRequestWithMultipleProjectsAvailableForUser
</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/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithMultipleProjectsAvailableForUser.zpt
0 → 100644
View file @
f5eb9713
<html>
<head>
<title
tal:content=
"template/title"
>
The title
</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"
>
Test adding a support request for users who have access to multiple projects
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/create_second_project"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded"
/>
<tr>
<td>
click
</td>
<td>
//input[@data-i18n='[value]Submit New Support Request']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
type
</td>
<td>
//input[@name='field_your_title']
</td>
<td>
test
</td>
</tr>
<!-- When there's more than one project, no project is selected by default -->
<tr>
<td>
assertSelectedLabel
</td>
<td>
field_your_project
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_project"]/option[text() = "RobotMaking"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_project"]/option[text() = "Second Project"]
</td>
<td></td>
</tr>
<tr>
<td>
select
</td>
<td>
field_your_project
</td>
<td>
RobotMaking
</td>
</tr>
<!-- for RobotMaking project, RequireAssistant is allowed, but BugReport is not -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementNotPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "BugReport"]
</td>
<td></td>
</tr>
<tr>
<td>
select
</td>
<td>
field_your_project
</td>
<td>
Second Project
</td>
</tr>
<!-- for Second Project project, everything is -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "BugReport"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]
</td>
<td></td>
</tr>
<tr>
<td>
select
</td>
<td>
field_your_resource
</td>
<td>
FeatureRequire
</td>
</tr>
<tal:block
tal:define=
"text_content string:Post test"
>
<tal:block
metal:use-macro=
"container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success',
'text': 'New Support Request created.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_my_source_project_title"]//p
</td>
<td>
Second Project
</td>
<td></td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_my_resource"]//p
</td>
<td>
FeatureRequire
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithOnlyOneProjectAvailableForUser.xml
0 → 100644
View file @
f5eb9713
<?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>
testAddSupportRequestWithOnlyOneProjectAvailableForUser
</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/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequestWithOnlyOneProjectAvailableForUser.zpt
0 → 100644
View file @
f5eb9713
<html>
<head>
<title
tal:content=
"template/title"
>
The title
</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"
>
Test adding a support request for users who can only access one project
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded"
/>
<tr>
<td>
click
</td>
<td>
//input[@data-i18n='[value]Submit New Support Request']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
type
</td>
<td>
//input[@name='field_your_title']
</td>
<td>
test
</td>
</tr>
<!-- When there's only one project, this project is selected by default -->
<tr>
<td>
waitForSelectedLabel
</td>
<td>
field_your_project
</td>
<td>
RobotMaking
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "FeatureRequire"]
</td>
<td></td>
</tr>
<!-- this default project have a a sale supply line, defining that only FeatureRequire and
RequireAssistant services are available for this project -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "RequireAssistant"]
</td>
<td></td>
</tr>
<!-- other services are not available here. -->
<tr>
<td>
waitForElementNotPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "BugReport"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementNotPresent
</td>
<td>
//select[@name="field_your_resource"]/option[text() = "CrashReport"]
</td>
<td></td>
</tr>
<tr>
<td>
select
</td>
<td>
field_your_resource
</td>
<td>
FeatureRequire
</td>
</tr>
<tal:block
tal:define=
"text_content string:Post test"
>
<tal:block
metal:use-macro=
"container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"
/>
<tal:block
tal:define=
"notification_configuration python: {'class': 'success',
'text': 'New Support Request created.'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_my_source_project_title"]//p
</td>
<td>
RobotMaking
</td>
<td></td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//div[@data-gadget-scope="field_my_resource"]//p
</td>
<td>
FeatureRequire
</td>
<td></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
View file @
f5eb9713
...
...
@@ -7,6 +7,9 @@ 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
))
erp5_officejs_support_request_test_second_project
=
portal
.
project_module
.
get
(
'erp5_officejs_support_request_test_second_project'
)
if
erp5_officejs_support_request_test_second_project
is
not
None
:
test_project_set
.
add
(
erp5_officejs_support_request_test_second_project
)
to_delete_list
=
[]
for
brain
in
portal
.
portal_catalog
(
...
...
@@ -20,6 +23,10 @@ for brain in portal.portal_catalog(
to_delete_list
.
append
(
support_request
.
getId
())
portal
.
support_request_module
.
manage_delObjects
(
to_delete_list
)
if
erp5_officejs_support_request_test_second_project
is
not
None
:
portal
.
project_module
.
manage_delObjects
(
ids
=
[
erp5_officejs_support_request_test_second_project
.
getId
()])
event_to_delete_id_list
=
[]
for
event
in
portal
.
event_module
.
contentValues
():
if
event
.
getFollowUp
(
portal_type
=
'Support Request'
):
...
...
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestSecondProject.py
0 → 100644
View file @
f5eb9713
"""Create a second project for support request UI test.
All support request services can be used on this project.
"""
portal
=
context
.
getPortalObject
()
portal
.
project_module
.
newContent
(
id
=
'erp5_officejs_support_request_test_second_project'
,
title
=
'Second Project'
).
validate
()
return
"Done."
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_createSupportRequestUITestSecondProject.xml
0 → 100644
View file @
f5eb9713
<?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_createSupportRequestUITestSecondProject
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/Zuite_SupportRequestUITemplate.zpt
View file @
f5eb9713
...
...
@@ -30,4 +30,12 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
</tal:block>
<tal:block metal:define-macro="create_second_project">
<tr><td>openAndWait</td>
<td>${base_url}/ERP5Site_createSupportRequestUITestSecondProject</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