2.0.0
Release overview
- Replaced WD.js with Leadfoot
- Replaced sauce-connect-launcher with Dig Dug
- CommonJS code coverage
- Improved stack traces
- Improved documentation
- 55% faster proxy performance
- 25% faster installation
- Everything is wonderful
Special thanks to @liucougar and @jason0x43 for their code contributions, to @sethenmaleno and @msssk for their documentation contributions, to @vladikoff, @SlexAxton, and @owiber for their assistance in testing and reporting, and to @daleeidd, @bitpshr, and @chrisfosterelli for their bug reports which were addressed in this release.
Backwards-incompatible changes
WD.js replaced with Leadfoot
The WebDriver library used by Intern has changed from WD.js to Leadfoot. This new library, developed by SitePen for Intern 2, provides a much more stable and robust experience when compared to WD.js. Adding new functionality is easier, the method names match more closely the current draft WebDriver specification, and many bugs and defects in various WebDriver server implementations are worked around which should provide a much more consistent experience when developing tests for different browsers.
We have attempted to minimize the amount of work that you need to do to transition from Intern 1 to Intern 2 by introducing a compatibility shim for the WD.js APIs that were exposed by Intern 1. You will see deprecation warnings when using these methods until you update all of your test code to use the new Leadfoot APIs. Unfortunately, some changes that are not fully backwards-compatible had to be introduced in order to provide a more consistent and future-proof experience:
Command serialisation changes
In Intern 1, the following code would navigate the browser, then get an element, then get the text of the element:
this.remote.get('http://example.com');
this.remote.elementByTagName('h1');
this.remote.text();
In Intern 2, this code will execute the navigation, retrieval of the element, and retrieval of text in parallel, since each command is actually independent. The following code will execute serially in both Intern 1 and Intern 2, and is the correct way to write a command chain:
this.remote.get('http://example.com')
.elementByTagName('h1')
.text();
Removed & incompatibly modified commands
A few commands that were formerly exposed by WD.js have not been reimplemented on the new Command interface. These commands are stubbed to send deprecation warnings to the reporting system and continue, but will otherwise be no-ops. The removed commands, with rationale:
init
: Session initialisation now occurs from within the Server object when calling Server#createSession, and was always completed before any user tests executed in previous versions of Intern, so this method should never have been used by end-user code.setHTTPInactivityTimeout
: When a test times out, any outstanding HTTP requests will be aborted, so there should be no reason to need an independent timeout for the network layer.uploadFile
: This functionality used an undocumented WebDriver endpoint that could be changed or removed at any time. Only documented endpoints are used by Leadfoot to avoid exposing users to significant potential failure points.sauceJobUpdate
&sauceJobStatus
: The APIs to make changes to job state through a hosted provider do not interact through the WebDriver port and should not be part of the exposed API for sending WebDriver commands. The REST API commands for setting job state with tunnel providers is now atintern.tunnel#sendJobState
. See the Dig Dug documentation for details on this API.reset
: Resetting commands should no longer be necessary since each command method call now generates an independent object instead of returning the previous command object.
Only one method, getAttribute
, has changed incompatibly from the previous version. The WebDriver specification defines this method in such a way that it will sometimes retrieve properties instead of attributes. This has been known to be a Bad Idea for quite a long while (jQuery 1.6 broke backwards-compatibility in order to fix their own attr
API that did this), so this method has been changed in Intern 2 to always retrieve only DOM attributes. A companion method getProperty
retrieves DOM properties. The bad spec method still exists and can be accessed by calling getSpecAttribute
, but this is strongly discouraged during normal use.
Changes to errors
Errors in Leadfoot correctly report the type of error reported by the remote environment on error.name
. error.message
is now different and includes all of the actual error information reported by the server. Additional properties are also available on returned error objects; see the Leadfoot WebDriverError documentation for more details.
sauce-connect-launcher replaced with Dig Dug
Tunnel and WebDriver URL configuration
The useSauceConnect
and webdriver
configuration options have been replaced with tunnel configuration:
Intern 1 | Intern 2 |
---|---|
useSauceConnect: true |
tunnel: 'SauceLabsTunnel' |
useSauceConnect: false |
tunnel: 'NullTunnel' |
webdriver.host |
tunnelOptions.hostname |
webdriver.port |
tunnelOptions.port |
webdriver.username |
tunnel-specific |
webdriver.accessKey |
tunnel-specific |
Note that in most cases you should not need to set tunnelOptions.hostname
or tunnelOptions.port
, as these values are provided automatically. Only set these options if you need to override the default values of the tunnel provider being used.
Enhancements
- CommonJS modules will now be instrumented for code coverage. (#182, #200)
- Stack traces for instrumented and transpiled code will now point to the correct original line numbers. (#153, #198)
- Proxy performance when serving static files has been improved. (#208)
- A new combined reporter has been added to the bundled set of reporters. This reporter allows code coverage reports to be combined from a Node.js client run + a test runner run.
- BrowserStack is now supported as a cloud hosted VM provider.
- TestingBot is now supported as a cloud hosted VM provider.
- Chai as Promised is now supported when writing functional tests.
Bug fixes
- Code instrumentation will now exclude any files loaded from outside
baseUrl
/basePath
. This prevents globally installed dependencies from being inappropriately included in code coverage analysis on Node.js. (d5f69ca) - 404 responses are now transmitted by the Intern proxy with padding data to prevent IE9 from redirecting to an IE-internal error page URL, which would break tests that did not expect the URL to change. (6f54085)
- All
console.log
statements have been moved into reporters. This makes it possible to write custom reporters that output to stdout or stderr without breaking due to superfluous output from Intern. (3b3cc0c) - Because of the way that npm installs dependencies, users installing Intern for a project that uses the same Dojo or Chai versions that come with Intern, or on a machine where these packages are installed globally, will cause them to be deduplicated in a higher directory. This will cause these dependencies to fail to load when using the browser client directly to run tests. In order to address this, when Intern is installed, symlinks to these packages will be created. (e936070)
- Absolute file paths on Windows are no longer incorrectly treated as URLs with a single-letter schema by the path-to-URL conversion code. (a5b3a3d)
Install from npm
Regular edition
|
or |
Geezer edition
|