redoc/protractor.conf.js

71 lines
2.2 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
return loadJson('https://apis-guru.github.io/api-models/api/v1/list.json').then((list) => {
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,
idleTimeout: 180
2016-01-17 02:15:16 +03:00
},{
browserName: 'firefox',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
name: 'Redoc Firefox Latest/Win build ' + process.env.TRAVIS_BUILD_NUMBER
},{
browserName: 'internet explorer',
version: '11.0',
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
2016-01-17 14:51:21 +03:00
name: 'Redoc IE11/Win build ' + process.env.TRAVIS_BUILD_NUMBER
}];
2016-01-17 01:36:23 +03:00
} else {
config.directConnect = true;
}
exports.config = config;