Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var World = function World(callback) {
this.browser = wd.remote(); // this.browser will be available in step definitions
// log status output from web driver
this.browser.on('status', function(info){
console.log('\x1b[36m%s\x1b[0m', info);
});
// log commands from web driver
this.browser.on('command', function(meth, path, data){
console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path, data || '');
});
// run the callback when we are done so cucumber knows we are ready
this.browser.init(function() {
callback();
});
};
module.exports = function(port, cb) {
var browser = wd.remote('localhost', port);
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});
var error = function(msg, err) {
console.error(msg, err);
browser.quit();
};
/*
* This test loads up Fil's homepage, checks that the title matches
module.exports = function(port, cb) {
var browser = wd.remote({
host: HOST,
port: PORT,
username: USER,
accessKey: KEY
});
var error = function(msg, err) {
console.error(msg, err);
browser.quit();
};
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
module.exports = function(port, cb) {
var browser = wd.remote({
host:HOST,
port:PORT,
username:USER,
accessKey:KEY
});
var error = function(err, msg) {
console.error(msg, err);
browser.quit();
};
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
module.exports = function(port, cb) {
var browser = wd.remote('localhost', port);
var error = function(msg, err) {
console.error('ERROR! ' + (msg?msg:''), (msg?err:msg));
browser.quit();
};
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});
browser.init({
"name":"Android Selendroid Test w/ Appium 1.0",
module.exports = function(port, cb) {
var browser = wd.remote({
host:HOST,
port:PORT,
username:USER,
accessKey:KEY
});
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});
var error = function(msg, err) {
console.error(msg, err);
module.exports = function(port, cb) {
var browser = wd.remote('localhost', port);
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});
/*
* This test loads up Fil's homepage, checks that the title matches
* some standard expectation, clicks on a link labeled "CV" and
* expects that the address bar contains "cv.html".
*/
var error = function(msg, err) {
/*global describe:true, it:true */
"use strict";
var should = require('should')
, wd = require('wd')
, driver = wd.remote()
, driverSeries = require('../../lib/main');
describe("Series", function() {
it('should make this.next() available', function(done) {
driverSeries(driver, [
function() { (typeof this.next).should.equal("function"); this.next(); }
], done);
});
it('should make this.res available', function(done) {
driverSeries(driver, [
function() { (typeof this.res).should.not.equal("undefined"); this.next(); },
], done);
});
it('should put result of callback into this.res', function(done) {
var testGroup = options.testGroup,
groups,
browser,
tests,
desired,
failedTests = [],
skippedTests = [],
passedTests = [],
errorTests = [],
returnObject;
groups = JSON.parse(fs.readFileSync(path.join(options.dir, "groups.json"), "utf8"));
tests = testGroup in groups ? groups[testGroup] : groups["all"];
browser = new WebDriver.remote(options.host, options.port, options.username, options.password);
browser.setHTTPInactivityTimeout(options.timeout);
browser.on('status', function (info) {
options.verbose && console.log('\x1b[36m%s\x1b[0m', info);
});
browser.on('command', function (meth, path) {
options.verbose && console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path);
});
desired = options.desired;
global.browser = browser;
global.expect = expect;
global.should = should;
global.flow = flow;
global.SkipError = function (message) {
create: function(capabilities, callback) {
var client = wd.remote(url.parse(seleniumUrl));
client.init(capabilities, function(error, sessionId) {
this.clients[sessionId] = client;
if (typeof callback === 'function') {
callback(error, client, {
wd: wd
});
}
}.bind(this));
},
end: function(callback) {