Commit b8d3c54d authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_project&test: enable requirement fast input in renderjs ui

parent fcb86d6a
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_fast_input</string>
<string>action_type/object_jio_fast_input</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_fast_input</string> </value>
<value> <string>object_jio_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_fast_input</string>
<string>action_type/object_jio_fast_input</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_fast_input</string> </value>
<value> <string>object_jio_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_fast_input</string>
<string>action_type/object_jio_fast_input</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_fast_input</string> </value>
<value> <string>object_jio_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
......
context_obj = context.getObject()
translateString = context.Base_translateString
requirement_module_type = 'Requirement Module'
requirement_document_type = 'Requirement Document'
......@@ -14,7 +15,11 @@ if context_obj.getPortalType() == requirement_module_type:
elif context_obj.getPortalType() in (requirement_document_type, requirement_type):
destination_obj = context_obj
else:
return context.REQUEST.RESPONSE.redirect(context.absolute_url() + '/view?portal_status_message=Error:+bad+context.')
return context.Base_redirect(
form_id,
keep_items=dict(
portal_status_level='error',
portal_status_message=translateString('Error: bad context')))
# this list contain all requirements items
requirements_items = []
......@@ -101,6 +106,5 @@ for key in clean_requirements_key_list:
, int_index = sub_requirement_int_index
)
# return to the requirement
translateString = context.Base_translateString
return context.Base_redirect(form_id,
keep_items=dict(portal_status_message=translateString('Requirement document added.')))
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_project_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>testRequirementFastInput</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>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Requirement Fast Input</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Requirement Fast Input</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/requirement_module</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<!-- action on requirement module -->
<tr>
<td>waitForElementPresent</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Document Fast Input"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Document Fast Input"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_my_requirement_document_title"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_my_requirement_document_title"]</td>
<td>Test Require Document Title</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_my_requirement_document_description"]</td>
<td>Test Require Document Description</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_sub_requirement_title_new_001"]</td>
<td>Sub Requirement</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_listbox_sub_requirement_description_new_001"]</td>
<td>Sub Requirement Description</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Requirement document added.'}">
<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>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${url}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//a[text()="Test Require Document Title"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="document_table"]//a[text()="Test Require Document Title"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//a[text()="Requirement"]</td>
<td></td>
</tr>
<!-- action on requirement document -->
<tr>
<td>waitForElementPresent</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Fast Input"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Fast Input"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement2</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement2</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_sub_requirement_title_new_001"]</td>
<td>Sub Requirement2</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_listbox_sub_requirement_description_new_001"]</td>
<td>Sub Requirement Description2</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Requirement document added.'}">
<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>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${url}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//a[text()="Requirement2"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="document_table"]//a[text()="Requirement2"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//a[text()="Sub Requirement2"]</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@class="document_table"]//p[text()="Sub Requirement Description2"]</td>
<td></td>
</tr>
<!-- action on requirement -->
<tr>
<td>waitForElementPresent</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Fast Input"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//dd[@class="document-listview"]//a[text()="Requirement Fast Input"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement3</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_requirement_title_new_001"]</td>
<td>Requirement3</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="field_listbox_sub_requirement_title_new_001"]</td>
<td>Sub Requirement3</td>
</tr>
<tr>
<td>type</td>
<td>//textarea[@name="field_listbox_sub_requirement_description_new_001"]</td>
<td>Sub Requirement Description3</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Requirement document added.'}">
<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>storeLocation</td>
<td>url</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${url}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="document_table"]//a[text()="Requirement3"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2017 Nexedi SARL and Contributors. All Rights Reserved.
# Kazuhiko <kazuhiko@nexedi.com>
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
class testFunctionalRJSProject(ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "renderjs_ui_project_zuite"
def getBusinessTemplateList(self):
return (
"erp5_prject",
"erp5_web_renderjs_ui_test_core",
)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(testFunctionalRJSProject))
return suite
\ No newline at end of file
<?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>testFunctionalRJSProject</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFunctionalRJSProject</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.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<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>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_project
erp5_web_renderjs_ui_test_core
\ No newline at end of file
portal_tests/renderjs_ui_project_zuite
portal_tests/renderjs_ui_project_zuite/**
\ No newline at end of file
test.erp5.testFunctionalRJSProject
\ No newline at end of file
erp5_full_text_mroonga_catalog
\ No newline at end of file
erp5_project_renderjs_ui_test
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment