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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
5b81cc0e
Commit
5b81cc0e
authored
Jun 03, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdm_ui_test: add missing tests for Organisation's "jump to supply"
parent
0df92b02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
164 additions
and
0 deletions
+164
-0
bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/testOrganisationJumpToSupply.xml
...m/portal_tests/pdm_zuite/testOrganisationJumpToSupply.xml
+58
-0
bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/testOrganisationJumpToSupply.zpt
...m/portal_tests/pdm_zuite/testOrganisationJumpToSupply.zpt
+77
-0
bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_deleteData.py
...Item/portal_skins/erp5_pdm_ui_test/PdmZuite_deleteData.py
+7
-0
bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_reset.py
...plateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_reset.py
+22
-0
No files found.
bt5/erp5_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/testOrganisationJumpToSupply.xml
0 → 100644
View file @
5b81cc0e
<?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>
testOrganisationJumpToSupply
</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_pdm_ui_test/PathTemplateItem/portal_tests/pdm_zuite/testOrganisationJumpToSupply.zpt
0 → 100644
View file @
5b81cc0e
<html>
<head><title>
Test jump to supplies
</title></head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"4"
>
Test jump to supplies
</td></tr>
</thead>
<tbody
tal:define=
"init_method string:PdmZuite_createDelivery?state=draft"
>
<tal:block
metal:use-macro=
"here/PdmZuite_CommonTemplate/macros/init"
/>
<tal:block
tal:repeat=
"supply_portal_type python:('Purchase Supply', 'Sale Supply', 'Internal Supply', )"
>
<tr>
<td>
open
</td>
<td>
${base_url}/organisation_module/erp5_pdm_ui_test_source_node
</td>
<td></td>
</tr>
<tr>
<td>
selectAndWait
</td>
<td>
select_jump
</td>
<td
tal:content=
"supply_portal_type"
></td>
</tr>
<tr>
<td>
assertPortalStatusMessage
</td>
<td>
Documents related to Organisation : erp5_pdm_ui_test_source_node_title.
</td>
<td></td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//span[@class="listbox-current-page-total-number"]
</td>
<td>
2 records
</td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
erp5_pdm_ui_test_supply_1
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
erp5_pdm_ui_test_supply_2
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/organisation_module/erp5_pdm_ui_test_destination_node
</td>
<td></td>
</tr>
<tr>
<td>
selectAndWait
</td>
<td>
select_jump
</td>
<td
tal:content=
"supply_portal_type"
></td>
</tr>
<tr>
<td>
assertPortalStatusMessage
</td>
<td><tal:block
tal:replace=
"supply_portal_type"
/>
related to Organisation : erp5_pdm_ui_test_destination_node_title.
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
erp5_pdm_ui_test_supply_1
</td>
<td></td>
</tr>
<tr>
<td>
assertTextNotPresent
</td>
<td>
erp5_pdm_ui_test_supply_2
</td>
<td></td>
</tr>
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_deleteData.py
View file @
5b81cc0e
...
@@ -46,4 +46,11 @@ for delivery_type in ("Internal", "Purchase", "Sale"):
...
@@ -46,4 +46,11 @@ for delivery_type in ("Internal", "Purchase", "Sale"):
stool
.
manage_delObjects
(
delivery
.
getCausalityRelatedIdList
(
portal_type
=
'Applied Rule'
))
stool
.
manage_delObjects
(
delivery
.
getCausalityRelatedIdList
(
portal_type
=
'Applied Rule'
))
module
.
manage_delObjects
([
delivery_id
])
module
.
manage_delObjects
([
delivery_id
])
# delete supplies
for
supply_portal_type
in
(
'Purchase Supply'
,
'Sale Supply'
,
'Internal Supply'
,
):
module
=
portal
.
getDefaultModule
(
supply_portal_type
)
for
supply_id
in
(
'erp5_pdm_ui_test_supply_1'
,
'erp5_pdm_ui_test_supply_2'
,
'erp5_pdm_ui_test_supply_3'
):
if
getattr
(
module
,
supply_id
,
None
)
is
not
None
:
module
.
manage_delObjects
([
supply_id
])
return
"Deleted Successfully."
return
"Deleted Successfully."
bt5/erp5_pdm_ui_test/SkinTemplateItem/portal_skins/erp5_pdm_ui_test/PdmZuite_reset.py
View file @
5b81cc0e
...
@@ -154,6 +154,28 @@ for node_id, node_title, site_url in ((source_node_id, source_node_title, source
...
@@ -154,6 +154,28 @@ for node_id, node_title, site_url in ((source_node_id, source_node_title, source
site
=
site_url
site
=
site_url
)
)
# Create supplies
# for all type of supply, source_node_id has 2 related supplies and destination_node_id has 1
for
supply_portal_type
in
(
'Purchase Supply'
,
'Sale Supply'
,
'Internal Supply'
,
):
module
=
portal
.
getDefaultModule
(
supply_portal_type
)
module
.
newContent
(
portal_type
=
supply_portal_type
,
id
=
'erp5_pdm_ui_test_supply_1'
,
source_value
=
portal
.
organisation_module
[
source_node_id
],
destination_value
=
portal
.
organisation_module
[
destination_node_id
],
)
module
.
newContent
(
portal_type
=
supply_portal_type
,
id
=
'erp5_pdm_ui_test_supply_2'
,
source_section_value
=
portal
.
organisation_module
[
source_node_id
],
)
# an unrelated supply that should not be displayed
module
.
newContent
(
portal_type
=
supply_portal_type
,
id
=
'erp5_pdm_ui_test_supply_3'
,
)
# Reset selections
# Reset selections
stool
=
context
.
getPortalObject
().
portal_selections
stool
=
context
.
getPortalObject
().
portal_selections
stool
.
setSelectionFor
(
'resource_current_inventory'
,
None
)
stool
.
setSelectionFor
(
'resource_current_inventory'
,
None
)
...
...
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