Protractor v1.4.0 Release Notes

  • 🔋 Features

    • (adef9b2) feat(runner): add a new method of getting browser drivers - directConnect

    directConnect as an option on the configuration will replace chromeOnly. Now, WebDriverJS allows Firefox to be used directly as well, so directConnect will work for Chrome and Firefox, and throw an error if another browser is used.

    This change deprecates but does not remove the chromeOnly option.

    • (0626963) feat(config): Option to exclude test for specific capability

    Add the option to exclude spec files for a specific capability. This way you can ignore spec files for one capability only. For example if the test is known to fail in the capability.

    Closes #1230

    • (710cad7) feat(runner/frameworks): Change interface contract of the protractor runner instance so that it returns a promise instead of calling a callback function

    • (50f44f4) feat(protractor): add clone methods for ElementFinder and ElementArrayFinder

    • (eedf50b) feat(launcher): add beforeLaunch and afterLaunch

    • (8dd60b7) feat(protractor): wrap negative indices for ElementArrayFinder.get(i)

    Closes #1213

    • (be236e7) feat(debugging): use custom messages when executing scripts to improve stack traces

    Now, instead of asynchronous events during executeScript all being described as WebDriver.executeScript, they have their own custom messages. The schedule shown when debugging will be more informative.

    ⬆️ Dependency Version Upgrades

    • (889a5a7) feat(webdriver): version bumps for webdriver, chromedriver, webdriverJS

    Upgrade to WebDriver 2.44.0 and ChromeDriver 2.12.

    🐛 Bug Fixes

    • (2fbaf52) fix(element): use the root element only to find the testability API, not scope searches

    In 9a8f45a a change was introduced which made Protractor's custom locators (by.binding, by.model, etc) use config.rootElement as the root for all their searches. This meant that config.rootElement was used both to specify how to get hold of Angular's injector as well as where to begin searching for elements. This does not work for all cases, for example if a dialog should be searched for elements but is a sibling, not a child, of ng-app.

    This reverts that change, and uses document as the parent for all searches. This is consistent with the behavior of the native locators by.id, by.css, and friends, which do not scope their search based on config.rootElement.

    • (9db5327) fix(ElementFinder): ElementFinder should allow null as success handler. Passes the value to the next in the chain.

    • (0858280) fix(locators): by.cssContainingText now operates on pre-transformed text

    Previously, the implementation depended on the browser. Now, it will always operate on the text before text-transform is applied. Closes #1217

    • (1a4eea4) fix(elementexplorer): elementexplorer hangs when returning ElementFinder

    • (f4e6b40) fix(runner): webdriver could get into lock when there is async promise

    • (cf284b9) fix(clientsidescripts): by.exactBinding not working because of regex typo

    Closes #1441

    • (9cc0f63) fix(runner): gracefully shutdown browsers after test

    • (86ead2c) fix(webdriver-manager): Avoid incompatibility between request with callback and pipe.

    • (7283fdf) fix(launcher): exit code is always 100 for sharded and 1 for nonsharded tests