[REM] test: phantom_jsfile method

deprecate phantom_jsfile method, keeping only phantom_js, phantom_js takes a
code argument to run client side only.

Removing phantom_jsfile will allow to switch from phantom to any other engine
such as running google chrome or firefox directly. The only use of
phantom_jsfile was an example.
This commit is contained in:
Antony Lesuisse
2015-08-02 14:37:19 +02:00
parent 218ffc1a5a
commit b4f7288193
4 changed files with 0 additions and 31 deletions
-4
View File
@@ -4,10 +4,6 @@ import os
import openerp.tests
class TestUi(openerp.tests.HttpCase):
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):
-5
View File
@@ -1,5 +0,0 @@
console.log("hello from test_phantom_hello.js");
console.log("ok");
// For a failure use:
//console.log("error");
phantom.exit();
-5
View File
@@ -1,5 +0,0 @@
// Load helper
var system = require('system');
phantom.injectJs(system.args[1]);
pt = new PhantomTest();
pt.run("/", "console.log('ok')", "console");
-17
View File
@@ -349,23 +349,6 @@ class HttpCase(TransactionCase):
openerp.tools.misc.dumpstacks()
t0 = t1
def phantom_jsfile(self, jsfile, timeout=60, **kw):
options = {
'timeout' : timeout,
'port': PORT,
'db': get_db_name(),
'session_id': self.session_id,
}
options.update(kw)
phantomtest = os.path.join(os.path.dirname(__file__), 'phantomtest.js')
# phantom.args[0] == phantomtest path
# phantom.args[1] == options
cmd = [
'phantomjs',
jsfile, phantomtest, json.dumps(options)
]
self.phantom_run(cmd, timeout)
def phantom_js(self, url_path, code, ready="window", login=None, timeout=60, **kw):
""" Test js code running in the browser
- optionnally log as 'login'