[FIX] phantomjs 2.0 compatibility
phantomjs 2.0 remove the deprecated attribute `phantom.args`. Use the new `system` module.
This commit is contained in:
parent
05bbe78d87
commit
f0dc416871
|
@ -1,4 +1,5 @@
|
|||
// Load helper
|
||||
phantom.injectJs(phantom.args[0]);
|
||||
var system = require('system');
|
||||
phantom.injectJs(system.args[1]);
|
||||
pt = new PhantomTest();
|
||||
pt.run("/", "console.log('ok')", "console");
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Phantomjs odoo helper
|
||||
// jshint evil: true, loopfunc: true
|
||||
|
||||
var system = require('system');
|
||||
|
||||
function waitFor (condition, callback, timeout, timeoutMessageCallback) {
|
||||
timeout = timeout || 10000;
|
||||
var start = new Date();
|
||||
|
@ -19,7 +21,7 @@ function waitFor (condition, callback, timeout, timeoutMessageCallback) {
|
|||
|
||||
function PhantomTest() {
|
||||
var self = this;
|
||||
this.options = JSON.parse(phantom.args[phantom.args.length-1]);
|
||||
this.options = JSON.parse(system.args[system.args.length-1]);
|
||||
this.inject = this.options.inject || [];
|
||||
this.timeout = this.options.timeout ? Math.round(parseFloat(this.options.timeout)*1000 - 5000) : 10000;
|
||||
this.origin = 'http://localhost';
|
||||
|
@ -143,7 +145,7 @@ function PhantomTest() {
|
|||
}
|
||||
|
||||
// js mode or jsfile mode
|
||||
if(phantom.args.length === 1) {
|
||||
if(system.args.length === 2) {
|
||||
pt = new PhantomTest();
|
||||
pt.run(pt.options.url_path, pt.options.code, pt.options.ready);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue