Rather than specifying the username and encrypted
key in the Travis config, we just enable Sauce Connect
and require SAUCE_USERNAME and SAUCE_ACCESS_KEY env vars
to be set.
This is so that the Karma tests have the same env vars
available to them which they can use to check whether
to run against Sauce Labs or not.
For some Karma tests, we can run them faster by running
against a local browser in the Travis CI instance rather
than Sauce Labs.
This is also useful for:
- Contributors wishing to run
the Travis tests against their own forks and have not
set up Sauce Labs credentials.
- Running Karma tests against Pull Request builds where
Sauce Connect is not available.
* Provide a fallback mode in the Karma tests which tests
against a local browser (defaults to Firefox) if Sauce Labs
credentials are not set.
This is useful for local testing for contributors who
might not have a Sauce Labs account.
* Add Safari under OS X to the set of Sauce Labs browsers
that the Karma tests are run against, following the merge
of the WombatJS fixes for Safari and Edge.
Although Edge now works under manual testing, automated
testing against Sauce Labs is not yet working for reasons
yet to be determined.
Detect in the test whether overriding of DOM properties
is supported in the current environment and skip testing
for the baseURI override in that case.
In Safari 9, Object.getOwnPropertyDescriptor(domObject.prototype, prop)
returns descriptors which have the correct structure but undefined
getters and are marked as unconfigurable.
See https://bugs.webkit.org/show_bug.cgi?id=49739#c19
for details. The getters cannot be retrieved via obj.__lookupGetter__()
either.
* Resolve the issue by skipping overrides for DOM properties
where the property is not configurable, or the original getter for
a property could not be retrieved.
* Lookup the 'baseURI' property on the correct prototype (Node,
not document)
This fix also resolves the problem where accesses to document.baseURI
on Edge would fail.
Existing JS files in this repo use Python-esque spacing
and naming conventions (4 spaces, snake_cased) rather than
JS conventions (2 spaces, camelCased).
This gives us the capability to test the client-side JS
rewriting against a suite of different browsers on different
platforms.
Note that getting Karma running on Travis CI requires some
additional configuration documented at
github.com/karma-runner/karma-sauce-launcher/issues/73
which is not made clear in the original documentation.
In order to run the Karma tests, the Sauce Labs username
and access keys need to be passed in via the SAUCE_USERNAME
and SAUCE_ACCESS_KEYS env vars.
* Add a Karma configuration for unit/integration tests
for the client-side pywb code.
* Add an integration test suite which creates an <iframe> loads
the client-side rewriting code (wombat.js) in it and
then executes a test script.
Since wombat.js monkey-patches the DOM and the exact behavior
of DOM objects varies between browsers, which we want to test,
the suite does not mock the DOM but instead runs
a set of tests in an isolated environment against
the DOM.
* Add Travis config to run the Karma tests
the value fo collinfo.json template. Default template returns an entry for each handler route,
including the route path (id), title (name) and memento timegate and timemap paths, to be used with
an aggregator. Using a custom 'info_json' template can specify a different collinfo template, alternative to #69 (local aggregation)
Closes#146
proxy_ip_resolver: add option to use RedisCache if redis_cache_key set in config
proxy_ip_resolver: add 'delete' option to delete ip from cache, closes#145
the scheme of the current page.
url-rewrite-only mode: add uo_ mod and use that to rewrite only urls (no banner, no client side rewrite)
addresses #142