How to use the wd.Q 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 ustwo / ustwo.com-frontend / test / integration / sanity.js View on Github external
'use strict';

import wd from 'wd';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
const Q = wd.Q;

chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

// WebDriver browser instance
let browser;

// browser capabilities
// TODO: we should check Android later, seems currently (November 2015) Sauce
// Labs is having some problems with launching Android emulator fast enough or
// supporting setting a timeout long enough so that we don't intermittently
// get failing tests
const desireds = {
  firefox: {
    browserName: 'firefox',
github appium / appium / sample-code / examples / node / sauce-android-mocha-wd-notes.js View on Github external
/*global it:true, describe:true, before:true, after:true */

"use strict";

/* 
  1/ Set your sauce credentials (SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables)
  2/ npm install mocha -g;
  3/ Run: 
    mocha -R spec sauce-android-mocha-wd-notes.js 
*/

var wd = require("wd"),
    Q = wd.Q;

require('colors');
var chai = require("chai"),
    chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

var host = "ondemand.saucelabs.com",
    port = 80,
    username = process.env.SAUCE_USERNAME,
    accessKey = process.env.SAUCE_ACCESS_KEY;

// Big timeout is needed
var timeout = process.env.TIMEOUT || 300000;
github appium / appium / sample-code / examples / node / sauce-connect-ios-mocha-wd-raw.js View on Github external
/*global it:true, describe:true, before:true, after:true */

"use strict";

/* 
  1/ Set your sauce credentials (SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables)
  2/ npm install mocha -g;
  3/ Start Sauce Connect
  4/ Run: 
    mocha -R spec sauce-connect-ios-mocha-wd-raw.js 
*/

var wd = require("wd"),
    Q = wd.Q,
    _ = require('underscore');

require('colors');
var chai = require("chai"),
    chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

var staticServer = require('node-static'),
    path = require("path"),
    http = require('http'),
    assetDir = path.resolve(__dirname, "../../../assets"),
    fileServer = new staticServer.Server(assetDir);

// create a local server to host our app
github appium / appium / sample-code / examples / node / sauce-ios-mocha-raw.js View on Github external
/*global it:true, describe:true, before:true, after:true */

"use strict";

/* 
  1/ Set your sauce credentials (SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables)
  2/ npm install mocha -g;
  3/ Run: 
    mocha -R spec sauce-ios-mocha-raw.js 
*/

var wd = require("wd");
var Q = wd.Q;
var _ = require('underscore');

require('colors');
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

var host = "ondemand.saucelabs.com",
    port = 80,
    username = process.env.SAUCE_USERNAME,
    accessKey = process.env.SAUCE_ACCESS_KEY;

// Big timeout is needed
var timeout = process.env.TIMEOUT || 300000;
github appium / appium / test / helpers / driverblock.js View on Github external
d.run(function() {
      test(done);
    });
  });
};


module.exports.block = driverBlock;
module.exports.describe = describeWithDriver;
module.exports.describeForApp = describeForApp;
module.exports.describeForSauce = describeForSauce;
module.exports.describeForSafari = describeForSafari;
module.exports.describeForSettings = describeForSettings;
module.exports.describeForIWebView = describeForIWebView;
module.exports.describeForChrome = describeForChrome;
module.exports.Q = wd.Q;
github jlipps / yiewd / lib / yiewd.js View on Github external
"use strict";
var wd = require("wd")
  , Q = wd.Q
  , monocle = require("monocle-js")
  , SauceLabs = require('saucelabs')
  , apsc = function(obj) { return Array.prototype.slice.call(obj, 0); };

var yiewd = module.exports = {};

wd.addPromiseChainMethod('reportStatus', function(passed) {
  if (this._yiewd_sauce === null) {
    throw new Error("Status reporting is for Sauce Labs tests");
  }
  return Q.nfcall( this._yiewd_sauce.updateJob.bind(this._yiewd_sauce),
    this.sessionID , {passed: passed});
});

wd.addPromiseChainMethod('reportPass', function() {
  return this.reportStatus(true);