Commit bb97b590 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5_ui_test: Reintroduce renderjs_oss minimal tests

parent 2726bac8
Pipeline #34184 failed with stage
in 0 seconds
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_renderjs_oss_zuite</string> </value>
<value> <string>renderjs_oss_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -54,7 +54,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/${install_url}/#/?page=test_service_worker</td>
<td>${base_url}/web_site_module/${install_url}/#/?page=service_worker_test</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_app_loaded" />
......@@ -80,4 +80,4 @@
</table>
</body>
</html>
\ No newline at end of file
</html>
......@@ -31,7 +31,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona
class TestSlapOSRenderJSOSSUIHalStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "slapos_renderjs_oss_zuite"
run_only = "renderjs_oss_zuite"
def afterSetUp(self):
ERP5TypeFunctionalTestCase.afterSetUp(self)
......
erp5_ui_test_core
erp5_web_renderjs_ui_test
\ No newline at end of file
Unit test for SlapOS OSS custom site
GPL
\ No newline at end of file
portal_tests/renderjs_oss_zuite
portal_tests/renderjs_oss_zuite/**
test.erp5.testFunctionalSlapOSRenderJSOSSUIHalStyle
1.0
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>SlapOS Test Service Worker</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_page.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_test_service_worker.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
/*global window, rJS, RSVP, domsugar, navigator, promiseEventListener, jIO */
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
(function (window, rJS, RSVP, domsugar, navigator, promiseEventListener, jIO) {
"use strict";
rJS(window)
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareMethod('render', function () {
var gadget = this;
// Wait a bit a allow the header loader to be displayed
return new RSVP.Queue(RSVP.delay(200))
.push(function () {
return gadget.getUrlForList([
// Home page
{command: 'display'},
// Soft reload the gadget
{command: 'change'}
]);
})
.push(function (url_list) {
gadget.checkServiceWorkerStatus();
return gadget.updateHeader({
page_title: 'Test Service Worker',
front_url: url_list[0],
tab_url: url_list[1],
submit_action: true
});
});
})
.declareMethod("triggerSubmit", function () {
var gadget = this;
return new RSVP.Queue(jIO.util.ajax({
type: 'POST',
url: './Base_changeModificationDateForTest'
}))
.push(function () {
domsugar(gadget.element, {
text: "SW changed on server"
});
});
})
.declareJob("checkServiceWorkerStatus", function () {
var gadget = this,
has_service_worker = (navigator.serviceWorker.controller !== null);
domsugar(gadget.element, {
text: "Has SW: " + has_service_worker.toString()
});
return new RSVP.Queue(navigator.serviceWorker.ready)
.push(function (worker_container) {
domsugar(gadget.element, {
text: "Has SW: true"
});
return promiseEventListener(worker_container.active, 'statechange');
})
.push(function () {
// Wait a bit until the message is propagated
return RSVP.delay(2000);
})
.push(function () {
domsugar(gadget.element, {
text: "New SW ready"
});
});
});
}(window, rJS, RSVP, domsugar, navigator, promiseEventListener, jIO));
\ No newline at end of file
web_page_module/rjs_gadget_slapos_erp5_page_test_service_worker_html
web_page_module/rjs_gadget_slapos_erp5_page_test_service_worker_js
\ No newline at end of file
portal_tests/slapos_renderjs_oss_zuite
portal_tests/slapos_renderjs_oss_zuite/**
portal_tests/slaposjs_zuite
portal_tests/slaposjs_zuite/**
web_page_module/rjs_gadget_slapos_erp5_page_test_service_worker_html
web_page_module/rjs_gadget_slapos_erp5_page_test_service_worker_js
\ No newline at end of file
test.erp5.testFunctionalSlapOSUIHalStyle
test.erp5.testFunctionalSlapOSUIZHHalStyle
test.erp5.testFunctionalSlapOSRenderJSOSSUIHalStyle
\ 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