Skip to content

Commit

Permalink
[IMP] phantomjs driver cleanups
Browse files Browse the repository at this point in the history
bzr revid: xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67
  • Loading branch information
xmo-odoo committed Mar 10, 2014
1 parent bcbe89f commit aaa80e9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions openerp/tests/phantomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ function PhantomTest() {
// ----------------------------------------------------
// run test
// ----------------------------------------------------
this.run = function(url_path, code, ready) {
this.run = function() {
var url_path = this.options.url_path,
code = this.options.code,
ready = this.options.ready;
if(self.options.login) {
qp = [];
var qp = [];
qp.push('db=' + self.options.db);
qp.push('login=' + self.options.login);
qp.push('key=' + self.options.password);
qp.push('redirect=' + encodeURIComponent(url_path));
var url_path = "/login?" + qp.join('&');
url_path = "/login?" + qp.join('&');
}
var url = self.origin + url_path;
self.page.open(url, function(status) {
Expand Down Expand Up @@ -132,8 +135,7 @@ function PhantomTest() {

// js mode or jsfile mode
if(phantom.args.length === 1) {
pt = new PhantomTest();
pt.run(pt.options.url_path, pt.options.code, pt.options.ready);
new PhantomTest().run();
}

// vim:et:

0 comments on commit aaa80e9

Please sign in to comment.