Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
server.listen(3000, function() {
var location = "http://localhost:3000/test/index.html";
var browser = new zombie.Browser({debug: false});
browser.visit(location, function(err, browser, status) {
// Start QUnit
browser.fire('load', browser.window);
browser.wait(function(err, browser) {
qunitResults = browser.css('#qunit-tests > li');
console.log(qunitResults.length);
server.close();
callback();
});
});
});
};
server.listen(3000, function() {
var location = "http://localhost:3000/qunit/index.html";
var browser = new zombie.Browser({
debug: false,
userAgent: 'Zombie'
});
browser.visit(location, function(err, browser, status) {
// Start QUnit
browser.fire('load', browser.window);
// If you have long tests, tweak the wait time here
browser.wait(2000, function(err, browser) {
qunitResults = browser.queryAll('#qunit-tests > li');
server.close();
callback();
});
});
});
};
server.listen(3000, function() {
var location = "http://localhost:3000/test/index.html";
var browser = new zombie.Browser({
debug: false,
userAgent: 'Zombie'
});
browser.visit(location, function(err, browser, status) {
// Start QUnit
browser.fire('load', browser.window);
browser.wait(20000, function(err, browser) {
qunitResults = browser.queryAll('#qunit-tests > li');
server.close();
callback();
});
});
});
};
stream.on('end', function () {
if (browser == null) {
browser = new zombie.Browser();
// Clean up old pointers
pointers = [];
}
eval(buffer);
buffer = "";
});
}).listen(8124, '127.0.0.1');
function Brain (t) {
this.t = t;
this.browser = new zombie.Browser();
}
singles.forEach(function (s) {
describe('twitter client', function() {
var jasmine = require('jasmine-node')
var zombie = require('zombie')
var browser = new zombie.Browser()
describe('initial', function() {
it('has correct title', function() {
whenPageHasLoaded(function() {
expect(browser.text('title')).toEqual('Foo Twitter Client')
jasmine.asyncSpecDone()
})
})
it('has trends link', function() {
whenPageHasLoaded(function() {
expect(browser.text('.actions .showTrends')).toEqual('Trends')
jasmine.asyncSpecDone()
})
})
})
zombieEnv.prototype.init = function(b) {
var _this = this;
_this.target = new zombie.Browser();
_this.target.on("error", function(err) {});
_this.target.on("loaded", function() {});
_this.target.visit(_this.startURL, function(err, browser, status) {
_this.live = true;
_this.tide = setInterval(function() {
if (_this.live && _this.tid && (_this.queue.length != 0)) {
var wave = _this.queue.shift();
wave.fn(wave.cb);
}
}, 1000);
_this.state = setInterval(function() {
if (_this.live && _this.tid) {
var ret = _this.target.evaluate("window.jfComplete");
function ZombieSpider (options) {
var zombie = require('zombie');
this.browser = new zombie.Browser({ debug: options });
if (typeof options.runScripts !== 'undefined') {
options.runScripts = false;
}
this.browser.runScripts = options.runScripts;
this.get = function () {};
}
util.inherits(ZombieSpider, Spider);
var GoogleLand = function(world) {
this.browser = new zombie.Browser({runScripts:true, debug:false, htmlParser: HTML5});
};
function ctx_switch(id){
if(!CLIENTS[id])
CLIENTS[id] = [new zombie.Browser(), []];
return CLIENTS[id];
}