Commit ee566452 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_officejs_support_request_ui_test: Add test to make sure we have all...

erp5_officejs_support_request_ui_test: Add test to make sure we have all expected actions to access support request web site
parent 9cfc340e
...@@ -19,11 +19,6 @@ ...@@ -19,11 +19,6 @@
<td>//input[@data-i18n='[value]Submit New Support Request']</td> <td>//input[@data-i18n='[value]Submit New Support Request']</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Generate RSS"]</td>
<td></td>
</tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@id='wrap1']</td> <td>//div[@id='wrap1']</td>
......
...@@ -21,19 +21,51 @@ ...@@ -21,19 +21,51 @@
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@data-i18n="[value]Generate RSS"]</td> <td>//a[@data-i18n="Support Requests"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//input[@data-i18n="[value]Generate RSS"]</td> <td>//a[@data-i18n="Support Requests"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//input[@value="RSS Link"]</td> <td>//a[contains(text(), "Actions")]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>click</td>
<td>//a[contains(text(), "Actions")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), "Generate RSS")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), "Generate RSS")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[contains(text(), "Copy to clipboard")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[contains(text(), "Copy to clipboard")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[contains(text(), "Copied")]</td>
<td></td>
</tr>
<!-- <!--
Firefox RSS compatibility issue: Firefox RSS compatibility issue:
......
...@@ -94,6 +94,46 @@ class SupportRequestTestCase(ERP5TypeTestCase, object): ...@@ -94,6 +94,46 @@ class SupportRequestTestCase(ERP5TypeTestCase, object):
class TestSupportRequestCreateNewSupportRequest(SupportRequestTestCase): class TestSupportRequestCreateNewSupportRequest(SupportRequestTestCase):
def test_existing_portal_type_action_to_support_request(self):
portal_type_list = [
p for p in self.portal.getPortalDocumentTypeList() \
if p not in ("Sound", "Video", "Web Page", 'Video', 'Web Illustration',
'Web Manifest', 'Web Page', 'Web Script', 'Web Style',
'Web Table')]
# Should not happens but we never know
assert portal_type_list, portal_type_list
for portal_type_str in portal_type_list:
portal_type = self.portal.portal_types[portal_type_str]
action_list = portal_type.objectValues(portal_type="Action Information")
filtered_action_list = [action.getReference() \
for action in sorted(action_list, key=lambda x: x.getFloatIndex()) \
if action.getActionType() == "object_officejs_support_request_view"
]
self.assertIn("officejs_support_request_preview",
filtered_action_list,
"missing officejs_support_request_preview in {}".format(portal_type_str))
self.assertIn("officejs_support_request_view",
filtered_action_list,
"missing officejs_support_request_view in {}".format(portal_type_str))
self.assertIn("officejs_support_request_download", filtered_action_list,
"missing officejs_support_request_download in {}".format(portal_type_str))
self.assertEqual(filtered_action_list[0], "officejs_support_request_preview",
"Unexpected action to {} => {}".format(portal_type,
filtered_action_list[0]))
for portal_type_str in ["Support Request", "Support Request Module"]:
portal_type = self.portal.portal_types[portal_type_str]
action_list = portal_type.objectValues(portal_type="Action Information")
filtered_action_list = [action.getReference() \
for action in sorted(action_list, key=lambda x: x.getFloatIndex()) \
if action.getActionType() == "object_officejs_support_request_view"
]
self.assertIn("officejs_support_request_view",
filtered_action_list,
"missing officejs_support_request_view in {}".format(portal_type_str))
def test_submit_support_request(self): def test_submit_support_request(self):
self.getWebSite().SupportRequestModule_createSupportRequest( self.getWebSite().SupportRequestModule_createSupportRequest(
description='<b>Help !!!</b>', description='<b>Help !!!</b>',
......
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