This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request prebid#159 from CRAFT/feature/PLMP-261-test-saucelabs
Feature/PLMP-261 running unit test on saucelabs
- Loading branch information
Showing
6 changed files
with
690 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"sl_chrome": { | ||
"base": "SauceLabs", | ||
"browserName": "chrome" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
const webpackConfig = require('./webpack.conf'); | ||
const browsers = require('./browsers.saucelabs'); | ||
|
||
const BROWSER_TIMEOUTS = { | ||
DISCONNECT: 10000, | ||
NO_ACTIVITY: 240000 | ||
}; | ||
|
||
const BROWSER_DISCONNECT_TOLERANCE = 1; | ||
|
||
module.exports = { | ||
generateDefaultConfig () { | ||
return { | ||
basePath: './', | ||
|
||
webpack: Object.assign(webpackConfig, { | ||
plugins: [] | ||
}), | ||
webpackMiddleware: { | ||
noInfo: true | ||
}, | ||
|
||
files: ['test/test_index.js'], | ||
frameworks: ['es5-shim', 'mocha', 'chai', 'sinon'], | ||
preprocessors: { | ||
'test/test_index.js': ['webpack', 'sourcemap'] | ||
}, | ||
|
||
singleRun: true, | ||
reporters: ['mocha'], | ||
browsers: ['ChromeHeadless'], | ||
|
||
plugins: [ | ||
'karma-chrome-launcher', | ||
'karma-coverage-istanbul-reporter', | ||
'karma-es5-shim', | ||
'karma-mocha', | ||
'karma-chai', | ||
'karma-requirejs', | ||
'karma-sinon', | ||
'karma-sourcemap-loader', | ||
'karma-spec-reporter', | ||
'karma-junit-reporter', | ||
'karma-webpack', | ||
'karma-mocha-reporter' | ||
], | ||
|
||
browserDisconnectTimeout:BROWSER_TIMEOUTS.DISCONNECT, | ||
browserNoActivityTimeout: BROWSER_TIMEOUTS.NO_ACTIVITY, | ||
captureTimeout: BROWSER_TIMEOUTS.NO_ACTIVITY, | ||
|
||
browserDisconnectTolerance: BROWSER_DISCONNECT_TOLERANCE | ||
} | ||
}, | ||
|
||
generateSaucelabsConfig() { | ||
let baseConfig = this.generateDefaultConfig(); | ||
|
||
return Object.assign(baseConfig, { | ||
sauceLabs: { | ||
testName: 'Prebid unit tests' | ||
}, | ||
|
||
customLaunchers: browsers, | ||
browsers: Object.keys(browsers), | ||
|
||
reporters: baseConfig.reporters.concat(['saucelabs']), | ||
|
||
plugins: baseConfig.plugins.concat(['karma-sauce-launcher']) | ||
}); | ||
} | ||
}; |
Oops, something went wrong.