Commit da166dba authored by Roque's avatar Roque

erp5_officejs_ui_test: update text editor unit tests to new approach

parent a61bc984
...@@ -47,20 +47,26 @@ ...@@ -47,20 +47,26 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>link=Add</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>link=Add</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td> <td>link=New Text Document</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=New Text Document</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr> <tr>
<td>store</td> <td>store</td>
<td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td> <td tal:content="python: 'Test Titre %s' % DateTime()">Titre</td>
...@@ -116,25 +122,23 @@ ...@@ -116,25 +122,23 @@
<td>//textarea[@title='Description']</td> <td>//textarea[@title='Description']</td>
<td>${description}</td> <td>${description}</td>
</tr> </tr>
<tr>
<td>click</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<td>//button[@data-i18n='Save']</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<td></td> <tal:block tal:define="notification_configuration python: {'class': 'success',
</tr> 'text': 'Data Updated'}">
<tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
<td>waitForElementPresent</td> </tal:block>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td>
<td></td>
</tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[@data-i18n='Document']</td> <td>//a[@data-i18n='Document']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>link=Add</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
...@@ -175,9 +179,4 @@ ...@@ -175,9 +179,4 @@
<td>verifyValue</td> <td>verifyValue</td>
<td>//textarea[@title='Description']</td> <td>//textarea[@title='Description']</td>
<td>${description}</td> <td>${description}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>identifier=cke_1_contents</td>
<td></td>
</tr> </tr>
\ No newline at end of file
...@@ -63,20 +63,26 @@ ...@@ -63,20 +63,26 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>link=Add</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>link=Add</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td> <td>link=New Text Document</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>click</td>
<td>link=New Text Document</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>identifier=title</td> <td>identifier=title</td>
...@@ -112,38 +118,41 @@ ...@@ -112,38 +118,41 @@
<td>identifier=description</td> <td>identifier=description</td>
<td>${description}</td> <td>${description}</td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Data Updated'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//button[@data-i18n='Save']</td> <td>//a[@data-i18n='Document']</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<!-- Verify Search, add another document -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="notification"]//button[text()='Data Updated']</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[@data-i18n='Document']</td> <td>//div[contains(@data-gadget-url, 'gadget_erp5_header.html')]//a[@data-i18n="Actions"]</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<!-- Verify Search, add another document -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//a[@data-i18n='Add']</td> <td>link=New Text Document</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[@data-i18n='Add']</td> <td>link=New Text Document</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Save']</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr> <tr>
<td>store</td> <td>store</td>
<td>search</td> <td>search</td>
...@@ -164,11 +173,13 @@ ...@@ -164,11 +173,13 @@
<td>name=title</td> <td>name=title</td>
<td>${search}</td> <td>${search}</td>
</tr> </tr>
<tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<td>click</td> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<td>//button[@data-i18n='Save']</td> <tal:block tal:define="notification_configuration python: {'class': 'success',
<td></td> 'text': 'Data Updated'}">
</tr> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[@data-i18n='Document']</td> <td>//a[@data-i18n='Document']</td>
...@@ -209,8 +220,13 @@ ...@@ -209,8 +220,13 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>assertTextPresent</td> <td>waitForElementPresent</td>
<td>${title}</td> <td>//input[@name='title']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value='${title}']</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<!-- Initialize --> <!-- Initialize -->
<tr> <tr>
<td>open</td> <td>open</td>
<td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_officejs_create_bad_storage.html</td> <td>${base_url}/portal_skins/erp5_officejs_ui_test/gadget_officejs_create_bad_storage_for_text_editor.html</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Bad Storage Creation</title>
<!-- renderjs -->
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jio.js"></script>
<!-- custom script -->
<script src="gadget_officejs_create_bad_storage_for_text_editor.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_officejs_create_bad_storage_for_text_editor.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*jslint indent: 2, nomen: true */
/*global window, rJS, jIO, document*/
(function (window, rJS, jIO) {
"use strict";
rJS(window)
.declareService(function () {
var storage = jIO.createJIO({
type: "indexeddb",
database: "setting"
}),
gadget = this;
return storage.put(
'setting/Text Editor',
{'jio_storage_description': {type: 'unknownstorage'}}
)
.push(function () {
var div = document.createElement('div');
div.textContent = 'Storage Created';
gadget.element.appendChild(div);
});
});
}(window, rJS, jIO, document));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_officejs_create_bad_storage_for_text_editor.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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