+++ /dev/null
-language: node_js
-sudo: false
-cache:
- directories:
- - node_modules
-node_js:
- - lts/*
-env:
- matrix:
- - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10'
-# FIXME Skip tests in Linux since Sauce Labs browser versions are ancient.
-# - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Linux'
- - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='OS X 10.11'
- - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='Windows 10'
-# - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='Linux'
- - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='OS X 10.11'
- - TEST_BROWSER_NAME='internet explorer' TEST_BROWSER_OS='Windows 10'
- - TEST_BROWSER_NAME='internet explorer' TEST_BROWSER_OS='Windows 7'
- - TEST_BROWSER_NAME=microsoftedge TEST_BROWSER_OS='Windows 10'
- - TEST_BROWSER_NAME=safari TEST_BROWSER_OS='OS X 10.13'
-before_script: npm install -g karma-cli
-addons:
- sauce_connect:
- username: "directxman12"
- jwt:
- secure: "d3ekMYslpn6R4f0ajtRMt9SUFmNGDiItHpqaXC5T4KI0KMEsxgvEOfJot5PiFFJWg1DSpJZH6oaW2UxGZ3duJLZrXIEd/JePY8a6NtT35BNgiDPgcp+eu2Bu3rhrSNg7/HEsD1ma+JeUTnv18Ai5oMFfCCQJx2J6osIxyl/ZVxA="
-stages:
-- lint
-- test
-- name: deploy
- if: tag is PRESENT
-jobs:
- include:
- - stage: lint
- env:
- addons:
- before_script:
- script: npm run lint
- -
- env:
- addons:
- before_script:
- script: git ls-tree --name-only -r HEAD | grep -E "[.](html|css)$" | xargs ./utils/validate
- - stage: deploy
- env:
- addons:
- script: skip
- before_script: skip
- deploy:
- provider: npm
- skip_cleanup: true
- email: ossman@cendio.se
- api_key:
- secure: "Qq2Mi9xQawO2zlAigzshzMu2QMHvu1IaN9l0ZIivE99wHJj7eS5f4miJ9wB+/mWRRgb3E8uj9ZRV24+Oc36drlBTU9sz+lHhH0uFMfAIseceK64wZV9sLAZm472fmPp2xdUeTCCqPaRy7g1XBqiJ0LyZvEFLsRijqcLjPBF+b8w="
- on:
- tags: true
- repo: novnc/noVNC
-
-
// Karma configuration
+// The Safari launcher is broken, so construct our own
+function SafariBrowser(id, baseBrowserDecorator, args) {
+ baseBrowserDecorator(this);
+
+ this._start = function(url) {
+ this._execCommand('/usr/bin/open', ['-W', '-n', '-a', 'Safari', url]);
+ }
+}
+
+SafariBrowser.prototype = {
+ name: 'Safari'
+}
+
module.exports = (config) => {
- const customLaunchers = {};
let browsers = [];
- let useSauce = false;
-
- // use Sauce when running on Travis
- if (process.env.TRAVIS_JOB_NUMBER) {
- useSauce = true;
- }
-
- if (useSauce && process.env.TEST_BROWSER_NAME && process.env.TEST_BROWSER_NAME != 'PhantomJS') {
- const names = process.env.TEST_BROWSER_NAME.split(',');
- const platforms = process.env.TEST_BROWSER_OS.split(',');
- const versions = process.env.TEST_BROWSER_VERSION
- ? process.env.TEST_BROWSER_VERSION.split(',')
- : [null];
-
- for (let i = 0; i < names.length; i++) {
- for (let j = 0; j < platforms.length; j++) {
- for (let k = 0; k < versions.length; k++) {
- let launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i];
- if (versions[k]) {
- launcher_name += '_' + versions[k];
- }
-
- customLaunchers[launcher_name] = {
- base: 'SauceLabs',
- browserName: names[i],
- platform: platforms[j],
- };
-
- if (versions[i]) {
- customLaunchers[launcher_name].version = versions[k];
- }
- }
- }
- }
- browsers = Object.keys(customLaunchers);
- } else {
- useSauce = false;
- //browsers = ['PhantomJS'];
- browsers = [];
+ if (process.env.TEST_BROWSER_NAME) {
+ browsers = process.env.TEST_BROWSER_NAME.split(',');
}
const my_conf = {
exclude: [
],
- customLaunchers: customLaunchers,
+ plugins: [
+ 'karma-*',
+ '@chiragrupani/karma-chromium-edge-launcher',
+ { 'launcher:Safari': [ 'type', SafariBrowser ] },
+ ],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
-
- // Increase timeout in case connection is slow/we run more browsers than possible
- // (we currently get 3 for free, and we try to run 7, so it can take a while)
- captureTimeout: 240000,
-
- // similarly to above
- browserNoActivityTimeout: 100000,
};
- if (useSauce) {
- my_conf.reporters.push('saucelabs');
- my_conf.captureTimeout = 0; // use SL timeout
- my_conf.sauceLabs = {
- testName: 'noVNC Tests (all)',
- startConnect: false,
- tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
- };
- }
-
config.set(my_conf);
};
"jsdom": "*",
"karma": "*",
"karma-mocha": "*",
+ "karma-chrome-launcher": "*",
+ "@chiragrupani/karma-chromium-edge-launcher": "*",
+ "karma-firefox-launcher": "*",
+ "karma-ie-launcher": "*",
"karma-mocha-reporter": "*",
- "karma-sauce-launcher": "*",
+ "karma-safari-launcher": "*",
+ "karma-script-launcher": "*",
"karma-sinon-chai": "*",
"mocha": "*",
"node-getopt": "*",