Commit 4e6fc667 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_gadget_interface_validator] Switch to erp5js gadgets

Reorganize code by parsing the appcache with jio.

Interface checking is done by a standalone gadget whch directly display the status.

Drop not needed code (do not reimplement getInterfaceList for example).

Force interface strict HTML format
parent 53d26a9d
......@@ -13,5 +13,5 @@
<script src="gadget_interface.js" type="text/javascript"></script>
</head>
<body></body>
<body><pre>In Progress</pre></body>
</html>
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.5552.51560.44322</string> </value>
<value> <string>968.32633.6528.12782</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1529075051.25</float>
<float>1530266131.49</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.19656.34499.5171</string> </value>
<value> <string>968.35510.60407.49868</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1529315086.55</float>
<float>1530266417.35</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -100,34 +100,75 @@
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# generated on Fri, 06 Feb 2015 15:31:33 +0000\n
# XXX + fonts\n
# images/ajax-loader.gif\n
# generated on Thu, 28 Jun 2018 15:31:33 +0000\n
CACHE:\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\n
URI.js\n
gadget_erp5.css\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot\n
font-awesome/font-awesome-webfont.woff\n
font-awesome/font-awesome-webfont.woff2\n
font-awesome/font-awesome-webfont.ttf\n
font-awesome/font-awesome-webfont.svg#fontawesomeregular\n
erp5_launcher_nojqm.js\n
gadget_erp5_nojqm.css\n
gadget_erp5_configure_editor.html\n
gadget_erp5_configure_editor.js\n
gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_erp5_field_gadget.html\n
gadget_erp5_field_gadget.js\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
gadget_erp5_field_readonly.html\n
gadget_erp5_field_readonly.js\n
gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n
gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_erp5_label_field.html\n
gadget_erp5_label_field.js\n
gadget_erp5_notification.html\n
gadget_erp5_notification.js\n
gadget_erp5_pt_form_list.html\n
gadget_erp5_pt_form_list.js\n
gadget_erp5_pt_form_view.html\n
gadget_erp5_pt_form_view.js\n
gadget_erp5_router.html\n
gadget_erp5_router.js\n
gadget_erp5_search_editor.html\n
gadget_erp5_search_editor.js\n
gadget_erp5_searchfield.html\n
gadget_erp5_searchfield.js\n
gadget_erp5_sort_editor.html\n
gadget_erp5_sort_editor.js\n
gadget_global.js\n
gadget_html5_element.html\n
gadget_html5_element.js\n
gadget_html5_input.html\n
gadget_html5_input.js\n
gadget_html5_textarea.html\n
gadget_html5_textarea.js\n
gadget_erp5_global.js\n
gadget_jio.html\n
gadget_jio.js\n
gadget_translate.html\n
gadget_translate.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_translation_data.js\n
handlebars.js\n
jiodev.js\n
jquery.js\n
jquerymobile.css\n
jquerymobile.js\n
renderjs.js\n
rsvp.js\n
gadget_interface_validator_page_form.html\n
gadget_interface_validator_page_form.js\n
gadget_interface_validator_page_report.html\n
gadget_interface_validator_page_report.js\n
gadget_erp5_page_validator_report.html\n
gadget_erp5_page_validator_report.js\n
gadget_erp5_page_validator_result_list.html\n
gadget_erp5_page_validator_result_list.js\n
gadget_interface_validator_panel.html\n
gadget_interface_validator_panel.js\n
gadget_interface_validator_reportpage_interface.html\n
gadget_interface_validator_router.html\n
gadget_interface_validator_router.js\n
gadget_interface_validator_jio.html\n
gadget_interface_validator_jio.js\n
gadget_interface.html\n
gadget_interface.js\n
NETWORK:\n
*</string> </value>
</item>
......@@ -264,7 +305,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>953.52766.8191.15001</string> </value>
<value> <string>968.34429.27639.36556</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -282,7 +323,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1476100685.39</float>
<float>1530201523.97</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -3,17 +3,20 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Gadget Interface Validator Router</title>
<title>Jio Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_interface_validator_router.js" type="text/javascript"></script>
<script src="gadget_interface_validator_jio.js"
type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_jio.html" data-gadget-scope="jio_selection"></div>
<div data-gadget-url='gadget_jio.html' data-gadget-scope='jio'></div>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -75,17 +73,15 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_page_form.html</string> </value>
<value> <string>gadget_interface_validator_jio.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<value> <string>Jio access</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_interface_validator_page_form_html</string> </value>
<value> <string>gadget_interface_validator_jio_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -103,7 +99,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Formpage</string> </value>
<value> <string>Jio Gadget for Interface Validator</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -189,7 +185,7 @@
</tuple>
<state>
<tuple>
<float>1444137927.14</float>
<float>1530086705.78</float>
<string>UTC</string>
</tuple>
</state>
......@@ -234,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.46342.43288.26299</string> </value>
<value> <string>968.32517.6375.25565</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1445964472.82</float>
<float>1530087047.36</float>
<string>UTC</string>
</tuple>
</state>
......@@ -309,7 +305,7 @@
</tuple>
<state>
<tuple>
<float>1444137350.69</float>
<float>1530086631.3</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, QueryFactory, SimpleQuery */
/*jslint indent: 2, maxerr: 3, nomen: true */
(function (window, rJS, RSVP, jIO, QueryFactory, SimpleQuery) {
"use strict";
//////////////////////////////////////////////
// Helpers
//////////////////////////////////////////////
function endsWith(str, suffix) {
// http://simonwillison.net/2006/Jan/20/escape/
suffix = suffix.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
return (new RegExp(suffix + '$', 'i')).test(str);
}
function fetchAppcacheData(appcache_url) {
return new RSVP.Queue()
.push(function () {
return jIO.util.ajax({
url: appcache_url,
dataType: 'text'
});
})
.push(function (evt) {
return evt.target.responseText.split('\n');
});
}
function filterGadgetList(filename_list) {
// XXX Filtering should be done instead by loading
// each URL and report which one are correctly
// loaded gadget
var gadget_list = [],
i;
for (i = 0; i < filename_list.length; i += 1) {
if (endsWith(filename_list[i], '.html') &&
(filename_list[i][0] !== '#')) {
gadget_list.push(filename_list[i]);
}
}
return gadget_list;
}
function wrapJioCall(gadget, method_name, argument_list) {
var storage = gadget.state_parameter_dict.jio_storage;
return storage[method_name].apply(storage, argument_list);
}
//////////////////////////////////////////////
// Storage
//////////////////////////////////////////////
function InterfaceValidatorStorage() {
return;
}
InterfaceValidatorStorage.prototype.hasCapacity = function (name) {
// XXX That's a lie
// This can not do all this thing for now
// But displaying the listbox requires those capacities
return ((name === "list") || (name === "query") ||
(name === "select") || (name === "limit") ||
(name === "sort"));
};
InterfaceValidatorStorage.prototype.buildQuery = function (options) {
// XXX HARDCODED
var query = QueryFactory.create(options.query || '');
if (!((query instanceof SimpleQuery) && (query.key === 'appcache_url'))) {
// Only accept simple query with an appcache_url
return [];
}
return fetchAppcacheData(query.value)
// return fetchAppcacheData('gadget_interface_validator_test.appcache')
.push(function (filename_list) {
return filterGadgetList(filename_list);
})
.push(function (url_list) {
// XXX Sort to stabilize the tests
url_list.sort();
var result_list = [],
i;
for (i = 0; i < url_list.length; i += 1) {
result_list.push({
id: url_list[i],
value: {url: url_list[i]},
doc: {}
});
}
return result_list;
});
};
InterfaceValidatorStorage.prototype.get = function (id) {
return {
portal_type: 'Gadget URL Definition',
url: id
};
};
jIO.addStorage('interface_validator', InterfaceValidatorStorage);
rJS(window)
.ready(function (gadget) {
return gadget.getDeclaredGadget('jio')
.push(function (jio_gadget) {
// Initialize the gadget local parameters
gadget.state_parameter_dict = {jio_storage: jio_gadget};
});
})
.declareMethod('createJio', function () {
return this.state_parameter_dict.jio_storage.createJio({
type: "interface_validator"
});
})
.declareMethod('allDocs', function () {
return wrapJioCall(this, 'allDocs', arguments);
})
.declareMethod('get', function () {
return wrapJioCall(this, 'get', arguments);
});
}(window, rJS, RSVP, jIO, QueryFactory, SimpleQuery));
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -71,7 +69,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_router.js</string> </value>
<value> <string>gadget_interface_validator_jio.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -81,7 +79,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_interface_validator_router_js</string> </value>
<value> <string>gadget_interface_validator_jio_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -99,7 +97,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Router JS</string> </value>
<value> <string>Jio Gadget for Interface Validator JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -185,7 +183,7 @@
</tuple>
<state>
<tuple>
<float>1444136829.68</float>
<float>1530086915.23</float>
<string>UTC</string>
</tuple>
</state>
......@@ -230,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.15281.35451.28142</string> </value>
<value> <string>968.34342.13291.34082</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1529052586.11</float>
<float>1530196276.82</float>
<string>UTC</string>
</tuple>
</state>
......@@ -305,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1444133648.6</float>
<float>1530086862.82</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Gadget Interface Validator Formpage</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_interface_validator_page_form.js" type="text/javascript"></script>
<!-- XXX must set theme here! -->
<script id="interface-validator-template" type="text/x-handlebars-template">
<div class="ui-grid-b ui-responsive">
<div class="ui-block-a"></div>
<div class="ui-block-b">
<form class="interface-validation-form">
<div class="ui-field-contain">
<label>Appcache URL</label>
<input type="text" name="appcache_url" placeholder="Appcache URL" value="" required>
</div>
<input data-inline="true" type="submit" value="Submit" data-theme="b" name="Submit">
</form>
<pre style="white-space: pre-wrap;">{{message}}</pre>
</div>
<div class="ui-block-c"></div>
</div>
</script>
</head>
<body>
<div class="appcache_form"></div>
<div data-gadget-url="gadget_interface.html"
data-gadget-scope="interface_gadget"
data-gadget-sandbox="public"></div>
<div class="validation_report"></div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Handlebars, $, loopEventListener */
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
(function (window, rJS, RSVP, Handlebars, $, loopEventListener) {
"use strict";
var INTERFACE_GADGET_SCOPE = "interface_gadget",
/////////////////////////////////////////////////////////////////
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
gadget_klass = rJS(window),
source = gadget_klass.__template_element
.getElementById("interface-validator-template")
.innerHTML,
interface_validator_template = Handlebars.compile(source);
function fetchPageType(gadget_url) {
var page_type = '',
key = '_page_';
if (gadget_url.indexOf(key) > -1) {
page_type = gadget_url.substring(gadget_url.indexOf(key) + key.length,
gadget_url.lastIndexOf('.'));
}
return page_type;
}
gadget_klass
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.ready(function (g) {
g.props = {};
})
// Assign the element to a variable
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.content_element = element.querySelector('.appcache_form');
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
var error_message = '';
if (options.found !== undefined && options.found === 'false') {
error_message = "Error: Cannot load the appcache file. " +
"Please check and try again.";
}
gadget.props.content_element.innerHTML =
interface_validator_template({
message: error_message
});
$(gadget.props.element).trigger("create");
gadget.props.content_element.querySelector("input[type=submit]")
.disabled = false;
gadget.props.content_element.querySelector("input[type=text]")
.focus();
});
})
.declareService(function () {
////////////////////////////////////
// Form submit listening.
// Prevent browser to automatically handle the form submit in
// case of a bug
////////////////////////////////////
var gadget = this;
function formSubmit(submit_event) {
var interface_gadget,
appcache_url;
return new RSVP.Queue()
.push(function () {
gadget.props.content_element.querySelector("input[type=submit]")
.disabled = true;
return submit_event.target[0].value;
})
.push(function (submit_url) {
appcache_url = submit_url;
return gadget.getDeclaredGadget(INTERFACE_GADGET_SCOPE);
})
.push(function (i_gadget) {
var required_interface =
'gadget_interface_validator_reportpage_interface.html',
gadget_source_url = 'gadget_interface_validator.appcache';
interface_gadget = i_gadget;
return interface_gadget.getGadgetListImplementingInterface(
required_interface,
gadget_source_url
);
})
.push(function (gadget_list) {
if (gadget_list.length > 0) {
var page_type = fetchPageType(gadget_list[0]);
return gadget.redirect({
page: page_type,
appcache_url: appcache_url
});
}
return gadget.redirect({
found: false
});
});
}
// Listen to form submit
return loopEventListener(
gadget.props.content_element.querySelector(
'form.interface-validation-form'
),
'submit',
false,
formSubmit
);
});
}(window, rJS, RSVP, Handlebars, $, loopEventListener));
\ No newline at end of file
......@@ -3,50 +3,20 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Gadget Interface Validator Reportpage</title>
<link rel="http://www.renderjs.org/rel/interface" href="gadget_interface_validator_reportpage_interface.html">
<title>Interface Validator Page Report</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_interface_validator_page_report.js" type="text/javascript"></script>
<script id="report-widget-table" type="text/x-handlebars-template">
<table class="ui-responsive ui-body-c ui-table-inset custom-force-list">
<thead class="ui-bar-inherit">
<tr>
{{#each column_list}}
<th>{{this}}</th>
{{/each}}
</tr>
</thead>
{{> report-widget-table-partial}}
<tfoot class="ui-bar-inherit"></tfoot>
</table>
</script>
<script id="report-widget-table-partial" type="text/x-handlebars-template">
<tbody>
{{#each row_list}}
<tr id = {{default_id}}>
{{#each cell_list}}
<td class={{default_class}}>{{value}}</td>
{{/each}}
</tr>
{{/each}}
</tbody>
</script>
<script src="gadget_erp5_page_validator_report.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_interface.html"
data-gadget-scope="interface_gadget"
data-gadget-sandbox="public"></div>
<div class="validation_report"></div>
<div data-gadget-url="gadget_erp5_pt_form_view.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -75,7 +73,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_page_report.html</string> </value>
<value> <string>gadget_erp5_page_validator_report.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -103,7 +101,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Reportpage</string> </value>
<value> <string>Gadget Interface Validator Report</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -189,7 +187,7 @@
</tuple>
<state>
<tuple>
<float>1444139553.25</float>
<float>1530102579.71</float>
<string>UTC</string>
</tuple>
</state>
......@@ -234,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.45995.23548.62924</string> </value>
<value> <string>968.32782.54767.17032</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1445964486.74</float>
<float>1530102674.2</float>
<string>UTC</string>
</tuple>
</state>
......@@ -309,7 +307,7 @@
</tuple>
<state>
<tuple>
<float>1444138661.93</float>
<float>1530102237.61</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -71,7 +69,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_page_report.js</string> </value>
<value> <string>gadget_erp5_page_validator_report.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -99,7 +97,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Reportpage JS</string> </value>
<value> <string>Gadget Interface Validator Report JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -185,7 +183,7 @@
</tuple>
<state>
<tuple>
<float>1444138717.03</float>
<float>1530102584.66</float>
<string>UTC</string>
</tuple>
</state>
......@@ -230,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.15263.39947.11758</string> </value>
<value> <string>968.35510.31803.22118</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1529051525.57</float>
<float>1530266369.99</float>
<string>UTC</string>
</tuple>
</state>
......@@ -305,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1444138661.94</float>
<float>1530102251.09</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Interface Validator Page Result List</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_validator_result_list.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_list.html"
data-gadget-scope="form_list"
data-gadget-sandbox="public">
</div>
</body>
</html>
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -75,7 +73,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_router.html</string> </value>
<value> <string>gadget_erp5_page_validator_result_list.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -85,7 +83,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_interface_validator_router_html</string> </value>
<value> <string>gadget_interface_validator_page_result_list_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -103,7 +101,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Router</string> </value>
<value> <string>Gadget Interface Validator Result List</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -189,7 +187,7 @@
</tuple>
<state>
<tuple>
<float>1444136839.34</float>
<float>1530085036.04</float>
<string>UTC</string>
</tuple>
</state>
......@@ -234,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.44766.54929.30600</string> </value>
<value> <string>968.32488.17521.20138</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1446476270.36</float>
<float>1530085029.94</float>
<string>UTC</string>
</tuple>
</state>
......@@ -309,7 +307,7 @@
</tuple>
<state>
<tuple>
<float>1444133648.59</float>
<float>1530084873.58</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.allowPublicAcquisition('updateHeader', function () {
return;
})
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, date, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
result.data.rows[i].value.validation_state = {
field_gadget_param: {
description: "",
title: "State",
"default": "",
css_class: "",
required: null,
editable: 0,
url: "gadget_interface.html",
sandbox: "",
renderjs_extra: JSON.stringify({
gadget_to_check_url: result.data.rows[i].value.url,
summary: true
}),
key: "field_my_validation_state",
hidden: 0,
type: "GadgetField"
}
};
}
return result;
});
})
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function () {
var gadget = this;
return gadget.getUrlFor({
command: 'change',
options: {page: "jabberclient_new_contact"}
})
.push(function (url) {
return gadget.updateHeader({
page_title: 'Gadgets',
page_icon: 'puzzle-piece',
filter_action: true
// add_url: url
});
})
.push(function () {
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_gadget) {
var column_list = [
['url', 'Gadget'],
['validation_state', 'State']
];
return form_gadget.render({
erp5_document: {"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 0,
"editable_column_list": [],
"key": "field_listbox",
"lines": 100,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs",
"portal_type": [],
"search_column_list": [['appcache_url', 'Appcache']],
"sort_column_list": [],
"sort": [],
"title": "Gadgets",
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
});
});
}(window, rJS));
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -71,7 +69,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_interface_validator_page_form.js</string> </value>
<value> <string>gadget_erp5_page_validator_result_list.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -81,7 +79,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_interface_validator_page_form_js</string> </value>
<value> <string>gadget_interface_validator_page_result_list_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -99,7 +97,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Interface Validator Formpage JS</string> </value>
<value> <string>Gadget Interface Validator Result List JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -185,7 +183,7 @@
</tuple>
<state>
<tuple>
<float>1444137933.26</float>
<float>1530085115.14</float>
<string>UTC</string>
</tuple>
</state>
......@@ -230,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.15277.3815.5239</string> </value>
<value> <string>968.34322.25774.2099</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1529052317.55</float>
<float>1530195129.2</float>
<string>UTC</string>
</tuple>
</state>
......@@ -305,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1444137350.68</float>
<float>1530085046.39</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,47 +4,72 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Gadget Interface Validator Panel</title>
<!--
data-i18n=Editable
-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquerymobile.js" type="text/javascript"></script>
<script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<form action="#" method="post">
<input type="submit" data-i18n="[value]Close" data-icon="delete" data-iconpos="notext" value="Close" />
</form>
</div>
</div>
<img class="ui-title" alt="ERP5" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAAA/CAMAAADaDqrIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMEM5NUE4MzQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMEM5NUE4NDQ5NjQxMUUzOUZEQUU2NUY1RTI1RjdCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAwQzk1QTgxNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAwQzk1QTgyNDk2NDExRTM5RkRBRTY1RjVFMjVGN0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+J9MJsAAAAwBQTFRF///////M//+Z//9m//8z//8A/8z//8zM/8yZ/8xm/8wz/8wA/5n//5nM/5mZ/5lm/5kz/5kA/2b//2bM/2aZ/2Zm/2Yz/2YA/zP//zPM/zOZ/zNm/zMz/zMA/wD//wDM/wCZ/wBm/wAz/wAAzP//zP/MzP+ZzP9mzP8zzP8AzMz/zMzMzMyZzMxmzMwzzMwAzJn/zJnMzJmZzJlmzJkzzJkAzGb/zGbMzGaZzGZmzGYzzGYAzDP/zDPMzDOZzDNmzDMzzDMAzAD/zADMzACZzABmzAAzzAAAmf//mf/Mmf+Zmf9mmf8zmf8Amcz/mczMmcyZmcxmmcwzmcwAmZn/mZnMmZmZmZlmmZkzmZkAmWb/mWbMmWaZmWZmmWYzmWYAmTP/mTPMmTOZmTNmmTMzmTMAmQD/mQDMmQCZmQBmmQAzmQAAZv//Zv/MZv+ZZv9mZv8zZv8AZsz/ZszMZsyZZsxmZswzZswAZpn/ZpnMZpmZZplmZpkzZpkAZmb/ZmbMZmaZZmZmZmYzZmYAZjP/ZjPMZjOZZjNmZjMzZjMAZgD/ZgDMZgCZZgBmZgAzZgAAM///M//MM/+ZM/9mM/8zM/8AM8z/M8zMM8yZM8xmM8wzM8wAM5n/M5nMM5mZM5lmM5kzM5kAM2b/M2bMM2aZM2ZmM2YzM2YAMzP/MzPMMzOZMzNmMzMzMzMAMwD/MwDMMwCZMwBmMwAzMwAAAP//AP/MAP+ZAP9mAP8zAP8AAMz/AMzMAMyZAMxmAMwzAMwAAJn/AJnMAJmZAJlmAJkzAJkAAGb/AGbMAGaZAGZmAGYzAGYAADP/ADPMADOZADNmADMzADMAAAD/AADMAACZAABmAAAzAAAAHHa7K3/AOojESZHJWZvNaKTSd63Whrbblb/fpMjks9Howtrt4e320uTx8Pb6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdfKHSQAAAOh0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ALItoLoAAAJkSURBVHja7NlZsqsgEABQ979C5kGGddxo4os0Q8BAynoFn0nUU23TNGRB9xzLdE3XdE3XdP2fLnIzF2VSrsYvC72HizAh9eZ5DVuOl15S4/jWwC+kDC8HPzCSJVHcRY8QXV2PwQuujUYTsYrvYlBv1yKLrsXHsPghnvR3Lazoip/JKuwpF8sm6/bY01Ow9CBlTXi53PNoRcUktEZT1NV1PIPnXAjtMJIMlzerFIzU1dVWF7aPj3Tetae4gjdxktG2et/qQjJ4kZFrv6ED4bK4eR1qduHzvEi4+PbGwD0EGu9CQQLFrv1F4jBc6BcuW3YhkPiPX1hOfxQvnHfh0HVMRqc4HuqiQf5k3mO6dq1s8Hx0H/Le5kq9YaNcxAcrZLpOvAv+ClcgNcZFtnrucd5Fwx4mXj0drnbBYXMuJmFDAV3Uhm4qlbHh3ddOrmholHNxFTVC+xTl2mf6pI4uVe4LwSp0DPGOmh/hAnM94bKZjkHlWuiLeV+cTab4luMKk82wy/Px2fLJskvKUk03hRf9RZ0wiYiZ4uVwVwTb9E71y0XboTYXGuTaa33Y47W5zBjXM3P11y7TfR2ycFdxyaW7uwSc5m0un9ix91m3TWJfW+1ijfW+wcVAfjS5dOP62LyvZZdcLHnA1MkFAtbgwq+Vm47po8OA1buwyy/a1ec5urzveAes2sV8kfW963mFaHNhlT0b6+Yi5+StchH1CtaK0ThXELDPLiyOPZHldzm/J1z9O/B14g7/K+DtkP7U8ivSeD4xaPCTSQvy+YIfubZWzRgtRe1iMP+3mq7pmq7p6jv+BBgAPrgi/TzwWzkAAAAASUVORK5CYII="/>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<a href="#" class="ui-btn ui-btn-icon-notext ui-icon-home" data-i18n="Home">Home</a>
<button data-i18n="Close" class="ui-btn ui-btn-icon-notext ui-icon-delete">Close</button>
</div>
</div>
<!--div class="panel_img">
<img class="ui-title" alt="ERP5" src="gadget_erp5_panel.png?format=png"/>
</div-->
</div>
</script>
<script id="panel-template-body" type="text/x-handlebars-template">
<div class="ui-content">
<ul data-role="listview" class="ui-listview">
<li><a href="#page=form" data-i18n="Interface Validation Form">Interface Validation Form</a></li>
</ul>
<!--form class="dialog_form">
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div>
</form-->
<ul data-role="listview" class="ui-listview" data-enhanced="true"></ul>
<div data-gadget-url="gadget_erp5_field_checkbox.html"
data-gadget-scope="erp5_checkbox"
data-gadget-sandbox="public"></div>
<dl></dl>
</div>
</script>
<script id="panel-template-body-list" type="text/x-handlebars-template">
</script>
<!--script id="panel-template-body-desktop" type="text/x-handlebars-template">
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-eye" data-i18n="Views">Views</dt>
{{#each view_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
<dt class="ui-content-title ui-body-c ui-btn ui-btn-icon-left ui-icon-cogs" data-i18n="Decisions">Decisions</dt>
{{#each workflow_list}}
<dd data-role="listview" data-theme="c" data-inset="true" class="document-listview">
<a data-i18n="{{title}}" class="ui-body-inherit" href="{{href}}">{{title}}</a>
</dd>
{{/each}}
</script-->
<!-- custom script -->
<script src="gadget_interface_validator_panel.js" type="text/javascript"></script>
</head>
<body>
<div class="jqm-navmenu-panel"></div>
</body>
</html>
\ No newline at end of file
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.54879.52570.13994</string> </value>
<value> <string>968.34031.5357.24490</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -250,7 +250,7 @@
</tuple>
<state>
<tuple>
<float>1446805712.99</float>
<float>1530195837.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.32925.58228.494</string> </value>
<value> <string>968.34033.5348.45653</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1476099637.97</float>
<float>1530177764.85</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, document, loopEventListener, RSVP */
/*jslint nomen: true, indent: 2, maxlen: 80 */
(function (window, rJS, document, loopEventListener, RSVP) {
"use strict";
var MAIN_PAGE_PREFIX = "gadget_interface_validator_",
DEFAULT_PAGE = "form",
REDIRECT_TIMEOUT = 5000;
function listenHashChange(gadget) {
function extractHashAndDispatch(evt) {
var hash = (evt.newURL || window.location.toString()).split('#')[1],
subhashes,
subhash,
keyvalue,
index,
args = {};
if (hash !== undefined) {
subhashes = hash.split('&');
for (index in subhashes) {
if (subhashes.hasOwnProperty(index)) {
subhash = subhashes[index];
if (subhash !== '') {
keyvalue = subhash.split('=');
if (keyvalue.length === 2) {
args[decodeURIComponent(keyvalue[0])] =
decodeURIComponent(keyvalue[1]);
}
}
}
}
}
return gadget.renderApplication({
args: args
});
}
var result = loopEventListener(window, 'hashchange', false,
extractHashAndDispatch),
event = document.createEvent("Event");
event.initEvent('hashchange', true, true);
event.newURL = window.location.toString();
window.dispatchEvent(event);
return result;
}
rJS(window)
.ready(function (gadget) {
gadget.props = {
start_deferred: RSVP.defer()
};
})
.declareMethod("getCommandUrlFor", function (options) {
var prefix = '',
result,
key;
result = "#";
for (key in options) {
if (options.hasOwnProperty(key) && options[key] !== undefined) {
// Don't keep empty values
result += prefix + encodeURIComponent(key) + "=" +
encodeURIComponent(options[key]);
prefix = '&';
}
}
return result;
})
.declareMethod('redirect', function (options) {
return this.getCommandUrlFor(options)
.push(function (hash) {
window.location.replace(hash);
// prevent returning unexpected response
// wait for the hash change to occur
// fail if nothing happens
return RSVP.timeout(REDIRECT_TIMEOUT);
});
})
.declareMethod('route', function (options) {
var args = options.args,
page;
page = args.page || DEFAULT_PAGE;
return {
url: MAIN_PAGE_PREFIX + "page_" + page + ".html",
options: args
};
})
.declareAcquiredMethod('renderApplication', 'renderApplication')
.declareMethod('start', function () {
this.props.start_deferred.resolve();
})
.declareService(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.props.start_deferred.promise;
})
.push(function () {
return listenHashChange(gadget);
});
});
}(window, rJS, document, loopEventListener, RSVP));
\ No newline at end of file
web_page_module/gadget_interface_js
web_page_module/gadget_interface_html
web_page_module/gadget_interface_validator_*
web_site_module/gadget_interface_validator*
\ No newline at end of file
web_site_module/gadget_interface_validator
\ No newline at end of file
web_page_module/gadget_interface_html
web_page_module/gadget_interface_js
web_page_module/gadget_interface_validator_*
web_site_module/gadget_interface_validator*
\ No newline at end of file
web_site_module/gadget_interface_validator
\ No newline at end of file
......@@ -20,115 +20,74 @@
<td>${base_url}/web_site_module/${application_title}/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/triggle_filter_and" />
<tal:block tal:define="filter_section_configuration python: {'key': 'COLUMN_appcache_url', 'value': 'gadget_interface_validator_test.appcache', 'index': 0}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/set_filter_section" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_filter" />
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//form[@class='interface-validation-form']</td>
<td>waitForTextPresent</td>
<td>In Progress</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='Submit']</td>
<td>assertTextPresent</td>
<td>In Progress</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=appcache_url</td>
<td>${application_title}_test.appcache</td>
</tr>
<tr>
<td>click</td>
<td>//input[@name='Submit']</td>
<td>waitForTextNotPresent</td>
<td>In Progress</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//table</td>
<td>assertTextNotPresent</td>
<td>In Progress</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b>Check correct use case</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_correct_implemented_gadget']//td[@class='validation_status final']</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_correct_implemented_gadget']//td[@class='validation_status final']</td>
<td>Success</td>
</tr>
<tr>
<td colspan="3"><b>Check not existent gadget</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_nonexistent_gadget']//td[@class='validation_status final']</td>
<td></td>
<td>//tbody/tr/td</td>
<td>gadget_interface_validator_test_correct_implemented_gadget.html</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_nonexistent_gadget']//td[@class='validation_status final']</td>
<td>Error with gadget loading</td>
<td>//tbody/tr/td[2]</td>
<td>Success</td>
</tr>
<tr>
<td colspan="3"><b>Check interface with invalid syntax</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget']//td[@class='validation_status final']</td>
<td></td>
<td>assertText</td>
<td>//tbody/tr[2]/td</td>
<td>gadget_interface_validator_test_invalid_interface_gadget.html</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget']//td[@class='validation_status final']</td>
<td>//tbody/tr[2]/td[2]</td>
<td>Failure</td>
</tr>
<tr>
<td>click</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget']//td[@class='validation_status final']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget_errordata']//td[@class='errordata']</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget_errordata']//td[@class='errordata']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget']//td[@class='validation_status final']</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//tr[@id='${application_title}_test_invalid_interface_gadget_errordata']//td[@class='errordata']</td>
<td></td>
</tr>
<tr>
<td colspan="3"><b>Check missing interface</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_missing_interface_declaration_gadget']//td[@class='validation_status final']</td>
<td></td>
<td>assertText</td>
<td>//tbody/tr[3]/td</td>
<td>gadget_interface_validator_test_missing_interface_declaration_gadget.html</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_missing_interface_declaration_gadget']//td[@class='validation_status final']</td>
<td>//tbody/tr[3]/td[2]</td>
<td>N/A</td>
</tr>
......@@ -136,85 +95,44 @@
<td colspan="3"><b>Check missing method declaration</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//tr[@id='${application_title}_test_missing_method_declaration_gadget']//td[@class='validation_status final']</td>
<td></td>
<td>assertText</td>
<td>//tbody/tr[4]/td</td>
<td>gadget_interface_validator_test_missing_method_declaration_gadget.html</td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_missing_method_declaration_gadget']//td[@class='validation_status final']</td>
<td>//tbody/tr[4]/td[2]</td>
<td>Failure</td>
</tr>
<tr>
<td colspan="3"><b>Check invalid appcache</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//button[@data-i18n='Menu']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Interface Validation Form']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Interface Validation Form']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//form[@class='interface-validation-form']</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=appcache_url</td>
<td>${application_title}_invalid.appcache</td>
<td colspan="3"><b>Check not existent gadget</b></td>
</tr>
<tr>
<td>click</td>
<td>//input[@name='Submit']</td>
<td></td>
<td>assertText</td>
<td>//tbody/tr[5]/td</td>
<td>gadget_interface_validator_test_nonexistent_gadget.html</td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Error</td>
<td></td>
<td>assertText</td>
<td>//tbody/tr[5]/td[2]</td>
<td>Error with gadget loading</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Error</td>
<td></td>
<!--tr>
<td colspan="3"><b>Check unknown method declaration</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[@data-i18n='Menu']</td>
<td>//tr[@id='${application_title}_test_unknown_method_declaration_gadget']//td[@class='validation_status final']</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='Home']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//form[@class='interface-validation-form']</td>
<td></td>
</tr>
<td>assertText</td>
<td>//tr[@id='${application_title}_test_unknown_method_declaration_gadget']//td[@class='validation_status final']</td>
<td>Failure</td>
</tr-->
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -37,6 +37,7 @@ class TestZeleniumCore(ERP5TypeFunctionalTestCase):
def getBusinessTemplateList(self):
return (
'erp5_gadget_interface_validator',
'erp5_web_renderjs_ui_test',
'erp5_gadget_interface_validator_ui_test',
'erp5_ui_test_core',
)
......
......@@ -2,3 +2,4 @@ erp5_ui_test_core
erp5_ui_test
erp5_officejs
erp5_gadget_interface_validator
erp5_web_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