From 1997c4a18046304d8b879631841034c63e5a15ad Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 26 Nov 2015 16:56:23 +0000 Subject: [PATCH] Run Karma tests against Microsoft Edge * Increase the default timeouts to account for the relative slowness of setting up connections to remote browsers. * Change the URL into which Wombat JS is loaded for tests to be a valid URL. Under Microsoft Edge, the JS code in the page is not run if the URL fetch returns a 404. * Change assert.equal() implementation to avoid confusion due to Karma's reformatting of URLs in exception error messages. --- karma-tests/dummy.html | 9 +++++++++ karma-tests/karma.conf.js | 24 ++++++++++++------------ karma-tests/wombat.spec.js | 23 +++++++++++++++++------ 3 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 karma-tests/dummy.html diff --git a/karma-tests/dummy.html b/karma-tests/dummy.html new file mode 100644 index 00000000..52e695fa --- /dev/null +++ b/karma-tests/dummy.html @@ -0,0 +1,9 @@ + + + + + + diff --git a/karma-tests/karma.conf.js b/karma-tests/karma.conf.js index 2d482d5c..9972fac9 100644 --- a/karma-tests/karma.conf.js +++ b/karma-tests/karma.conf.js @@ -28,18 +28,10 @@ var sauceLaunchers = { version: '9.0', }, -/* Edge is currently broken in - pywb. - - See: https://github.com/ikreymer/pywb/issues/148 (Edge) - https://github.com/ikreymer/pywb/issues/147 (Safari) - - sl_edge: { base: 'SauceLabs', browserName: 'MicrosoftEdge', }, -*/ }; var localLaunchers = { @@ -73,6 +65,11 @@ module.exports = function(config) { included: false, served: true, }, + { + pattern: 'karma-tests/dummy.html', + included: false, + served: true, + }, 'karma-tests/*.spec.js', ], @@ -90,12 +87,15 @@ module.exports = function(config) { sauceLabs: sauceLabsConfig, - // use an extended timeout for capturing Sauce Labs - // browsers and waiting for activity - // in case the service is busy + // Set extended timeouts to account for the slowness + // in connecting to remote browsers (eg. when using + // Sauce Labs) + // + // See https://oligofren.wordpress.com/2014/05/27/running-karma-tests-on-browserstack/ captureTimeout: 3 * 60000, - browserNoActivityTimeout: 30 * 1000, + browserDisconnectTimeout: 10 * 1000, + browserDisconnectTolerance: 1, customLaunchers: customLaunchers, diff --git a/karma-tests/wombat.spec.js b/karma-tests/wombat.spec.js index 62fe9f72..fbb9b33d 100644 --- a/karma-tests/wombat.spec.js +++ b/karma-tests/wombat.spec.js @@ -1,4 +1,3 @@ -var WOMBAT_SRC = '../pywb/static/wombat.js'; var DEFAULT_TIMEOUT = 20000; // creates a new document in an