derby-webdriverio
Version:
Webdriver.io for Derby.js
79 lines (73 loc) • 2.37 kB
JavaScript
// Generated by CoffeeScript 1.12.7
(function() {
var defaults, defaultsDeep, webdriverDefaultConf;
webdriverDefaultConf = require('./webdriver.default');
defaults = require('lodash/defaults');
defaultsDeep = require('lodash/defaultsDeep');
module.exports = function(customConfig) {
var SS_HOST, SS_PATH, SS_PORT, TRAVIS, base, base1, base2, config, e, hasCoffee, ref, ref1;
ref = process.env, TRAVIS = ref.TRAVIS, SS_HOST = ref.SS_HOST, SS_PORT = ref.SS_PORT, SS_PATH = ref.SS_PATH;
config = defaults({}, customConfig, webdriverDefaultConf, {
specs: ['./test/e2e/**/*.js', './test/e2e/**/*.coffee'],
exclude: ['./test/e2e/**/_*.js', './test/e2e/**/_*.coffee'],
capabilities: {}
});
if (config.server == null) {
config.server = {};
}
defaultsDeep(config.server, {
startCommand: 'npm start',
env: {
MONGO_URL: 'mongodb://localhost:27017/test',
PORT: ((ref1 = config.baseUrl.match(/:(\d+)/)) != null ? ref1[1] : void 0) || 80
},
waitServer: {
timeout: 10 * 1000,
interval: 800,
print: true,
req: config.baseUrl
}
});
hasCoffee = true;
try {
require.resolve('coffee-script');
} catch (error) {
e = error;
hasCoffee = false;
}
defaults(config, {
framework: 'mocha',
reporter: 'spec',
mochaOpts: {
ui: 'bdd',
compilers: hasCoffee ? ['coffee:coffee-script/register'] : void 0,
timeout: config.waitforTimeout,
bail: true
}
});
if (TRAVIS) {
if ((base = config.desiredCapabilities).chromeOptions == null) {
base.chromeOptions = {};
}
if ((base1 = config.desiredCapabilities.chromeOptions).args == null) {
base1.args = ['no-sandbox'];
}
if ((base2 = config.desiredCapabilities.chromeOptions).binary == null) {
base2.binary = '/usr/bin/chromium-browser';
}
config.desiredCapabilities.firefox_binary = '/usr/local/bin/firefox';
}
if (SS_HOST) {
config.host = SS_HOST;
}
if (SS_PORT) {
config.port = SS_PORT;
}
if (SS_PATH) {
config.path = SS_PATH;
}
config.before = require('./lib/before')(config, config.before);
config.after = require('./lib/after')(config, config.after);
return config;
};
}).call(this);