Skip to content

Releases: theintern/intern

2.0.0

29 Jun 01:20
Compare
Choose a tag to compare

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 at intern.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
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.7.0

05 May 03:13
Compare
Choose a tag to compare

Release overview

  • Preparation work for Intern 2.0
  • Better functional test error reporting
  • Updates to Sauce Connect and Istanbul
  • Enhancements to Object interface
  • Bug fixes

Backwards-incompatible changes

  • Unintentionally, boolean arguments passed on the command-line to the test runner which were sent to the unit testing client would be received as the string "true" or "false". This has been fixed; these arguments will now be received as boolean true if they were set, or undefined if they were not.
  • Istanbul has been updated to 0.2.7. This should not break any Intern code, but may break code that accessed Istanbul directly and relied on features that changed between Istanbul 0.1 and 0.2.
  • The test runner now performs code coverage of code loaded into the test runner, so additional exclusions may need to be added to excludeInstrumentation.

Enhancements

  • Error reporting has been significantly improved for functional tests. Now, instead of getting a garbage stack trace, you will receive a correct trace that points to the original method call, along with additional information on the method that failed. Significant additional improvements to functional test error reporting will be coming in the next release of Intern. (#178)
  • The Object interface has been enhanced to gain feature parity with the TDD/BDD interfaces when used for functional tests. A function can now be passed to the object interface which will be called once for each environment being tested. The return value of the function should a the normal test object definition. (#185)
  • The test runner now performs code coverage of code loaded into the test runner itself. This allows functional tests and other server-side code to be covered. (21db9da)
  • Istanbul has been updated to version 0.2.7. This update enables code coverage to be disabled by using /*istanbul ignore next*/, /*istanbul ignore if*/, and /istanbul ignore else/` comments. (49f76d5)
  • Code coverage reports are no longer output by the runner reporter when no code coverage data has been received. (#127)
  • Information about the current test mode is now exposed at intern.mode. This value will be "runner" for the test runner, or "client" for the client. (e3f0714)

Bug fixes

  • Chai has been updated to 1.9.1. This partially corrects an issue where stack traces were missing from thrown assertions. (a9e79cd)
  • Error names and messages are no longer double-logged when a stack trace is available. Really. (f8be54e)
  • Boolean arguments passed on the command-line to the test runner are now correctly passed as boolean arguments to the client-side unit test code. (88275c1)
  • A bad regular expression preventing correct loading of non-http(s) URLs has been corrected to allow all valid URL protocols. (f6dbb32)
  • sauce-connect-launcher has been updated to 0.4.2 to eliminate an information disclosure security vulnerability. (#179)
  • The test runner now exits with a non-zero exit code if Sauce Connect fails to establish a tunnel. (b49d8df)
  • Unit test code coverage data is no longer lost when the remote environment is navigated using something other than the PromisedWebDriver interface. (6fe5615)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.6.2

11 Apr 20:34
Compare
Choose a tag to compare

Release overview

  • Sauce Connect security update
  • Bug fixes

Enhancements

  • sauce-connect-launcher was updated to 0.4.0. This version uses Sauce Connect 4.1, which includes new Sauce Labs SSL certificates. (#175, #176)

Bug fixes

  • The test config is now always loaded from the proper location. (#174)
  • The remote runner no longer silently discards uncaught exceptions.
  • The setHeartbeatInterval WebDriver method is now chainable.
  • Error messages are no longer doubly logged.
  • The test proxy server will no longer try to read directories as if they were files.

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.6.1

08 Apr 12:44
Compare
Choose a tag to compare

Release overview

  • Roll back wd dependency

Bug fixes

  • The wd package has been reverted to version 0.2.2 due to undocumented changes to the waitForElement API in 0.2.3 that were discovered during last-minute testing. These changes cause some existing functional tests that use the waitForElement APIs to break. This dependency will be replaced in the future with a more stable library.

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.6.0

01 Apr 21:49
Compare
Choose a tag to compare

Release overview

  • Improved runtime configuration
  • Updates to Sauce Connect and WD.js
  • Bug fixes

Enhancements

Bug fixes

  • Specifying arrays as values in a Grunt task (for configuration properties like reporters and suites) has been fixed. (#164)
  • The Grunt task no longer discards existing environment variables when spawning Intern, so these remain accessible to Intern when running with Grunt. (#136)
  • Chained methods in the WebDriver wrapper no longer modify their reference to self when switching contexts. This fixes failures that were caused in certain scenarios when invoking context-specific methods that also returned new elements. (#161)
  • The WebDriver reporter now outputs some error data to the browser in IE9 and earlier instead of undefined. (9ad4964)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.5.0

03 Mar 16:49
Compare
Choose a tag to compare

Release overview

  • Improved support for mocking AMD dependencies
  • Out-of-the-box PhantomJS support
  • Improved remote debugging for test failures
  • Bug fixes

Enhancements

  • The de-facto standard require.undef function has been added to the Dojo 2 loader, making it possible to mock AMD dependencies from test modules using Intern’s default loader by undefining, mapping, and reloading dependencies. Additional improvements to simplify this process will be introduced in the future, but it is now at least possible to do it. (#47)
  • The standard version of Intern will now run inside a PhantomJS environment. However, please exercise caution here; if you don’t know the reasons why you shouldn’t use PhantomJS, you probably should not use PhantomJS. (#154)
  • A new leaveRemoteOpen command-line flag has been added. When specified, Intern won’t quit the test browser after tests have completed, so you can use it to manually inspect your browser state post-test. (#144)

Bug fixes

  • Testing will no longer break when intern-runner is executed from a different child directory than the configured baseUrl directory. (#139)
  • client.js will no longer fail when using alternative AMD loaders without setting NODE_PATH in the standard version of Intern. Node.js modules loaded with intern/dojo/node will also now use the same path resolution mechanism as real Node.js modules. Equivalent functionality will be introduced to the geezer version of Intern in a future release. (#147)
  • The Grunt task no longer incorrectly assumes that output from the test runner is received one line at a time. This caused additional incorrect reporting and highlighting of pass/fail messages. (#152)
  • Using promises without cancel methods will no longer cause failures of the test system when their associated tests time out. (#151)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.4.0

04 Feb 17:52
Compare
Choose a tag to compare

Release overview

  • New version of Chai
  • New code coverage reporters
  • New TeamCity reporter
  • Bug fixes

Enhancements

  • Chai has been updated to 1.9.0. (#84)
  • The main chai object is now returned when using intern/chai! as a dependency, enabling the use of Chai plugins with the built-in version of Chai. (#107)
  • Sauce Labs jobs will now have their pass/fail status set at the end of a run. (#112)
  • A new cobertura reporter has been added to generate Cobertura-compatible code coverage output. (#104)
  • A new lcovhtml reporter has been added to generate detailed code coverage reports. (#104)
  • A new teamcity reporter has been added to generate TeamCity-compatible test result output. (#125)

Bug fixes

  • The WebDriver wrapper no longer treats the waitForElement* and waitForVisible* methods as if they can use a context element. (#119)
  • The default loader's script element is no longer automatically removed when an alternate loader is used. Previously, Intern would remove the default loader’s element from a document when an alternate loader was specified. If the alternate loader attempted to inject scripts using the original loader’s element as a reference, it would fail. (#122)
  • Wrapped functions in Intern’s WebDriver wrapper are no longer permanently overridden when the context changes. Previously, changing to an element context via methods such as click would replace the wrapped method with its context-specific equivalent. This change would persist even after a context reset. (#126)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.3.2

25 Nov 06:01
Compare
Choose a tag to compare

Release overview

  • Bug fixes

Bug fixes

  • Relative loader baseUrl properties should now be correctly handled by the code instrumentation and proxy. (#108, #111)
  • The Grunt task was not able to execute properly due to changes in directory structure. This has been fixed. (#110)
  • Using RequireJS in the Node.js client is possible once again. (#115)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.3.1

08 Nov 23:41
Compare
Choose a tag to compare

Release overview

  • Regression fix

Bug fixes

  • The default baseUrl for client.html was incorrectly changed, which broke backwards-compatibility in an unintentional way. It has been changed back. (#105)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source

1.3.0

08 Nov 20:05
Compare
Choose a tag to compare

Release overview

  • Easy configuration of alternative AMD loaders
  • Easier command-line usage
  • More code coverage analysis and reporting
  • Improvements and bug fixes to suite beforeEach/afterEach methods
  • More reliable WebDriver connections
  • Grunt events
  • Many other bug fixes

Important, backwards-incompatible changes

  • The beforeEach and afterEach methods of all nested parent suites are now called before and after each test. Previously, only the beforeEach and afterEach methods of the nearest parent of the test would execute. (#67)
  • The way in which module paths are resolved has changed. Previously, paths were always relative to two directories above the Intern directory. Now, on the command-line, paths are relative to the current working directory. As part of this change, the baseUrl loader option can now be set to any arbitrary path, and Intern should be able to be installed to any location without any directory structure restrictions. (#89)
  • Configuration files can no longer be loaded from a cross-origin source in order to prevent XSS attacks on public installations of Intern. (87764c6)

Enhancements

  • The AMD loader used by intern-client is now configurable from within the Intern configuration file. This enables the use of alternative loaders like RequireJS without making any modifications to files that come with Intern. (#90)
  • Unit tests executed in Node.js with intern-client are now instrumented for code coverage analysis and reporting. (#5)
  • Grunt events are now fired when each test passes and fails. (#73)
  • Path resolution logic has been overhauled to be more robust. (#89)
  • New intern-client and intern-runner commands have been added so you do not need to run node directly. (#89)
  • Per-file code coverage information is now displayed by the console reporter. (#96)
  • Unhandled exception error reporting in HTML5 Living Standard browsers is now improved. (c03cbc0)
  • The wd dependency has been updated to 0.2.2, which includes support for Sauce Labs API calls. (#97)

Bug fixes

  • Robustness enhancements have been added to Sauce Connect connections to avoid test hangs due to tunnel collisions. (#4, #82)
  • The total number of tests are now calculated correctly in the test runner. (#86)
  • Bogus error messages generated when Sauce Connect is closed are now suppressed. (bermi/sauce-connect-launcher#12)
  • Calling remote.isEnabled() will no longer hang the test runner. (#75)
  • The stop method of a reporter is now actually called when all tests have finished executing. (#74)
  • executeAsync can now be passed functions. (#92)
  • Generated lcov.info files now use full paths to conform to the lcov spec. (#95)
  • Returning promises from a functional test’s remote.then callback will now cause the runner to wait until the promise is resolved before executing the next command. (#93)
  • Running tests against a pre-existing Sauce Connect tunnel (useSauceConnect: false) will now work if no tunnel-identifier is explicitly provided. (1c47182)
  • Non-spec-compliant zlib compression of responses has been removed. (8943bf4)

Install from npm

Regular edition
cd /my/project/root
npm install intern --save-dev
or Geezer edition
cd /my/project/root
npm install intern-geezer --save-dev

Download source