From 096432ff73057b819aefa4bfce81488711478cd8 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 10 Mar 2014 19:46:36 +0100 Subject: [PATCH] [REV] reverting xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67 This api change breaks jsfile tests (example test_ui_load.js). The api is broken but the proper fix would be to avoid accessing phantom.args from PhantomTest bzr revid: al@openerp.com-20140310184636-8r9x81xi1zqhcsek --- openerp/tests/phantomtest.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openerp/tests/phantomtest.js b/openerp/tests/phantomtest.js index 8099de54bab..86176402627 100644 --- a/openerp/tests/phantomtest.js +++ b/openerp/tests/phantomtest.js @@ -96,10 +96,7 @@ function PhantomTest() { // ---------------------------------------------------- // run test // ---------------------------------------------------- - this.run = function() { - var url_path = this.options.url_path, - code = this.options.code, - ready = this.options.ready; + this.run = function(url_path, code, ready) { if(self.options.login) { var qp = []; qp.push('db=' + self.options.db); @@ -116,12 +113,15 @@ function PhantomTest() { console.log('loaded', url, status); // process ready waitFor(function() { + console.log("waiting for: calling page evaluate"); return self.page.evaluate(function (ready) { console.log("waiting for", ready); var r = false; try { + console.log("waiting for: page evaluating ", ready); r = !!eval(ready); } catch(ex) { } + console.log("waiting for: returning from page evaluate"); return r; }, ready); // run test @@ -135,7 +135,8 @@ function PhantomTest() { // js mode or jsfile mode if(phantom.args.length === 1) { - new PhantomTest().run(); + pt = new PhantomTest(); + pt.run(pt.options.url_path, pt.options.code, pt.options.ready); } // vim:et: