Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Use webdriverjs to create a Selenium Client
exports.client = require('webdriverjs').remote({
desiredCapabilities : {
// // You may choose other browsers
// //
// http://code.google.com/p/selenium/wiki/DesiredCapabilities
browserName : 'phantomjs'
}
// // webdriverjs has a lot of output which
// is generally useless
// // However, if anything goes wrong,
// remove this to see more details
// logLevel: 'silent'
});
//
// exports.client.init();
before(function(){
client = webdriverjs.remote({
host: 'usmvvwdev67.infor.com',
port: 4444});
client.init();
app.locals.enableLiveReload = false;
server = app.listen(3001);
});
var remote = require('webdriverjs').remote,
chai = require('chai'),
http = require('http'),
assert = chai.assert;
chai.Assertion.includeStack = true;
var client = remote({
logLevel: 'silent',
desiredCapabilities:{
browserName:"chrome",
},
});
client.baseUrl = 'http://localhost:8001';
client.testDesignName = '__test__'
before(function(done) {
this.timeout(20000);
client.initDesign(done);
});
beforeEach(function(done) {
this.timeout(20000);
var webdriverjs = require('webdriverjs');
var selenium = require('selenium-standalone');
var seleniumServer = selenium({stdio: 'pipe'});
var driverOptions = {
desiredCapabilities: {
browserName: 'chrome'
}
};
var client = webdriverjs.remote(driverOptions);
seleniumServer.stdout.on('data', function(output) {
var val = output.toString().trim();
console.log(val);
if(val.indexOf('jetty.jetty.Server')>-1){
client = client.init();
start();
}
});
seleniumServer.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
seleniumServer.on('close', function (code) {
startSelenium: function(callback) {
var webdriverjs = require('webdriverjs');
var driverOptions = {
desiredCapabilities: {
browserName: 'chrome'
}
};
var client = webdriverjs.remote(driverOptions);
var selenium = require('selenium-standalone');
var seleniumServer = selenium({stdio: 'pipe'});
seleniumServer.stdout.on('data', function(output) {
var val = output.toString().trim();
//console.log(val);
if(val.indexOf('jetty.jetty.Server')>-1){
client = client.init();
callback(client);
client.end();
}
});
seleniumServer.stderr.on('data', function (data) {
//console.log('stderr: ' + data);
throw new Error('Do not have a profile for the browser "' + brName + '"!');
}
var cfg = {
logLevel: 'silent',
host: HOST,
port: PORT,
platform: 'ANY',
desiredCapabilities: {
browserName: prof[0]
}
};
if (prof[1]) {
cfg.desiredCapabilities.version = prof[1];
}
var br = webdriverjs.remote(cfg);
//console.log('TESTING ' + brName + '...');
br.testMode();
br.init();
fn(br, brName, qUnit);
});
};
beforeEach(function(done) {
client = webdriverjs.remote({ desiredCapabilities: { browserName: process.env.BROWSER }});
client.init()
.url("http://" + process.env.HOST + ':' + process.env.PORT)
.pause(500, done);
});