From 5c3c89a17c604acf0591f8eca15f7d8de07435df Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sun, 16 Feb 2014 22:50:39 +0100 Subject: [PATCH] [FIX] tests move test_ui to web as it requires web.login template bzr revid: al@openerp.com-20140216215039-448vh07674on9569 --- addons/web/tests/test_ui.py | 12 ++++++++++-- addons/web/tests/test_ui_hello.js | 5 +++++ addons/web/tests/test_ui_load.js | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 addons/web/tests/test_ui_hello.js create mode 100644 addons/web/tests/test_ui_load.js diff --git a/addons/web/tests/test_ui.py b/addons/web/tests/test_ui.py index f78ca714d94..b03642747d2 100644 --- a/addons/web/tests/test_ui.py +++ b/addons/web/tests/test_ui.py @@ -1,8 +1,16 @@ # -*- coding: utf-8 -*- +import os + import openerp.tests class TestUi(openerp.tests.HttpCase): - def test(self): - self.phantom_js("/", "console.log('ok')", "console") + def test_01_jsfile_ui_hello(self): + self.phantom_jsfile(os.path.join(os.path.dirname(__file__), 'test_ui_hello.js')) + def test_02_jsfile_ui_load(self): + self.phantom_jsfile(os.path.join(os.path.dirname(__file__), 'test_ui_load.js')) + def test_03_js_public(self): + self.phantom_js('/',"console.log('ok')","console") + def test_04_js_admin(self): + self.phantom_js('/',"console.log('ok')","openerp.client.action_manager.inner_widget.views.kanban", login='admin') # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/web/tests/test_ui_hello.js b/addons/web/tests/test_ui_hello.js new file mode 100644 index 00000000000..6a453e947aa --- /dev/null +++ b/addons/web/tests/test_ui_hello.js @@ -0,0 +1,5 @@ +console.log("hello from test_phantom_hello.js"); +console.log("ok"); +// For a failure use: +//console.log("error"); +phantom.exit(); diff --git a/addons/web/tests/test_ui_load.js b/addons/web/tests/test_ui_load.js new file mode 100644 index 00000000000..9d76250d239 --- /dev/null +++ b/addons/web/tests/test_ui_load.js @@ -0,0 +1,4 @@ +// Load helper +phantom.injectJs(phantom.args[0]); +pt = new PhantomTest(); +pt.run("/", "console.log('ok')", "console");