redoc/protractor.conf.js

74 lines
2.3 KiB
JavaScript
Raw Normal View History

2016-01-15 23:34:28 +03:00
'use strict';
const loadJson = require('./tests/e2e/helpers').loadJson;
2016-01-17 01:36:23 +03:00
const travis = process.env.TRAVIS;
let config = {
2016-01-15 23:34:28 +03:00
specs: ['./tests/e2e/**/*.js'],
baseUrl: 'http://localhost:3000',
framework: 'jasmine2',
onPrepare: function() {
2016-01-16 00:22:11 +03:00
var SpecReporter = require('jasmine-spec-reporter');
// add jasmine spec reporter
jasmine.getEnv().addReporter(new SpecReporter({displaySpecDuration: true}));
2016-01-15 23:34:28 +03:00
// load APIs.guru list
2016-06-09 20:40:54 +03:00
return loadJson('https://api.apis.guru/v2/list.json').then((list) => {
2016-01-15 23:34:28 +03:00
global.apisGuruList = list;
2016-01-17 14:51:21 +03:00
return browser.getCapabilities().then(function (cap) {
2016-05-10 09:43:05 +03:00
browser.isIE = cap.browserName === 'internet explorer'
|| (cap.caps_ && cap.caps_.browserName === 'internet explorer')
2016-01-17 14:51:21 +03:00
});
2016-01-15 23:34:28 +03:00
});
},
2016-01-17 01:36:23 +03:00
//directConnect: true,
2016-01-15 23:34:28 +03:00
useAllAngular2AppRoots: true,
2016-01-17 21:56:05 +03:00
allScriptsTimeout: 180000,
2016-01-15 23:34:28 +03:00
jasmineNodeOpts: {
showTiming: true,
2016-01-16 00:22:11 +03:00
showColors: true,
2016-01-17 21:56:05 +03:00
defaultTimeoutInterval: 180000,
2016-01-16 00:22:11 +03:00
print: function() {}
2016-01-17 01:36:23 +03:00
},
2016-01-17 14:51:21 +03:00
multiCapabilities: [
{ browserName: 'chrome' },
2016-01-21 19:54:13 +03:00
{ browserName: 'firefox' }
2016-01-17 14:51:21 +03:00
]
};
if (travis) {
config.sauceUser = process.env.SAUCE_USERNAME;
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
config.sauceSeleniumAddres = 'localhost:4445/wd/hub';
config.multiCapabilities = [{
2016-01-17 01:36:23 +03:00
browserName: 'chrome',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
2016-01-17 02:15:16 +03:00
build: process.env.TRAVIS_BUILD_NUMBER,
name: 'Redoc Chrome/Linux build ' + process.env.TRAVIS_BUILD_NUMBER
},{
browserName: 'safari',
platform: 'OS X 10.11',
version: '9.0',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
2016-01-17 20:34:16 +03:00
name: 'Redoc Safari Latest/OSX build ' + process.env.TRAVIS_BUILD_NUMBER,
2016-07-17 18:07:12 +03:00
idleTimeout: 180,
2016-07-17 18:24:01 +03:00
maxDuration: 1800*2
2016-01-17 02:15:16 +03:00
},{
browserName: 'firefox',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
2016-07-17 18:07:12 +03:00
name: 'Redoc Firefox Latest/Win build ' + process.env.TRAVIS_BUILD_NUMBER,
2016-07-17 18:24:01 +03:00
maxDuration: 1800*2
2016-01-17 02:15:16 +03:00
},{
browserName: 'internet explorer',
version: '11.0',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
2016-07-17 18:07:12 +03:00
name: 'Redoc IE11/Win build ' + process.env.TRAVIS_BUILD_NUMBER,
2016-07-17 18:24:01 +03:00
maxDuration: 1800*2
2016-01-17 14:51:21 +03:00
}];
2016-01-17 01:36:23 +03:00
} else {
config.directConnect = true;
}
exports.config = config;