Protractor v1.7.0 Release Notes

  • ⬆️ Dependency Version Upgrades

    • (2658865) feat(webdriver): bump chromedriver to 2.14

    Chromedriver 2.14 contains support for accessing elements inside the shadow DOM.

    🔋 Features

    • (d220ecf) feat(locators): add by.deepCss selector for finding elements in the shadow dom

    Usage:

      element(by.deepCss('.foo'))
      equivalent to 'element(by.css('* /deep/ .foo'))
    
    • (324f69d) feat(locators): add by.exactRepeater

    • (eb9d567) feat(frameworks): add support for custom frameworks

    Usage:

      exports.config = {
        framework: 'custom',
        frameworkPath: '/path/to/your/framework/index.js'
      }
    
    • (9bc1c53) feat(expectedConditions): add helper library for syncing with non-angular apps

    Usage:

      var EC = protractor.ExpectedConditions;
      var button = $('#xyz');
      var isClickable = EC.elementToBeClickable(button);
    
      browser.get(URL); browser.wait(isClickable, 5000); //wait for an element to become clickable
      button.click();
    

    You can also customize the conditions:

      var urlChanged = function() {
        return browser.getCurrentUrl().then(function(url) {
          return url != 'http://www.angularjs.org';
        });
      };
    
      // condition to wait for url to change, title to contain 'foo', and $('abc') element to contain text 'bar'
      var condition = EC.and(urlChanged, EC.titleContains('foo'),
          EC.textToBePresentInElement($('abc'), 'bar'));
      $('navButton').click(); browser.wait(condition, 5000); //wait for condition to be true.
      // do other things
    
    • (fb099de) feat(elementExplorer): Combine browser.pause with elementExplorer

      • reuse logic for browser.pause for elementExplorer
      • introduce browser.enterRepl
      • allow customization of driver for elementExplorer
      • fix bug where repl cannot return an ElementFinder (related #1600)

      Closes #1314, #1315

    • (9def5e0) feat(runner): add browser.getProcessedConfig method

    Now, instances of the browser object have a getProcessedConfig method which returns a promise that resolves to the current Protractor configuration object for the current runner instance. This means that if multiCapabilities are being used or tests are sharded, getProcessedConfig will return an object with the capabilities and specs property specific to the current instance.

    Closes #1724

    🐛 Bug Fixes

    • (ccb165d) fix(webdriver-manager): unzipping chromedriver should override old version

    See #1813