Commit a593a08e authored by Lu Xu's avatar Lu Xu 👀

erp5_officejs_ui_test: UI test upload shared file

parent e98efa7e
......@@ -381,6 +381,11 @@
<td>//a[text() = 'New Event']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='field_your_text_content']//iframe</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='action_confirm' and @value='Create Event']</td>
......
<?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>testOfficeJSSmartAssistantUploadSharedFile</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 OfficeJS UI</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test OfficeJS UI</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<!-- Initialize -->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Storages']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Local is Enough</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='image']</td>
<td></td>
</tr>
<!-- upload no data-->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/</td>
<td></td>
</tr>
<tr>
<td>openAndWait</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/app/#/?page=ojs_smart_assistant_upload_shared_file</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text()="No data found"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='image']</td>
<td></td>
</tr>
<!-- upload file -->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/app/#/?page=ojs_smart_assistant_test_upload_shared_file</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text()="Data created"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Filter']</td>
<td></td>
</tr>
<!-- uploaded file is named by Date() -->
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), "GMT")]</td>
<td></td>
</tr>
<!-- ERP5 storage -->
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Storages</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Storages</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>link=Erp5</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Erp5</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>name=erp5_url</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=erp5_url</td>
<td>${base_url}/web_site_module/</td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Proceed']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='upload']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='image']</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/officejs_smart_assistant/app/#/?page=ojs_smart_assistant_test_upload_shared_file</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text()="Data created"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), "GMT")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Synchronize']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(@href,'smart_assistant_audio')]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_page_module/Zuite_waitForActivities</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/smart_assistant_file_module/</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@title="Show All"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//button[@title="Show All"]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=listbox_title</td>
<td>%GMT%</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_doSelect:method</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="listbox-container"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[contains(text(), "GMT")]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="gadget_officejs_smart_assistant.css">
<link rel="manifest" href="gadget_officejs_json_manifest_smart_assistant.json">
<title>OfficeJS Smart Assistant Test Upload Shared File</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jiodev.js"></script>
<script src="gadget_erp5_page_ojs_smart_assistant_test_upload_shared_file.js"></script>
</head>
<body>
<h1>Testing uploading shared file to Smart Assistant...</h1>
</body>
</html>
/*global window, rJS, jIO, FormData*/
/*jslint indent:2, maxlen: 80, nomen: true */
(function (window, rJS, jIO, FormData) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareService(function handleWebShareFile() {
var gadget = this,
data = new FormData();
data.append('file', 'test');
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
type: 'POST',
url: 'testpostData',
dataType: "blob",
processData: false,
contentType: false,
data: data
});
})
.push(function () {
return gadget.redirect({
command: 'display',
options: {page: "ojs_smart_assistant_upload_shared_file"}
});
});
});
}(window, rJS, jIO, FormData));
\ No newline at end of file
web_page_module/gadget_officejs_erp5_page_smart_assistant_test_upload_shared_file*
\ No newline at end of file
web_page_module/gadget_officejs_erp5_page_smart_assistant_test_upload_shared_file*
\ No newline at end of file
......@@ -3,4 +3,5 @@ notebook_module/notebook_test_purejs
notebook_module/notebook_test_python_basic
portal_tests/officejs_ui_*_zuite
portal_tests/officejs_ui_*_zuite/**
sound_module/test_audio
\ No newline at end of file
sound_module/test_audio
web_page_module/gadget_officejs_erp5_page_smart_assistant_test_upload_shared_file*
\ 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