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
1
Issues
1
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
Roque
erp5
Commits
c2bc7e33
Commit
c2bc7e33
authored
Oct 09, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui_test: update tests now that we use CKEditor
and add a few assertion on the posted messages content
parent
9c60229a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
216 additions
and
62 deletions
+216
-62
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequest.zpt
...ficejs_support_request_ui_zuite/testAddSupportRequest.zpt
+9
-11
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testCheckComment.zpt
...ts/officejs_support_request_ui_zuite/testCheckComment.zpt
+95
-18
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testCheckHomePage.zpt
...s/officejs_support_request_ui_zuite/testCheckHomePage.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testCheckListBoxNavigation.zpt
...s_support_request_ui_zuite/testCheckListBoxNavigation.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testFrontPageDashboardLastMonthActivity.zpt
...uest_ui_zuite/testFrontPageDashboardLastMonthActivity.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testFrontPageDashboardSupportRequestPipe.zpt
...est_ui_zuite/testFrontPageDashboardSupportRequestPipe.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testHomePageRSS.zpt
...sts/officejs_support_request_ui_zuite/testHomePageRSS.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testHomepageSearch.zpt
.../officejs_support_request_ui_zuite/testHomepageSearch.zpt
+1
-1
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testSupportRequestModuleAccess.zpt
...pport_request_ui_zuite/testSupportRequestModuleAccess.zpt
+4
-11
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
+1
-1
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_setupSupportRequestPreference.py
...rt_request_test/ERP5Site_setupSupportRequestPreference.py
+30
-0
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_setupSupportRequestPreference.xml
...t_request_test/ERP5Site_setupSupportRequestPreference.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
bt5/erp5_officejs_support_request_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSupportRequest.py
...rtal_components/test.erp5.testFunctionalSupportRequest.py
+1
-15
No files found.
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testAddSupportRequest.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
@@ -49,16 +49,9 @@
<td>
field_your_resource
</td>
<td>
FeatureRequire
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td>
Post test
</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>
<tr>
<td>
click
</td>
<td>
//input[@data-i18n='[value]Proceed']
</td>
...
...
@@ -74,6 +67,11 @@
<td>
Comments:
</td>
<td></td>
</tr>
<tr>
<td>
waitForText
</td>
<td>
//ol[@id="post_list"]//li/p
</td>
<td>
Post test
</td>
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
Reference
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testCheckComment.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
@@ -49,16 +49,9 @@
<td>
field_your_resource
</td>
<td>
FeatureRequire
</td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td>
Post test 1
</td>
</tr>
<tal:block
tal:define=
"text_content string:Post test 1"
>
<tal:block
metal:use-macro=
"container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"
/>
</tal:block>
<tr>
<td>
waitForElementPresent
</td>
<td>
//input[@data-i18n='[value]Proceed']
</td>
...
...
@@ -75,25 +68,109 @@
<td></td>
</tr>
<tr>
<td>
waitFor
ElementPresen
t
</td>
<td>
//
textarea[@id='comment']
</td>
<td></td>
<td>
waitFor
Tex
t
</td>
<td>
//
ol[@id="post_list"]//li[1]/p
</td>
<td>
Post test 1
</td>
</tr>
<!-- The "just posted" message is available because it is retrieved from memcached,
eventhough it's not ingested yet. But this works only for one message, so to first message
posted when opening the SR and the second one posted as a comment, we need to flush
activities in between.
Not really good on one hand, because if activities are congested, there will be a problem
here, but on the other hand it allows us to see that once ingested messages are also properly
displayed
-->
<tr>
<td>
typ
e
</td>
<td>
//textarea[@id='comment']
</td>
<td>
Post test 2
</td>
<td>
stor
e
</td>
<td>
javascript{selenium.browserbot.getCurrentWindow().location.href}
</td>
<td>
current_location
</td>
</tr>
<tr>
<td>
open
</td>
<td
tal:content=
"string:${here/portal_url}/Zuite_waitForActivities"
/>
<td/>
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
Done.
</td>
<td/>
</tr>
<tr>
<td>
open
</td>
<td>
${current_location}
</td>
<td></td>
</tr>
<tal:block
tal:define=
"text_content string:Post test 2"
>
<tal:block
metal:use-macro=
"container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"
/>
</tal:block>
<tr>
<td>
click
</td>
<td>
//input[@data-i18n='[value]Post Comment']
</td>
<td></td>
</tr>
<tr>
<td>
waitForText
</td>
<td>
//ol[@id="post_list"]//li[2]/p
</td>
<td>
Post test 2
</td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//ol[@id="post_list"]//li[1]/p
</td>
<td>
Post test 1
</td>
</tr>
<!-- flush activities and post one more message, to exercice ingesting post
posted from support request comment, which uses a different code path than
post ingested when submitting a new support request.
-->
<tr>
<td>
store
</td>
<td>
javascript{selenium.browserbot.getCurrentWindow().location.href}
</td>
<td>
current_location
</td>
</tr>
<tr>
<td>
open
</td>
<td
tal:content=
"string:${here/portal_url}/Zuite_waitForActivities"
/>
<td/>
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
By
</td>
<td>
Done.
</td>
<td/>
</tr>
<tr>
<td>
open
</td>
<td>
${current_location}
</td>
<td></td>
</tr>
<tal:block
tal:define=
"text_content string:Post test 3"
>
<tal:block
metal:use-macro=
"container/Zuite_CommonTemplateForRenderjsUi/macros/type_ckeditor_text_content"
/>
</tal:block>
<tr>
<td>
click
</td>
<td>
//input[@data-i18n='[value]Post Comment']
</td>
<td></td>
</tr>
<tr>
<td>
waitForText
</td>
<td>
//ol[@id="post_list"]//li[3]/p
</td>
<td>
Post test 3
</td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//ol[@id="post_list"]//li[1]/p
</td>
<td>
Post test 1
</td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//ol[@id="post_list"]//li[2]/p
</td>
<td>
Post test 2
</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/testCheckHomePage.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testCheckListBoxNavigation.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testFrontPageDashboardLastMonthActivity.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
colspan=
"3"
tal:content=
"template/title"
></td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/create_data"
/>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testFrontPageDashboardSupportRequestPipe.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
colspan=
"3"
tal:content=
"template/title"
></td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/create_data"
/>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testHomePageRSS.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testHomepageSearch.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testSupportRequestModuleAccess.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Support Request Zuite
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_officejs_support_request_ui/
</td>
...
...
@@ -24,16 +24,9 @@
<td>
//input[@data-i18n='[value]Submit New Support Request']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//textarea[@id='field_my_description']
</td>
<td>
Post test
</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>
<tr>
<td>
type
</td>
<td>
//input[@name='field_your_title']
</td>
...
...
bt5/erp5_officejs_support_request_ui_test/PathTemplateItem/portal_tests/officejs_support_request_ui_zuite/testWorklist.zpt
View file @
c2bc7e33
...
...
@@ -8,7 +8,7 @@
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Worklists on support request front page
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_
Common
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_
SupportRequestUI
Template/macros/init"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/cleanup_module"
/>
<tal:block
metal:use-macro=
"here/Zuite_SupportRequestUITemplate/macros/create_data"
/>
...
...
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_setupSupportRequestPreference.py
0 → 100644
View file @
c2bc7e33
portal
=
context
.
getPortalObject
()
# This should have been created during setup by Zuite_setPreference, but
# we need to support cases where developer run test in his development
# instance without the setup steps of ERP5TypeFunctionalTestCase
pref
=
getattr
(
portal
.
portal_preferences
,
"erp5_ui_test_preference"
,
None
)
if
pref
is
None
:
pref
=
portal
.
portal_preferences
.
newContent
(
id
=
"erp5_ui_test_preference"
,
portal_type
=
"Preference"
,
priority
=
1
)
if
pref
.
getPreferenceState
()
==
'disabled'
:
pref
.
enable
()
# use fck editor, we test with this
pref
.
setPreferredTextEditor
(
'fck_editor'
)
# set a preferred event resource, so that the web message we create
# gets indexed properly in stock table.
# XXX This ressource does not make much sense though, using something like
# "support request message post" would be closer to the real resource of
# these events.
preferred_event_resource
=
'service_module/erp5_officejs_support_request_ui_test_service_003'
if
portal
.
web_site_module
.
erp5_officejs_support_request_ui
.
getLayoutProperty
(
'preferred_event_resource'
,
None
)
!=
'preferred_event_resource'
:
portal
.
web_site_module
.
erp5_officejs_support_request_ui
.
edit
(
preferred_event_resource
=
preferred_event_resource
)
return
"Done."
bt5/erp5_officejs_support_request_ui_test/SkinTemplateItem/portal_skins/erp5_officejs_support_request_test/ERP5Site_setupSupportRequestPreference.xml
0 → 100644
View file @
c2bc7e33
<?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_setupSupportRequestPreference
</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 @
c2bc7e33
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="init">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr><td>openAndWait</td>
<td>${base_url}/ERP5Site_setupSupportRequestPreference</td><td></td></tr>
<tr><td>assertTextPresent</td>
<td>Done.</td><td></td></tr>
</tal:block>
<tal:block metal:define-macro="cleanup_module">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr><td>openAndWait</td>
...
...
bt5/erp5_officejs_support_request_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSupportRequest.py
View file @
c2bc7e33
...
...
@@ -25,23 +25,9 @@
#
##############################################################################
import
unittest
from
Products.ERP5Type.tests.ERP5TypeFunctionalTestCase
import
ERP5TypeFunctionalTestCase
class
TestSupportRequestUI
(
ERP5TypeFunctionalTestCase
):
foreground
=
0
run_only
=
"officejs_support_request_ui_zuite"
def
getBusinessTemplateList
(
self
):
return
(
'erp5_web_renderjs_ui'
,
'erp5_web_renderjs_ui_test'
,
'erp5_ui_test_core'
,
'erp5_officejs_support_request_ui'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestSupportRequestUI
))
return
suite
\ No newline at end of file
del
ERP5TypeFunctionalTestCase
\ 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