How to use the wd.remote function in wd

To help you get started, we’ve selected a few wd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / geotrigger-editor / features / support / world.js View on Github external
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();
  });
};
github filmaj / appium-test / tests / android-selendroid-web.js View on Github external
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
github filmaj / appium-test / tests / sauce-hybrid.js View on Github external
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) {
github filmaj / appium-test / tests / sauce-stock.js View on Github external
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) {
github filmaj / appium-test / tests / android-selendroid.js View on Github external
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",
github filmaj / appium-test / tests / sauce-chrome-sc.js View on Github external
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);
github filmaj / appium-test / tests / android-chrome.js View on Github external
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) {
github jlipps / wd-series / test / unit / unit.js View on Github external
/*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) {
github rappid / rAppid.js / lib / WebTestRunner.js View on Github external
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) {
github uxebu / kommando / src / client / wd.js View on Github external
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) {