From 255c8e210cb1667835c5fe04ace7d127d413b8e1 Mon Sep 17 00:00:00 2001 From: Ilyas Date: Tue, 12 Apr 2016 12:18:52 +0500 Subject: [PATCH] [ADD] js simple test --- mail_archives/static/src/xml/menu.xml | 2 +- mail_archives/tests/__init__.py | 3 +++ mail_archives/tests/test_js.py | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 mail_archives/tests/__init__.py create mode 100644 mail_archives/tests/test_js.py diff --git a/mail_archives/static/src/xml/menu.xml b/mail_archives/static/src/xml/menu.xml index 2e8166a..30e39e2 100644 --- a/mail_archives/static/src/xml/menu.xml +++ b/mail_archives/static/src/xml/menu.xml @@ -4,7 +4,7 @@
- Archive + Archive
diff --git a/mail_archives/tests/__init__.py b/mail_archives/tests/__init__.py new file mode 100644 index 0000000..6731bb9 --- /dev/null +++ b/mail_archives/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +import test_js \ No newline at end of file diff --git a/mail_archives/tests/test_js.py b/mail_archives/tests/test_js.py new file mode 100644 index 0000000..645e971 --- /dev/null +++ b/mail_archives/tests/test_js.py @@ -0,0 +1,15 @@ +import openerp.tests + +@openerp.tests.common.at_install(False) +@openerp.tests.common.post_install(True) +class TestUi(openerp.tests.HttpCase): + def test_01_mail_archives(self): + # wait till page loaded and then click and wait again + code = """ + setTimeout(function () { + $(".mail_archives").click(); + setTimeout(function () {console.log('ok');}, 3000); + }, 1000); + """ + link = '/web#action=%s' % self.ref('mail.mail_channel_action_client_chat') + self.phantom_js(link, code, "odoo.__DEBUG__.services['mail_archives.archives']", login="demo")