[IMP] phantomjs driver cleanups

bzr revid: xmo@openerp.com-20140310115334-vjh7gx5oizdm6s67
This commit is contained in:
Xavier Morel 2014-03-10 12:53:34 +01:00
parent bcbe89fbdc
commit aaa80e9575
1 changed files with 7 additions and 5 deletions

View File

@ -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) {
@ -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: