diff --git a/addons/web/tests/test_ui.py b/addons/web/tests/test_ui.py index f78ca714d94..4bbc4a3954c 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.form", 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");