How to use the wd.transferPromiseness 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 gr2m / appcache-nanny / bin / test-browser.js View on Github external
tunnelIdentifier: tunnelId,
  name: tmp[1] + ' - ' + tunnelId,
  // timeouts
  // tunnelTimeout: 30 * 60 * 1000,
  // 'max-duration': 60 * 45,
  // 'command-timeout': 599,
  // 'idle-timeout': 599
};



chai.use(chaiAsPromised);
chai.should();

// enables chai assertion chaining
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

devServer.start(function() {
  if (client.runner === 'saucelabs') {
    startSauceConnect(startTest);
  } else {
    startSelenium(startTest);
  }
});

function startTest(browser, subProcess) {
  // optional extra logging
  // browser.on('status', function(info) {
  //   console.log(info.cyan);
  // });
  browser.on('command', function(eventType, command, response) {
    if (eventType === 'CALL') {
github wikipathways / pvjs / test / e2e / wikipathways.org.js View on Github external
var wd = require('wd')
  , imageDiff = require('image-diff')
  ;
require('colors');
var _ = require("lodash");
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");

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

// checking sauce credential
if(!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY){
    console.warn(
        '\nPlease configure your sauce credential:\n\n' +
        'export SAUCE_USERNAME=\n' +
        'export SAUCE_ACCESS_KEY=\n\n'
    );
    throw new Error("Missing sauce credentials");
}

// http configuration, not needed for simple runs
wd.configureHttp( {
    timeout: 60000,
    retryDelay: 15000,
    retries: 5
github Strider-CD / strider / test / runner.js View on Github external
var async = require('async');
var wd = require('wd');
var remote = JSON.parse(process.env.WEBDRIVER_REMOTE || '{"hostname":"localhost", "port":9515}');
var browsers = JSON.parse(process.env.BROWSERS || '[{"browserName":"chrome"}]' );
var strider = require('./strider');
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');

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

describe('Strider', function () {
  this.timeout(20000);

  // TESTS
  var tests = (
    process.env.TEST_SUITE ?
    [ './integration/'+process.env.TEST_SUITE+'.js' ] :
    [ './integration/build_page_test.js'
    , './integration/login_test.js'
    , './integration/global_admin_test.js'
    //, './integration/github_test.js'
    , './integration/branch_management_test.js'
  ]);

  wd.addPromiseChainMethod('rel', function (url, cb) {
github appium / appium / sample-code / examples / node / ios-wd-raw.js View on Github external
LOCAL APPIUM:
  node ios-wd-raw.js

APPIUM ON SAUCE LABS:
  1/ Set your sauce credentials (SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables)
  2/ SAUCE=1 node ios-wd-raw.js 
*/

var wd = require("wd");

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

var host, port, username, accessKey, desired;

var desired = {
    browserName: '',
    'appium-version': '1.0',
    platformName: 'iOS',
    platformVersion: '7.1',
    deviceName: 'iPhone Simulator',
    app: "http://appium.s3.amazonaws.com/TestApp6.0.app.zip",
    'device-orientation': 'portrait',
  };

if (process.env.SAUCE) {
  // Sauce Labs config
  host = "ondemand.saucelabs.com";
github appium / appium / sample-code / examples / node / sauce-ios-mocha-raw.js View on Github external
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;

var desired = {
  browserName: '',  
  'appium-version': '1.0',
  platformName: 'iOS',
  platformVersion: '7.1',
  deviceName: 'iPhone Simulator',
  app: 'http://appium.s3.amazonaws.com/TestApp6.0.app.zip',
github appium / appium / sample-code / examples / node / sauce-connect-ios-mocha-wd-raw.js View on Github external
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
var server = http.createServer(function(req, res) {
  req.addListener('end', function() {
    fileServer.serve(req, res);
  }).resume();
}).listen(8080);

var host = "localhost",
    port = 4445,
github appium / appium / sample-code / examples / node / local-ios-wd-hybrid.js View on Github external
"use strict";

/*
  run:
    node local-ios-wd-hybrid.js
*/


var wd = require("wd");

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

var desired = {
    device: 'iPhone Simulator',
    name: "Appium Hybrid App: with WD",
    platform:'Mac',
    app: "http://appium.s3.amazonaws.com/WebViewApp6.0.app.zip",
    // version: '6.0',
    browserName: '',
    newCommandTimeout: 60
};

// Instantiate a new browser session
var browser = wd.promiseChainRemote("localhost" , 4723);

// See whats going on
browser.on('status', function(info) {
github wikipathways / pvjs / test / e2e / dev.js View on Github external
var wd = require('wd')
  , imageDiff = require('image-diff')
  , colors = require('colors')
  , chai = require("chai")
  , chaiAsPromised = require("chai-as-promised")
  , expect = chai.expect
  ;

var desired = {"browserName": "phantomjs"};
desired.name = 'example with ' + desired.browserName;
desired.tags = ['dev-test'];

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


//global.selenium = selenium;
console.log('selenium in devTest in dev.js');
console.log(selenium);
console.log('process.env.SELENIUM_LAUNCHER_PORT in dev.js');
console.log(process.env.SELENIUM_LAUNCHER_PORT);

describe('Quick test for development', function() {
    var browser;
    var allPassed = true;
    before(function(done) {
        browser = wd.remote({
          hostname: '127.0.0.1',
            port: '4444' 
        }, 'promiseChain');
github nolanlawson / cordova-plugin-sqlite-2 / bin / test-appium.js View on Github external
var path = require('path');
var find = require('lodash.find');
var sauceConnectLauncher = require('sauce-connect-launcher');
var reporter = require('./test-reporter');
var request = require('request-promise');
var denodeify = require('denodeify');
var fs = require('fs');
var readFile = denodeify(fs.readFile);
var uuid = require('uuid');
var zlib = require('zlib');
var zip = zlib.createDeflate();
var zipdir = denodeify(require('zip-dir'));

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

var ANDROID_PATH = './test/platforms/android/build/outputs/apk/android-debug.apk';
var IOS_PATH = './test/platforms/ios/build/emulator/SQLitePlugin2.app';
var MAX_NUM_TRIES = 100;
var RETRY_TIMEOUT = 5000;
var WAIT_TIMEOUT = 3000;
var PLATFORM = process.env.PLATFORM || 'android';

var username = process.env.SAUCE_USERNAME;
var accessKey = process.env.SAUCE_ACCESS_KEY;

var app;
var desired;

function configureAndroid() {
  app = path.resolve(ANDROID_PATH);
github NativeScript / nativescript-dev-appium / appium-setup.js View on Github external
var wd = require("wd");
require('colors');
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
var should = chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

exports.should = should;