protractor
Version:
Webdriver E2E test wrapper for Angular.
1,222 lines (805 loc) • 106 kB
Markdown
# 2.2.0
## Breaking Changes
- If you use the plugin API, it has changed a lot. See
[`docs/plugins.md`](docs/plugins.md) for details. The good news is that it
is being taken out of beta, so it should be more stable in the future.
## Dependency Version Upgrades
- ([786ab05](https://github.com/angular/protractor/commit/786ab0541bff9b561b35dbbf0ffc1e9d4a788d10))
chore(dependencies): update request to 2.57
Closes #2205
## Features
- ([f2a11a7](https://github.com/angular/protractor/commit/f2a11a7369319edac0f1221a1c6ab0f9a2cc73eb))
feat(plugins): Changed and expanded the plugin API
* Changed the plugin API so that it is more uniform (see docs/plugins.md)
* Updated existing plugins to the new API
* Added the `onPageLoad` and `onPageSync` entry points for plugins for modifying `browser.get`
* Added the `waitForPromise` and `waitForCondition` entry points for plugins for modifying
`waitForAngular`
* Added tests
This closes #2126 and helps out @andresdominguez
- ([aded26b](https://github.com/angular/protractor/commit/aded26bc9ee6172d6f64361207f6a8b04da09b0d))
feat(webdriver-manager): update download logic with streaming
Also adds a content length check to make sure the downloaded binaries are the correct size. This
seems to fix up some unreliable download issues that we were previously having.
- ([7aeebd6](https://github.com/angular/protractor/commit/7aeebd6543d89b7d8b9474bc45651b88c5c2d396))
feat(plugins): reporting loaded plugins
- ([6c10378](https://github.com/angular/protractor/commit/6c10378b9a4e7cae9ba491a63ae11f942c833100))
feat(protractor): expose pending $http and $timeout on a timeout
Now when a test times out while waiting for Angular to be stable, pending
$timeout and $http tasks will be reported to the console.
## Bug Fixes
- ([c30afdd](https://github.com/angular/protractor/commit/c30afddb80b6138fc5f648f70f2891067d8eeef4))
fix(test): fixed tests under npm test
- ([3508335](https://github.com/angular/protractor/commit/3508335199fee5dad74c66d9ee19b8bf448c2e62))
fix(element): ElementArrayFinder.count was slow
The bug fix for #1903
(https://github.com/angular/protractor/commit/2a765c76e121de13ff86a279fe3f21cb15c17783) was
causing ElementArrayFinder.prototype.count to be slow because of the extranous checks that must be
performed. However, the checks could be delayed into the isPresent check, which will mitigate this
issue
fixes(#2359)
- ([b147033](https://github.com/angular/protractor/commit/b14703319c0d6bb6a69b76d0fd3732e2ea1fbebc))
fix(by.exactRepeater): should split by "="
Closes #2335
- ([4c9886b](https://github.com/angular/protractor/commit/4c9886b410ea4d82098af322044a37908a112138))
fix(Chrome Accessibility Plugin) No error context
If your tests fail because of StaleElementReferenceError then there is no context about where this
is coming from. By having the failure be handled inside of the plugin then grunt can fail
gracefully. Additionally, this provides context about where the error originated from.
Fixes #2331
- ([d15ccdc](https://github.com/angular/protractor/commit/d15ccdcf82bda29c803c3a5642896f16d7e4f938))
fix(phantomJS): Reset URL cannot be a data url for PhantomJS
When trying to use the lates version of Angular with PhantomJS we get a message complaining about
"Detected a page unload event". This was fixed in earlier versions of Angular, see issue #85, but
reappeared now. The problem is that using data urls to reset the page causes this issue, so we
have to do as we do with Safari and use "about:blank" instead
- ([e6369ac](https://github.com/angular/protractor/commit/e6369ac973d58a17415ab1211050af26236c6105))
docs(tutorial): use Jasmine v2 in the tutorial
- ([e60dc0f](https://github.com/angular/protractor/commit/e60dc0ff4fc4a6d22e877d4182605913fae5d5cb))
fix(browser.refresh): use timeout in milliseconds
When invoked without arguments browser.refresh used a 10-millisecond timeout, wrongly documented
as seconds. It now delegates timeout handling to browser.get, which defaults to
DEFAULT_GET_PAGE_TIMEOUT (10 seconds).
- ([0262268](https://github.com/angular/protractor/commit/0262268fa43b9eefac815d986740efa07bb15818))
fix(cucumber): fix beforeFeature event handler call guard
Fixes the run failures reported in https://github.com/cucumber/cucumber-js/issues/342.
# 2.1.0
## Dependency Version Upgrades
- ([25b1fa0](https://github.com/angular/protractor/commit/25b1fa052c195f6f56adcd3f5a116cb5eac238b0))
feat(jasmine): update jasmine dependency to 2.3.1
Updated from 2.1.1. See Jasmine's changelog at
https://github.com/jasmine/jasmine/tree/master/release_notes
Closes #1795. Closes #2094. Closes #1768.
- ([25e3b86](https://github.com/angular/protractor/commit/25e3b8611f7333f0829aa3c315a0397891bbada7))
chore(chromedrivier): Update chromedriver to 2.15
## Features
- ([45341c9](https://github.com/angular/protractor/commit/45341c944bf60537849776c7f362ee0442b219e6))
feat(explorer): allow element explorer to start as a server
If element explorer is run with a port (i.e. --debuggerServerPort 1234), it will start up a server
that listens to command from the port instead of a repl that listens to process.stdin.
- ([cf9a26f](https://github.com/angular/protractor/commit/cf9a26f1b4bdca7d928794d24738786be074619a))
feat(plugins): allow plugins.postTest to know what test just ran
- ([0f80696](https://github.com/angular/protractor/commit/0f806964324cbeb4bceb54c5bd82c639b9f99a49))
feat(plugins): inline plugins
- ([de49969](https://github.com/angular/protractor/commit/de499696eb88721cb073a195025ae48f59cbc905))
feat(debugger): make element explorer work with node 0.12.0
Node has changed its debugger significantly in 0.12.0, and these changes are necessary to get it
to work now.
Specifically here are the key points to take note:
* Before, the process continues running after `process._debugProcess(pid);` is called, but now,
the process stops.
> To over come this, the call to `process._debugProcess(pid)` is moved from protractor into the
debugger client. Secondly, because the process stops after the call, we call `reqContinue` once
the debugger connection is established, so that protractor continues into the first break point
(for backwards compatibility, we added an extra empty webdriver command so that in earlier
versions of node, protractor doesn't go past the first break point from the reqContinue).
* Before repl provides '(foobar\n)' when an user inputs 'foobar'. Now it is just 'foobar\n'.
> We will parse and strip away both the parenthesis and '\n' to support all versions of node.
* Additionally (non-related to node 0.12.0), this change makes debugger processes fail fast if the
port is taken.
- ([7b96db0](https://github.com/angular/protractor/commit/7b96db0ffb06608b12aa14765133cce42a0cad7f))
feat(browser.get): Return a promise that handles errors in browser.get
## Bug Fixes
- ([815ff5d](https://github.com/angular/protractor/commit/815ff5d092c8dda88e2a1d4c5c80f66bf20892fa))
fix(jasmine2): be consistent about passing assertions in output JSON
See #2051
- ([e6e668c](https://github.com/angular/protractor/commit/e6e668c8d7353c8e797f730b30b996c6a6eb770f))
chore(jasmine): update jasminewd2 to 0.0.4
This improves the control flow schedule messages for debugging and fixes an issue with the `this`
variable inside tests. See https://github.com/angular/jasminewd/issues/22
- ([e599cf3](https://github.com/angular/protractor/commit/e599cf301d1ff0fe705b2362fa6b4b17859ab8da))
fix(taskscheduler): label sharded tasks with numbers instead of letters
Letters run into a problem with a maximum of 26. See #2042
- ([fda3236](https://github.com/angular/protractor/commit/fda323664db65a5c8f1590b9841fcfa53d4ab8fd))
fix(config): add sauceAgent property to protractor config
Closes #2040
- ([fa699b8](https://github.com/angular/protractor/commit/fa699b8f1a6b807f2405d6829609797a9a3f8768))
fix(debugger): fix 'getControlFlowText()' broken in webdriver 2.45
- ([b783dd8](https://github.com/angular/protractor/commit/b783dd865dfd16e5099a863d36d497499026b208))
fix(browser): remove subsequent duplicate module
browser.removeMockModule() misses next duplicate module because of iteration over an array it's
modifying.
- ([e3d4ad1](https://github.com/angular/protractor/commit/e3d4ad164a04451fce3a57f06121355343c97f48))
fix(stacktrace): remove jasmine2 specific stacktraces
- ([3cded9b](https://github.com/angular/protractor/commit/3cded9b8da247dc69c78a6fa0e25fe70f6c0f801))
fix(locators): escape query in byExactBinding
See http://stackoverflow.com/q/3561711
Closes #1918
- ([e18d499](https://github.com/angular/protractor/commit/e18d4990878d70f77b29e8678eecbaab7c8cefb5))
fix(cucumber): process no-snippets param for cucumber framework
# 2.0.0
_Why is this change version 2.0? Protractor is following semver, and there's some breaking changes here._
## Dependency Version Upgrades
- ([34f0eeb](https://github.com/angular/protractor/commit/34f0eebd7e73b10e9b990caa06b63b6fd22b2589))
fix(element): update to selenium-webdriver@2.45.1 and remove element.then
This change updates the version of WebDriverJS (selenium-webdriver node module) from 2.44 to
2.45.1. See the full changelog at
https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
- ([8976e75](https://github.com/angular/protractor/commit/8976e75dc1817817e6bd2dbb0b6cbc78d72035e9))
chore(jasmine): bump version of jasminewd2
## Features
- ([997937d](https://github.com/angular/protractor/commit/997937d189fb3a9fb51f1b2e4756981c8958ceba))
feat(console plugin): Added new console plugin
- ([ef6a09d](https://github.com/angular/protractor/commit/ef6a09d798fd04124224f6ca48eb64d13eb01eff))
feat(webdriver-manager): allow a custom cdn for binaries
Added a cdn value for each binary to be overrided by the cli argument
`alternate_cdn`.
## Bug Fixes
- ([fb92be6](https://github.com/angular/protractor/commit/fb92be6d588e7302989bd171a064739359bb3c74))
fix(accessibility): improve output for long elements
Instead of just printing the first N characters of the element's template, print the first and
last N/2.
See #1854
- ([2a765c7](https://github.com/angular/protractor/commit/2a765c76e121de13ff86a279fe3f21cb15c17783))
fix(element): return not present when an element disappears
- ([8a3412e](https://github.com/angular/protractor/commit/8a3412e98614bb69978869b34b5b7243619f015d))
fix(bug): by.buttonText() should not be effected by CSS style
Closes issue #1904
- ([5d23280](https://github.com/angular/protractor/commit/5d232807f1e32a9a3ba5a5e4f07ace5d535fc3cd))
fix(debugger): fix issue where output does not display circular dep and functions
- ([ef0fbc0](https://github.com/angular/protractor/commit/ef0fbc096035bb01d136897ca463892ceca56b73))
fix(debugger): expose require into debugger
## Breaking Changes
- ([34f0eeb](https://github.com/angular/protractor/commit/34f0eebd7e73b10e9b990caa06b63b6fd22b2589))
fix(element): update to selenium-webdriver@2.45.1 and remove element.then
This change updates the version of WebDriverJS (selenium-webdriver node module) from 2.44 to
2.45.1. See the full changelog at
https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
To enable the update and remove confusion, this removes the `element().then` function unless there
is an action result. This function is completely unnecessary, because it would always resolve to
itself, but the removal may cause breaking changes.
Before:
```js
element(by.css('foo')).then(function(el) {
return el.getText().then(...);
});
```
After:
```js
element(by.css('foo')).getText().then(...);
```
In other words, an ElementFinder is now no longer a promise until an action has been called.
Before:
```js
var el = element(by.css('foo'));
protractor.promise.isPromise(el); // true
protractor.promise.isPromise(el.click()); // true
```
After:
```js
var el = element(by.css('foo'));
protractor.promise.isPromise(el); // false
protractor.promise.isPromise(el.click()); // true
```
Also, fixes `filter` and `map` to work with the new WebDriverJS.
- ([3c04858](https://github.com/angular/protractor/commit/3c048585ac811726d6c6d493ed6d43f6a3570bee))
chore(config): remove deprecated `chromeOnly`
This has been replaced with `directConnect`.
- Due to ([1159612](https://github.com/angular/protractor/commit/1159612ed76bb65612dbb2cc648e45928a251b10))
Due to changes in how scheduling works on the control flow, specs
in Jasmine1 will no longer wait for multiple commands scheduled in `onPrepare`
or in the global space of the test file.
Before:
```js
onPrepare: function() {
browser.driver.manage().window().maximize();
// This second command will not finish before the specs start.
browser.get('http://juliemr.github.io/protractor-demo');
}
```
To fix, return the last promise from onPrepare:
After:
```js
onPrepare: function() {
browser.driver.manage().window().maximize();
return browser.get('http://juliemr.github.io/protractor-demo');
}
```
- Due to ([1159612](https://github.com/angular/protractor/commit/1159612ed76bb65612dbb2cc648e45928a251b10))
Due to changes in WebDriverJS, `wait` without a timeout will now default
to waiting for 0 ms instead of waiting indefinitely.
Before:
```js
browser.wait(fn); // would wait indefinitely
```
After
```js
browser.wait(fn, 8000) // to fix, add an explicit timeout
```
This will be reverted in the [next version of WebDriverJS](https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md#v2460-dev).
# 1.8.0
## Dependency Version Upgrades
- ([1159612](https://github.com/angular/protractor/commit/1159612ed76bb65612dbb2cc648e45928a251b10))
fix(webdriver): bump selenium to 2.45.0
Bump the selenium standalone binary to 2.45.0.
See https://code.google.com/p/selenium/source/browse/java/CHANGELOG for a full list of changes to
the selenium server.
Closes #1734
## Features
- ([54163dc](https://github.com/angular/protractor/commit/54163dcd22cee27cf16685fbb4d53a2712233d26))
feat(a11yPlugin): plugin for integrating with Chrome Accessibility Developer Tools
Also includes missing Angular map files. See plugins/accessibility/index.js for usage.
- ([658902b](https://github.com/angular/protractor/commit/658902bd04bf809bde2751db79e93ae00de2f810))
feat(plugins): add postTest hook for plugins
Additionally, add some tests to make sure that plugins can fail properly.
Closes #1842
- ([13d34c9](https://github.com/angular/protractor/commit/13d34c9192a06634827d89bf356bea33fea75747))
feat(a11yPlugin): add support for Tenon.io
- ([5f8cffd](https://github.com/angular/protractor/commit/5f8cffd95c50ab4e7949376425f10e13747eb922))
feat(plugins): allow plugins to export a name for use in reporting
## Bug Fixes
- ([aabdd56](https://github.com/angular/protractor/commit/aabdd567ee62d0d48fad499ee5decbb5d7d6b939))
fix(debugger): breakpoint isn't set properly for windows
- ([361ae21](https://github.com/angular/protractor/commit/361ae21ee761eb78d1e2c9b2b7d270873a28ef81))
fix(plugins): add a 'test' or 'fail' string to plugins
Closes #1843
- ([847e739](https://github.com/angular/protractor/commit/847e73961e52caa1537df269589d9cfe6373b986))
fix(webdriver-manager): unzipping ie driver should overwrite old version
# 1.7.0
## Dependency Version Upgrades
- ([2658865](https://github.com/angular/protractor/commit/2658865640d82617e69208cdb2263a2073a20156))
feat(webdriver): bump chromedriver to 2.14
Chromedriver 2.14 contains support for accessing elements inside the shadow DOM.
## Features
- ([d220ecf](https://github.com/angular/protractor/commit/d220ecf5ebc7ba023eab728d4a684e978ff77c83))
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](https://github.com/angular/protractor/commit/324f69d6aa7c23ad77f1d50e26e0a56bade40132))
feat(locators): add by.exactRepeater
- ([eb9d567](https://github.com/angular/protractor/commit/eb9d56755fa93401502e7608c7c3d0f16927c082))
feat(frameworks): add support for custom frameworks
Usage:
```js
exports.config = {
framework: 'custom',
frameworkPath: '/path/to/your/framework/index.js'
}
```
- ([9bc1c53](https://github.com/angular/protractor/commit/9bc1c53e40161521b0c125a810f86235c974f100))
feat(expectedConditions): add helper library for syncing with non-angular apps
Usage:
```javascript
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:
```javascript
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](https://github.com/angular/protractor/commit/fb099dedf92a64732d88401dd1b0d4d30b22650d))
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](https://github.com/angular/protractor/commit/9def5e0e67e031949010fed4ed47178a534c99e8))
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](https://github.com/angular/protractor/commit/ccb165d99b69e1ae66e4c1badd2f4e04f1481e75))
fix(webdriver-manager): unzipping chromedriver should override old version
See #1813
# 1.6.1
## Bug Fixes
- ([92c5d17](https://github.com/angular/protractor/commit/92c5d17844a2b4dc56c483ab4a65e2bf631175f9))
fix(element): test crashes when using certain locators with `fromWebElement_`
Protractor crashes when one uses locators with findElementsOverride (i.e. any custom protractor
locator like by.binding/repeater/etc) in map/filter/then/each/reduce
# 1.6.0
## Features
- ([1e60a95](https://github.com/angular/protractor/commit/1e60a9504c883a95f3500eafa38e1fc11dc28c9b))
feat(frameworks): add jasmine2 framework
Jasmine2.x may now be used by setting `framework: jasmine2` in your config.
See https://github.com/angular/protractor/blob/master/docs/jasmine-upgrade.md
- ([0b93003](https://github.com/angular/protractor/commit/0b930035905d1868225667de358222e51394f3ac))
feat(jasmine2): add 'grep' option to jasmine2
Allow users to filter the specs that they want to run using simple string match. To use this
feature, either: 1) specify jasmineNodeOpts.grep in your conf.js file
or 2) via commandline like "protractor conf.js --grep='pattern to match'"
- ([4368842](https://github.com/angular/protractor/commit/4368842da73d4ed501df21b61daf71951e59524b))
feat(wddebugger): enable repl (with autocomplete) for browser.pause
See https://github.com/angular/protractor/blob/master/docs/debugging.md for
usage.
- ([9c9ed31](https://github.com/angular/protractor/commit/9c9ed31591f5a3c552222ad7feb1ecd650973902))
feat(launcher): allow multicapabilities to take array of promises
Enables adding `getMultiCapabilities: function(){}` to your configuration file. The function
returns either multiCapabilities or a promise of a multiCapabilities that is resolved after
`afterLaunch` and before driver set up. If this is specified, both capabilities and
multiCapabilities will be ignored.
Also allows specifying `seleniumAddress` in the capabilities/multiCapabilities object, which will
override the global `seleniumAddress`. This allows you to use a different `seleniumAddress` per
capabilities.
Breaking Changes:
`capabilities` can no longer be a promise. Use getMultiCapabilities if you need to return a
promise.
`seleniumAddress` can no longer be a promise. Likewise, use getMultiCapabilities.
- ([1670384](https://github.com/angular/protractor/commit/167038499aacfd5def03472f9f548529b273e1e0))
feat(runner): allow protractor to restart browser between tests
Enables adding `restartBrowserBetweenTests: true` to your configuration file. Note that this will
slow down test suites considerably. Closes #1435
- ([56beb24](https://github.com/angular/protractor/commit/56beb24b9473ceedc491f3ca00fbce1bb9a18f29))
feat(protractor): add browser.getRegisteredMockModules()
Now `browser.getRegisteredMockModules()` returns a list of the functions or strings that have
been registered as mock modules. For troubleshooting.
Closes #1434.
- ([5a404c2](https://github.com/angular/protractor/commit/5a404c27326fdb130e5d4ac5c4704b4013c78853))
feat(timeline): add timeline plugin
This plugin gathers test timeline information from the protractor test process, the selenium
client logs (if available), and sauce labs (if available), and presents the output visually. This
improves understanding of where latency issues are in tests. See #674
Usage:
Add the plugin to your configuration file:
```js
exports.config = {
plugins: [{
path: 'node_modules/protractor/plugins/timeline/index.js',
// Output json and html will go in this folder.
outdir: 'timelines',
// Optional - if sauceUser and sauceKey are specified, logs from
// SauceLabs will also be parsed after test invocation.
sauceUser: 'Jane',
sauceKey: 'abcdefg'
}],
// other configuration settings
};
```
- ([a9d83f7](https://github.com/angular/protractor/commit/a9d83f7ebbce1be7f7f8c2986d1bfebccff1d6f3))
feat(plugins): add postResults hook for plugins
Allows plugins to include a postResults function, which will be called after webdriver has been
quit and the environment has been torn down. This step may not modify the contents of the test
results object.
## Dependency Version Upgrades
- ([2b4ac07](https://github.com/angular/protractor/commit/2b4ac07eaccafec2ad88c05747a75268a3529759))
feat(webdriver): version bumps for chromedriver and supported browsers
Chromedriver to 2.13. CI browser version bumps for Chrome 39 and Firefox 34.
## Bug Fixes
- ([adf30ba](https://github.com/angular/protractor/commit/adf30ba701d2a1ec992912001723de19366bea57))
fix(test): use a platform agnostic way to run minijasminenode
- ([50ee0b4](https://github.com/angular/protractor/commit/50ee0b4d1a1b93cedf3d099d349b937b25ee9e79))
fix(test): allow to run 'npm start' or 'npm test' from windows too
- ([b28355d](https://github.com/angular/protractor/commit/b28355dabde4c507ac620b973104e98e96279f2a))
fix(cucumber): emit on cucumber scenario instead of step
- ([33dcd77](https://github.com/angular/protractor/commit/33dcd777fe34c6682b64bda0adc4f3595b03394b))
fix(util): webdriver could deadlock
when prepare scripts containing promises are wrapped in a flow.execute
- ([a877268](https://github.com/angular/protractor/commit/a877268f35cb0df8f34f60b71ad7201fef58d189))
fix(locators): ng-repeat-start should not return extra null element
- ([d505249](https://github.com/angular/protractor/commit/d505249fff773d0eaee8b17435ab751be8fbefa6))
fix(waitforangular): improve error messages when waitForAngular fails
Previously, caught errors were being interpreted as an empty object, causing lots of errors such
as
'Uncaught exception: Error while waiting for Protractor to sync with the page: {}' Now the error
message will be displayed, and a more useful custom message will be thrown if the variable
'angular' is not present or the root element is not part of the ng-app.
See #1474
## Breaking Changes
- Due to ([9c9ed31](https://github.com/angular/protractor/commit/9c9ed31591f5a3c552222ad7feb1ecd650973902))
feat(launcher): allow multicapabilities to take array of promises
Breaking Changes:
`capabilities` can no longer be a promise. Use getMultiCapabilities if you need to return a
promise.
`seleniumAddress` can no longer be a promise. Likewise, use getMultiCapabilities.
Why is this breaking change not causing a major version bump? This feature was
not fully supported previously and we worked with all known users when making
the change.
# 1.5.0
## Features
- ([55a91ea](https://github.com/angular/protractor/commit/55a91ea137395891248db148df75dd6408c3b3a2))
feat(launcher): reorganize launcher + add option to store test results as JSON
You may now use `config.resultJsonOutputFile` to specify a location for
output. See docs/referenceConf.js for more usage.
- ([6a88642](https://github.com/angular/protractor/commit/6a886425a11b28fce83b6eec1f52296c4f78b7f0))
feat(plugins): basic tools for adding plugins
- ([2572feb](https://github.com/angular/protractor/commit/2572febe2c607d459a21e2ba99a1dcece2083d2d))
feat(plugin): ngHint plugin
For information on usage, see `plugins/ngHintPlugin.js`. More documentation
on plugins will be added soon.
- ([0bbfd2b](https://github.com/angular/protractor/commit/0bbfd2b6d38392938781d846ad37b5a0fd964004))
feat(protractor/runner): allow multiple browser in test
Closes https://github.com/angular/protractor/issues/381
Usage: `browser.forkNewDriverInstance`.
- ([8b5ae8b](https://github.com/angular/protractor/commit/8b5ae8ba3d2b3f1de75c0add91694e39e9c591a8))
feat(troubleshoot): Add more information when the --troubleshoot flag is used
Improve error messages and add debug info when
- the configuration file cannot be parsed
- a webdriver session cannot be started
- more than one element is found using `element`
Unify format used for warnings and errors.
## Bug Fixes
- ([30023f2](https://github.com/angular/protractor/commit/30023f2689171bc4f51a173d9cfd62a18fe276c5))
fix(runner): setTestPreparer does not work
setTestPreparer would always set the testPrepare to config.onprepare during
`runner.run()`. This is breaking for code that relies on setTestPreparer directly.
- ([47f12ba](https://github.com/angular/protractor/commit/47f12ba31754346062a1e1d20380346a1c7a0659))
fix(clientsidescripts): make findByCssContainingText tolerate elements with no
textContent/innerText
- ([6a9b87c](https://github.com/angular/protractor/commit/6a9b87cac9b85cde6ae464eafe4abbba27e4fe4f))
fix(elementexplorer): eval always treat result as promise
- ([289dbb9](https://github.com/angular/protractor/commit/289dbb91a0676add40c12bb85d134904c57dcefd))
fix(util): properly handle exceptions from onPrepare and onExit
- ([a132fac](https://github.com/angular/protractor/commit/a132fac0afed5dc5fe8e2663e5aa1c1a90586920))
fix(jasmine): fix errors when iit was used
Errors were due to Jasmine not calling reportSpecStarting when iit was used, but calling
reportSpecResults.
Closes #1602
## Breaking Changes
- ([0bbfd2b](https://github.com/angular/protractor/commit/0bbfd2b6d38392938781d846ad37b5a0fd964004))
feat(protractor/runner): allow multiple browser in test
`protractor.getInstance()` had been unused (replaced by global `browser` in v0.12.0)
and is now removed.
Before:
```js
var myBrowser2 = protractor.getInstance();
```
After:
```js
// In normal tests, just use the exported global browser
var myBrowser2 = browser;
```
If you are creating your own instance of the Protractor class, you may still
use `protractor.wrapDriver` as before.
# 1.4.0
## Features
- ([adef9b2](https://github.com/angular/protractor/commit/adef9b208fcba2a9d60347bda38a3fe3fac6bf50))
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](https://github.com/angular/protractor/commit/06269636f52f9b3a9c73beb6191ae89a7a376cfb))
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](https://github.com/angular/protractor/commit/710cad7c5a2d838a0c4184defa1b7d4240f577f6))
feat(runner/frameworks): Change interface contract of the protractor runner instance so that it
returns a promise instead of calling a callback function
- ([50f44f4](https://github.com/angular/protractor/commit/50f44f430851cbd76dbb3a41d6071198f6f479a4))
feat(protractor): add clone methods for ElementFinder and ElementArrayFinder
- ([eedf50b](https://github.com/angular/protractor/commit/eedf50b48ca55f18e8555ce5aa64ad92b03887c8))
feat(launcher): add beforeLaunch and afterLaunch
- ([8dd60b7](https://github.com/angular/protractor/commit/8dd60b73a3013bd29213c8d281819da6e545c7ff))
feat(protractor): wrap negative indices for ElementArrayFinder.get(i)
Closes #1213
- ([be236e7](https://github.com/angular/protractor/commit/be236e7f44c5306df36b62bb21bb3ba940c86944))
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](https://github.com/angular/protractor/commit/889a5a70c1f980d09a615cf1e8ceaea33272ba8e))
feat(webdriver): version bumps for webdriver, chromedriver, webdriverJS
Upgrade to WebDriver 2.44.0 and ChromeDriver 2.12.
## Bug Fixes
- ([2fbaf52](https://github.com/angular/protractor/commit/2fbaf52fd59f03929e173ebf760a97de34bf91d4))
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](https://github.com/angular/protractor/commit/9db5327e4ada7eb3caa271b394bcda0ba5e8fd62))
fix(ElementFinder): ElementFinder should allow null as success handler. Passes the value to the
next in the chain.
- ([0858280](https://github.com/angular/protractor/commit/0858280db156f924ef126c3aaeae6973b8d44067))
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](https://github.com/angular/protractor/commit/1a4eea4eb89362822dc86be6904c1ddfba95661e))
fix(elementexplorer): elementexplorer hangs when returning ElementFinder
- ([f4e6b40](https://github.com/angular/protractor/commit/f4e6b40c597dc1c59dc7eccfe236abcc336a46a9))
fix(runner): webdriver could get into lock when there is async promise
- ([cf284b9](https://github.com/angular/protractor/commit/cf284b994fb6766c8ab34d0af9b4ccf8fd866bd1))
fix(clientsidescripts): by.exactBinding not working because of regex typo
Closes #1441
- ([9cc0f63](https://github.com/angular/protractor/commit/9cc0f6398146ed9bfc757c1efc05d1806bab1e16))
fix(runner): gracefully shutdown browsers after test
- ([86ead2c](https://github.com/angular/protractor/commit/86ead2c5a20d474e59c3b9796b5438dc2090a6ed))
fix(webdriver-manager): Avoid incompatibility between request with callback and pipe.
- ([7283fdf](https://github.com/angular/protractor/commit/7283fdfa1e4c69bcab6af8f28f8f1b77634a50fd))
fix(launcher): exit code is always 100 for sharded and 1 for nonsharded tests
# 1.3.1
## Bug Fixes
- ([714e4e2](https://github.com/angular/protractor/commit/714e4e28ab90fb5dfeca4375a68469ef609e2722))
fix(locators): fix regression passing root element to locator scripts
Closes #1378
# 1.3.0
## Features
- ([4f1fe68](https://github.com/angular/protractor/commit/4f1fe68882dedba662752e722b9e7b76bfed19b6))
feat(runner): Allow onCleanup to accept a file
- ([548f0c0](https://github.com/angular/protractor/commit/548f0c09748502cb6ae87e602db09e6df78df348))
feat(webdriver): bump WebDriver to version 2.43
- ([466b383](https://github.com/angular/protractor/commit/466b3831569dc28c5fc2be31fbdf96574e57c3f0))
feat(protractor): allow advanced features for ElementArrayFinder
changed ElementFinder as a subset of an ElementArrayFinder.
This enables actions on ElementArrayFinders, such as:
`element.all(by.css('.foo')).click()`
The function `filter` now returns an ElementArrayFinder, so you may also do:
`element.all(by.css('.foo')).filter(filterFn).click()`
or
`element.all(by.css('.foo')).filter(filterFn).last().click()`
- ([7bd2dde](https://github.com/angular/protractor/commit/7bd2dde0a6fca8c8481ad68d0683b4f411d611b9))
chore(angular): upgrade angular to version 1.3.
This change updates Protractor's test application from 1.2.9 to 1.3.0-r0.
There is a significant behind-the-scenes change in the implementation of locating elements and
waiting for the page to be stable. If you are updating your application to Angular 1.3, you may
run into some changes you will need to make in your tests:
- `by.binding` no longer allows using the surrounding `{{}}`. Previously, these
were optional.
Before: `var el = element(by.binding('{{foo}}'))`
After: `var el = element(by.binding('foo'))`
- Prefixes `ng_` and `x-ng-` are no longer allowed for models. Use `ng-model`.
- `by.repeater` cannot find elements by row and column which are not children
of the row. For example, if your template is
`<div ng-repeat="foo in foos">{{foo.name}}</div>`
Before: `var el = element(by.repeater('foo in foos').row(2).column('foo.name'))`
After: You may either enclose `{{foo.name}}` in a child element or simply use:
`var el = element(by.repeater('foo in foos').row(2))`
- ([ee82f9e](https://github.com/angular/protractor/commit/ee82f9e3d0656b3c88f041f0115743352bc08941))
feat(webdriver-manager): ignore ssl checks with --ignore_ssl option
Allow ability to ignore SSL checks when downloading webdriver binaries. Usage: `webdriver-manager
update --ignore_ssl`
## Bug Fixes
- ([838f5a2](https://github.com/angular/protractor/commit/838f5a2b248b1539b7ece13a8ccb921eda08ee45))
fix(element): isPresent should not throw on chained finders
Now, `$('nonexistant').$('foo').isPresent()` will return false instead of throwing an error. This
change also adds tests that ensure that catching errors from promises works as expected.
## Breaking Changes
- ([f7c3c37](https://github.com/angular/protractor/commit/f7c3c370a239218f6143a4992b1fc4763f4cdd3d))
feat(webdriver): update to WebDriverJS 2.43.5
Breaking Changes WebDriverJS has introduced changes in the way that Promises are handled in
version 2.43. See
https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
- `webdriver.WebElement` has now been split into `webdriver.WebElementPromise`
and `webdriver.WebElement` so that it does not resolve to itself. This change
should be largely transparent to users.
- `WebElement.toWireValue` has been removed.
# 1.2.0
## Features
- ([830f511](https://github.com/angular/protractor/commit/830f51128d1ca6c8858c99617b2752172044a752))
feat(protractor): allow file:// baseUrls
Modified protractor to support testing node-webkit by using string concatenation vs url.resolve()
when the baseUrl begins with file://
Closes #1266.
- ([71b9c97](https://github.com/angular/protractor/commit/71b9c97432316a8409c7c83e28a3b1eba2d83f25))
feat(cucumber): process the Cucumber 'coffee' param
## Bug Fixes
- ([ade9a92](https://github.com/angular/protractor/commit/ade9a9277558a564e15e46266a82aeb43261d958))
fix(webdriver-manager): always use https for downloading webdriver binaries
This fixes issues with unzipping - see #1259
- ([9a8f45a](https://github.com/angular/protractor/commit/9a8f45af49633f1637c88960ba079d7d425ca72c))
fix(locators): locators should use the root element provided in config
Previously, locators used 'document' as the root for their search. After this change, they will
use the root element provided in the config file -
`config.rootElement`. This will make sure behavior is correct if there are multiple angular apps
on one page, and also enables the getTestability path, because that requires a root element under
an ng-app.
# 1.1.1
This is a minor release with no functional changes. It contains a couple
implementation switches that new versions of Angular will use.
# 1.1.0
## Features
- ([316961c](https://github.com/angular/protractor/commit/316961c6a5d7410d73a2784a9622b106008b0930))
feat(runner/hosted): add support for promises for seleniumAddress and capabilities
Change driverProviders/hosted to resolve promise values in configuration to allow async jobs in
setup. Specifically, seleniumAddress, capabilities, and multiCapabilities may be promises.
Primarily, this would be for a network call to acquire a selenium host or to start a proxy
server.
- ([953faf7](https://github.com/angular/protractor/commit/953faf7ebee345f686bfedff61ebcb29c5170083))
feat(runner): allow onPrepare functions to return a promise
If onPrepare is a function which returns a promise (or a file which exports a promise), the test
runner will now wait for that promise to be fulfilled before starting tests.
- ([6de2e32](https://github.com/angular/protractor/commit/6de2e32328fc30b43428973457db08f34b7c1839))
feat(runner): Add support for async onCleanUp functions
If the onCleanUp function returns a promise, the process will allow it to resolve before exiting.
This is useful for performing async operations like writing to a file or calling an API at the
end of a test run.
- ([cd575ee](https://github.com/angular/protractor/commit/cd575ee3a4d8c0930db23ad66649bf0d665ce2d6))
feat(sauce provider): allow for custom server addresses when running against SauceLabs.
Use `config.sauceSeleniumAddress` to connect to a custom URL for Sauce Labs.
- ([1b16c26](https://github.com/angular/protractor/commit/1b16c26ac143910d3f3e92a3db4ac6ab168a8544))
feat(suites): allow more than one suite from the command line
Allow a comma-separated list of suites be provided on the command line, like
`--suite=suite1,suite2`
- ([25cf88c](https://github.com/angular/protractor/commit/25cf88c29449cef6b925d19ec9cd17671f1befc9))
feat(ElementArrayFinder): keep a reference to the original locator
## Bug Fixes
- ([d15d35a](https://github.com/angular/protractor/commit/d15d35a82a5a267bb7ae9c675017f091901c019f))
fix issue where ElementFinder.then does not return a promise
See https://github.com/angular/protractor/issues/1152
- ([9e36584](https://github.com/angular/protractor/commit/9e365848820a9a56547e884592e5ea13ef8460ea))
fix(webdriver-manager): removed ssl on chromedriver url for consistency
Other URLs use http, make chromedriver use this as well.
- ([0da1e0c](https://github.com/angular/protractor/commit/0da1e0c65ba7a2b55ad2f5a4582e229dd876f940))
fix(protractor): add dummy isPending function
See https://github.com/angular/protractor/issues/1021
- ([9814af1](https://github.com/angular/protractor/commit/9814af11f35973f0b4a3325fcd0d9e0d91233e61))
fix issue where color formatting text is leaking
See https://github.com/angular/protractor/issues/1131
- ([8f1b447](https://github.com/angular/protractor/commit/8f1b4472430ec2d24f102d284e807b073d17ad81))
fix(launcher): fix issue where test passes on unexpected failures
# 1.0.0
No changes from rc6.
# 1.0.0-rc6
## Dependency Version Upgrades
- ([b6ab644](https://github.com/angular/protractor/commit/b6ab644dd8105d3f64e347342a0ae2ad2f0100fc))
chore(jasminewd): update to version 1.0.4
This version contains a fix for too many timeout messages.
## Bug Fixes
- ([0c4a70e](https://github.com/angular/protractor/commit/0c4a70e0ffbbf4373dbd9f1ab29daabe9338d57b))
fix(protractor) fix stack traces for WebElement errors
When angular/protractor@3c0e727136ab3d397c1a9a2bb02692d0aeb9be40 refactored `element()` into the
ElementFinder object, the function lost some of its error handling. This removed references to
frames inside tests (`it()` blocks), making it hard to tell where the error was actually
occurring.
This commit fixes these problems, showing full stack traces for WebElement errors.
# 1.0.0-rc5
## Features
- ([51a5e89](https://github.com/angular/protractor/commit/51a5e89f7dace45e61d8eab70e1ea6e9354d4de6))
feat(config): allow setting the get page timeout globally from the config
To change the timeout for how long a page is allowed to stall on `browser.get`, change
`getPageTimeout: timeout_in_millis` in the configuration. As before, you may also change the
timeout for one particular `get` call by using a second parameter:
`browser.get(url, timeout_in_sec)`
## Bug Fixes
- ([985ff27](https://github.com/angular/protractor/commit/985ff27c9a94cca83af8db5bf7e570d826b23838))
fix(configParser): load new functions from configs
Closes #1043
## Breaking Changes
- ([51a5e89](https://github.com/angular/protractor/commit/51a5e89f7dace45e61d8eab70e1ea6e9354d4de6))
feat(config): allow setting the get page timeout globally from the config
This change contains a small breaking change for consistency. Previously, the second parameter to
`get` changed the timeout in seconds. Now, the units are milliseconds. This is consistent with
all the other timeouts, as well as base JavaScript functions like setTimeout.
- before: `browser.get(url, 4)`
- after: `browser.get(url, 4000)`
# 1.0.0-rc4
## Bug Fixes
- ([ab1d0be](https://github.com/angular/protractor/commit/ab1d0be8cd83b37906b9b8750dd9d85d72))
fix(navigation): fix using browser.get with safari driver
SafariDriver fails with data urls - see #1049. Reverting to use about:blank for now.
# 1.0.0-rc3
## Features
- ([f0e7984](https://github.com/angular/protractor/commit/f0e7984cdd169df947142c1cff0bd1bc33ac995b))
feat(launcher): append capability tag for all output
## Bug Fixes
- ([1198dde](https://github.com/angular/protractor/commit/1198ddef9e353383819fca3a40bdaba0db22f96f))
fix(navigation): use empty html data urls for page resets instead of about:blank
Except on internet explorer, which does not allow data urls.
Closes #1023.
# 1.0.0-rc2
## Dependency Version Updates
- ([e10e1a4](https://github.com/angular/protractor/commit/e10e1a4a8ae5013982f00d209e6fab1ff2b1d2a1))
chore(minijasminenode): update minijasminenode dependency to v1.1.0
This adds several options for the reporter, which can be included in protractor's
`config.jasmineNodeOpts`
```js
// If true, output nothing to the terminal. Overrides other printing options.
silent: false,
// If true, print timestamps for failures
showTiming: true,
// Print failures in real time.
realtimeFailure: false
```
- ([be0bb00](https://github.com/angular/protractor/commit/be0bb00db6f51e381e31e80c6808a202270ecb20))
chore(jasminewd): update jasminewd to v1.0.3
This fixes extra logging when a timeout occurs.
## Features
- ([82c1d47](https://github.com/angular/protractor/commit/82c1d47462779688bb8c9ac74ba3a6ecfefb7775))
feat(protractor): add iteration index to ElementArrayFinder.each
- ([62bcf7e](https://github.com/angular/protractor/commit/62bcf7e1c84ed720bc17435c40e1f78c50ba194c))
feat(webdriver-manager): minor proxy enhancements
Added error handling for request - previously, any errors coming from the request module were
silently swallowed.
Fixed error handling to remove empty files when a download fails for some reason.
Also evaluating both uppercase and lowercase proxy variables. Many tools use proxy variables in
the form https_proxy, others use HTTPS_PROXY.
## Bug Fixes
- ([dbf7ab5](https://github.com/angular/protractor/commit/dbf7ab5fdf7832676f37328e2ad96b9097db3f62))
fix(mocha): mocha globals should be re-wrapped for every new suite
Closes #523, closes #962
# 1.0.0-rc1
## Dependency Version Updates
- ([0dc0421](https://github.com/angular/protractor/commit/0dc04217a6a5b772d42b1463c91d89beca7df258))
chore(selenium): version bumps to selenium 2.42.2
## Features
- ([6906c93](https://github.com/angular/protractor/commit/6906c9326a4a83d81a0d09bdc1446cccb579d699))
feat(webdriver-manager): use proxy for webdriver-manager
- ([7d90880](https://github.com/angular/protractor/commit/7d9088025c5a1c37428ea3f1cee3dc8d3793f79e))
feat(locators): implement by.options
- ([4e1cfe5](https://github.com/angular/protractor/commit/4e1cfe5ad0f22947d21b4ebecd7cd05e0319af1a))
feature(launcher): aggregate failures at the end and output message from the launcher
- ([ff3d5eb](https://github.com/angular/protractor/commit/ff3d5ebc071a8806259f5da20018f2d937409455))
feat(locators): add toString() wrapper for this.message
- ([c892c2a](https://github.com/angular/protractor/commit/c892c2a1a773cc24cc6565efe2db892776143104))
feat(protractor): implement reduce and filter for ElementArrayFinder
See https://github.com/angular/protractor/issues/877
- ([8920028](https://github.com/angular/protractor/commit/8920028f42e683dc45e18a6dd9386bd862548010))
feat(pause): allow the user to specify a port to be used for debugging
Using browser.pause(portNumber) will now start the debugger on the specified port number.
Closes #956
## Bug Fixes
- ([f9082d0](https://github.com/angular/protractor/commit/f9082d0460c7b6465d53c37f326a0f66412c21ce))
fix(clientsidescripts): make exactBinding more exact
See https://github.com/angular/protractor/issues/925
- ([6641c81](https://github.com/angular/protractor/commit/6641c8168d74914d4826c5968771a2aec8299833))
fix(launcher): report summary when specs fail
- ([36e0e0a](https://github.com/angular/protractor/commit/36e0e0aaf090b0c9b5450fa59ba2da4c4237442a))
fix(protractor): allow exceptions from actions to be catchable
See https://github.com/angular/protractor/issues/959
- ([e86eb72](https://github.com/angular/protractor/commit/e86eb726ad20737d463341afdb4c56b4d19ef414))
fix(protractor): removing a mock module that was never added now is a noop
It used to remove the last module - now is a noop.
Closes #764
- ([bf26f76](https://github.com/angular/protractor/commit/bf26f76ba5dc99d02ea4cd7fc198dce410a9f58c))
fix(locators): findind elements by text should trim whitespace
WebDriver always trims whitespace from around the text of an element, so to be consistent we
should trim the text from button elements before doing a by.buttonText.
Closes #903, Closes #904.
- ([48798b0](https://github.com/angular/protractor/commit/48798b0a8ac1fc56d0cdd80e177d67fdf592069c))
fix(elementexplorer): element.all hangs in interactive mode
# 0.24.2
_Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time._
## Bug Fixes
- ([a43f983](https://github.com/angular/protractor/commit/a43f98391d36cead7378d1dd26f54248f39300b7))
fix(protractor): make ElementFinder.then resolve to itself instead of null
- ([31d42a3](https://github.com/angular/protractor/commit/31d42a3875c5b95893d8a20d00dc5365c289ff98))
fix(protractor): throw index-out-of-bounds
See https://github.com/angular/protractor/issues/915
- to make error more specific instead of propagate later
# 0.24.1
_Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time._
## Bug Fixes
- ([59af936](https://github.com/angular/protractor/commit/59af936e1ef6e21432f7876144554db145083d46))
fix(locators): Missing information in warning/error messages
Webdriver's built-in locators (such as `by.css()`) appeared as
'undefined' in protractor's messages.
For instance, if a locator matched multiple elements, protractor would print the following
message: 'warning: more than one element found for locator undefined- you may need to be more
specific'.
- ([13373f5](https://github.com/angular/protractor/commit/13373f5de18690e1994b32e092105cfe3ad1753d))
fix(launcher): output error messages when child processes exit w