utils.puts is no longer available in Node.JS 12
BREAKING CHANGE: Debugger and explore methods are not compatable with Node 8+. Use debugger
keyword instead. See: https://goo.gl/MvWqFh
(7cdb978) build: update several dev packages that have security issues
(8e82835) build: update webdriver-manager
(a1fe5f2) ci: update tests to run on Node 10 and 12
(3fc9220) fix: prototype Pollution vulnerability through outdated yargs package
BREAKING CHANGE:
Node.Js version 6 and 8 are no longer supported. Please update to Node.Js 10+
Closes #5431
fix(index.ts): Fix exports to unbreak TypeScript 3.7 build
This change allows user to define the backend region from sauce via the sauceRegion
property,
e.g.
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
sauceRegion: 'eu',
Will run the test against https://ondemand.eu-central-1.saucelabs.com:443/wd/hub/.
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
sauceRegion: 'us',
// the default
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
Will run the test against https://ondemand.saucelabs.com:443/wd/hub/
(7b08083) feat(driverProvider): Add useExistingWebDriver driver provider (#4756)
(249e657) feat(example): add examples of usage protractor framework with angular-material components; (#4891)
(39485ca) fix(typo): fixed typo in EC expectation alias (#4952)
(07fefeb) fix(browser): browser.navigate() return type. (#4932)
Changing return type of browser.navigate() to be Navigation instead of any.
(492230a) fix(generate_doc.sh): Use ES6 lib to compile down to ES5 (#4884)
(3702a70) fix(local): Ensure webdriver.gecko.driver path is passed to Selenium (#4502)
(1c6a1a8) fix(circleci): Switch to using circleci v2 syntax and fix build errors (#4837)
Increase the scripts timeout
Updated some of the spelling errors/ punctuation mistakes for clearer understanding.
(76324b8) fix(cli): add more verbose warning if '_debugger' module cannot be found. (#4800)
(f8f490a) updated CHANGELOG based on sauceSeleniumAddress and sauceSeleniumUseHttp (#4793)
Ignore generated unstaged files before checking out to new branch; otherwise, the git checkout will fail.
(c63b99e) fix(grep): change excluded tests to disabled instead of pending (#4673)
(9348ccf) docs(page_objects): Remove unnecessary "await" and "async" (#4732)
(4898db0) docs(plugins) add protractor-cucumber-steps plugin to plugins.md (#4721)
(a7411b6) docs(page_objects): Add async / await example (#4675)
(9d87982) feat(config): allow to use newer versions of CoffeeScript (#4567) CoffeeScript lost the hyphen in the module name about 9 months ago, all the new versions are going to be released as coffeescript not the coffee-script
(6ba30e0) feat(driverProviders): Add TestObject and Kobiton as driverProviders Add TestObject and Kobiton as driverProviders
(a62a154) fix(script): fix compile-to-es5 script (#4676) make compile-to-es5 script rely on native es6-promise typing
(964baba) fix(clientsidescript): avoid returning the value of test callback in waitForAngular (#4667) The return value could be interpreted as an error by mistake in some situation Also fix a wrong if-condition in error reporting
(83e2ba8) fix(website): Locator by.name('field_name') (#4653)
(02746dd) fix(browser): Add space after full stop in error message. (#4594) Linkifiers interpret the ".If" at the end of the URL as part of the URL.
(7f968e0)
fix(direct): Use config's geckoDriver when specified (#4554)
This change makes the firefox
capability more closely match chrome
's. The firefox
capability was not looking for config_.geckoDriver
like chrome
was.
(f9df456) docs(element): fix minor typo in element.ts (#4471)
(65f206e) docs(website): updated reference from ignoreSynchronization to waitForAngularEnabled(false). (#4632)
(b3c7404)
Revert "fix(jasmine): Update Jasmine to support Node8 async/await (#4608)"
This reverts commit 5d13b00bca
.
This commit is unnecessary now, revert this commit to avoid breaking changes in 5.2.1
(8e5ad1f) fix(doc): remove unnecessary config in debugging doc/example (#4622)
Breaking change for TypeScript: JasmineWD doesn't know anything about async/await, turns off JasmineWD if control flow was disabled.
It will affect TypeScript tests that are using async/await and
a. miss some await keyword in the test.(Previously, this might cause the test failed silently and be reported as pass), or
b. use Promise in jasmine expect function
Before
```ts
await expect(getPromise()).toEqual(42);
```
After
```ts
expect(await getPromise()).toEqual(42);
```
(f7e17f3) fix(clientSideScripts): change protractor to support waiting for hybrid app (#4512)
(4b7cada) fix(sauce): bring back sauceProxy as a configuration option (#4419)
(b87159b)
fix(website): fix all locator examples to use element
over browser.findElement
(#4413)
(768fd39) fix(local): allow local driver provider to use gecko driver from config (#4412)
(c0b8770) docs(website): fix issue 4246
(f79938e) docs(plugins): add ng-apimock plugin to plugins.md
(ab1afb0) fix(blockingproxy): Start bpRunner strictly after setupDriverEnv
(b85e7ee) fix(npmignore): .map files in built directory cause stacktrace lines to nowhere Fixes #4371
(299fc8d) docs(browser-support): Fixed incorrect example
(e5a5d59) docs(frameworks) align cucumberOpts comments
(fe8c480) docs(frameworks) update cucumber dry run option
(2e9acf5) docs(plugins) add protractor-numerator plugin to plugins.md
(3f861ae) By.js locator should accept functions
New option sauceSeleniumUseHttp
available in protractor.conf.js
If true, uses 'http' instead of 'https' to connect to Sauce Labs defined by sauceSeleniumAddress
(1a47076) fix(ci): Use latest pip on CircleCI
(fd59c78) fix(elementexplorer): Set script breakpoints with cross-platform safe paths.
Fixes #4011
Chromedriver requires that certain options always be passed as an array. Optimist passes --single-option as a string instead of an array which is invalid. This ensures that we always pass an array, even if a single option is passed via the cli.
Fixes #4050
By default, it wasn't returning anything. Now it returns a promise that resolves to internalAngularAppRoot. Fixes #4233
This fixes a problem I encountered similar to #4196 - where stackTrace
is listed as an option
but an error is given saying it's an "unknown extra flag"
The err
object doesn't have the code
property any more (Selenium Server Standalone 3.3.1 +
IEDriver win32 3.3.0), so we need a new way to detect those errors. See #841
(3edd62e) feat(saucelabs): Add Sauce Labs HTTPS Support (#4071)
(29f975a) feat(plugins): allow plugins to know which browser instance to run against (#4066)
Closes https://github.com/angular/protractor/issues/4054
(9d69a81) deps(typescript): use typescript@~2.0.0 (#4062)
Blocking Proxy is a new experimental feature in Protractor 5 and is behind the
--useBlockingProxy
or blockingProxyUrl
. See the
lib/config.ts#L100.
Other ways to start blocking proxy include using the
--highlightDelay
and --webDriverLogDir
flags See lib/config.ts#L501.
This adds two options, both of which are implemented with Blocking
Proxy. --webDriverLogDir
will create a readable log with timing
information of webdriver commands in the specified directory.
--highlightDelay
will pause before clicking on elements or sending keys.
While paused, the element that's about to be affected will be
highlighted.
Webdriver-manager will now by default grab the latest versions of all binaries
(standalone, chromedriver, iedriver, gecko driver). Use the
--versions.(binary name)
to pin to a specific version. Selenium standalone
3.0.1 has a bug which prevents it from working with any version of FireFox.
We have tested version 3.0.0-beta4 and know that it works with
FireFox 51, and we expect that the 3.0.2 release will also work.
For jasmine users, in order to get all the type declarations that are used in
jasminewd2, you'll need to install @types/jasminewd2
in addition to
@types/jasmine
as dev dependencies.
This adds two options, both of which are implemented with Blocking Proxy. --webDriverLogDir will create a readable log with timing information of webdriver commands in the specified directory.
--highlightDelay will pause before clicking on elements or sending keys. While paused, the element that's about to be affected will be highlighted.
Closes https://github.com/angular/protractor/issues/3691
Closes https://github.com/angular/protractor/issues/3904
lib/browser.ts
+ return promise from
waitForAngularEnabled
(#4021)Minor breaking change since waitForAngularEnabled
no longer returns a boolean
Part of angular#3904
Chaining browser.get
has proved surprisingly complex, so I'll do that in a different PR
Also fixed a minor bug in lib/clientsidescripts.js
while debuging
Closes https://github.com/angular/protractor/issues/3900
Also allows browser.restart
to work when the control flow is disabled, and
fixes it for forked browsers.
Closes #3899 and #3896 https://github.com/angular/protractor/issues/3896
Replace browser.rootEl with browser.angularAppRoot(), which changes the root element in a promise on the control flow. Note that browser.rootEl will immediately return the current value, but browser.angularAppRoot() will return a promise that resolves during the next step in the control flow.
Also update to BlockingProxy 0.0.3, which allows changing rootSelector.
(879aac6) chore(blockingproxy): Allow using a pre-existing Blocking Proxy instance (#3970)
(bf123ad) feat(elements): Add isPresent() to ElementArrayFinder. (#3974)
I noticed I missed waitForAngularEnabled
in #4037. This commit fixed that.
While I was at it I fixed a minor error where the promises implicitly created by
setting rootEl
and ignoreSynchronization
weren't getting chained properly.
Also fixed minor (so minor I think it was impossible to trigger) where browser.plugins_ could be undefined.
(0b0c224) fix(plugins): do not force ManagedPromise in plugins.ts (#4036)
(9c2274d)
fix(restart): preserve properties like browser.baseUrl
upon restart (#4037)
I also fixed a minor issue where internalRootEl
wasn't being set when blocking proxy was being
used. I also just cleaned up our internal uses of this.rootEl
.
Closes #4032
Also added some tests to spec/ts/noCF/smoke_spec.ts
double checking that the control flow is off
(7481dee) fix(cli): Make unknown flag check a warning instead of an error. (#4028)
(40bbeca) fix(expectedConditions): Add tests and fix race conditions around visibility (#4006)
Add test cases to reproduce the missing element race conditions possible in
expected condition methods visibilityOf
, textToBePresentInElement
,
textToBePresentInValue
and elementToBeClickable
.
Add error handler falseIfMissing
to all expected conditions that depend
on the presence of an element.
Expected conditions check the presence of an element before other checks,
but when an element is removed exactly in the moment after the isPresent
and before isDisplayed
in visibilityOf
the condition used to fail.
This solution does not handle missing elements in (isEnable
, isDisplayed
,
isSelected
) and focused only on expected conditions (see #3972)
This problem was also referenced in #3578 and #3777
Fix for #3978. Our initial plan to allow setting --disableChecks with an environment variable is insufficient, since the custom framework isn't even require()'d until after the config is parsed. This moves the unknown flag check into the runner, and gives frameworks a way to specify extra flags they accept.
(e68dcf1) fix(driverProviders): Check config in the right place. (#3991)
(eb89920) fix(driverProviders): Handle promise rejection when starting selenium (#3989)
Fixes #3986. Also error if jvmArgs isn't an array.
(8d2fc07)
chore(browser): deprecate browser.getLocationAbsUrl()
. (#3969)
Closes #3185
(15a1872) fix(firefox): Fix directConnect for Firefox 51+ (#3953)
(81f56a4) fix(cli): display disableChecks option in extra flags error message (#3964)
(6a4dc7a) fix: no longer use es6 let statement (#3963)
let
modifier.This can break Protractor on browsers, which doesn't support those statements.
See https://saucelabs.com/beta/tests/275f75091dac40a0a3374d29d912caee/commands#11
Handle NoSuchElementError in the expected condition visibilityOf, which occurred when an element disappears between the isPresent() and isDisplayed() check.
Running webdriver-manager update
will now by default grab the latest
versions of all binaries (standalone, chromedriver, iedriver, gecko
driver). You can continue to pin to a specific versions using the
command line option. Example webdriver-manager update --versions.chrome 2.20
.
As of this release the latest versions are:
A note on FireFox support: Selenium standalone 3.0.1 has a bug which prevents it from working with any version of FireFox. We have tested version 3.0.0-beta4 and know that it works with FireFox 51, and we expect that the 3.0.2 release will also work.
closes #4033
This version includes big changes around upgrading to selenium-webdriver 3.0.x. See the selenium-webdriver changelog.
For the 5.0.0 release, we are still using the selenium standalone server 2.53.1 and recommend using Firefox 47. Firefox 48+ currently is not supported.
marionette: false
to use the legacy Firefox driver.Before:
capabilities: {
browserName: 'firefox'
}
After:
capabilities: {
browserName: 'firefox',
marionette: false
}
@types/jasmine
to a devDependency. This means that Jasmine
TypeScript users will need to include the @types/jasmine
as a project
dependency. This is to avoid conflicts for users that prefer mocha typings.After:
"dependencies": {
"@types/jasmine": "^2.5.38"
}
WebDriver.prototype.isElementPresent
,
WebElement.prototype.getRawId
, WebElement.prototype.getInnerHtml
, and
WebElement.prototype.getOuterHtml
.Before:
let isPresent = browser.driver.isElementPresent(By.tagName('a'));
let i = element(locator).getInnerHtml();
let o = element(locator).getOuterHtml();
After:
let isPresent = element(By.tagName('a')).isPresent();
let i = browser.executeScript("return arguments[0].innerHTML;", element(locator));
let o = browser.executeScript("return arguments[0].outerHTML;", element(locator));
ErrorCodes
have been removed.Before:
browser.manage().addCookie('testcookie', 'Jane-1234');
After:
browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});
protractor.wrapDriver()
.repl
command from within browser.pause()
. Instead,
use browser.explore()
to directly enter the repl
.--disableChecks
.config.useAllAngular2AppRoots
flag. Modern angular apps now
default to using all app hooks, and ng1 apps now check several places, notably
the element the app bootstraps to.sauceProxy
configuration field has been removed. Use webDriverProxy
instead.Before:
sauceProxy: 'http://sauceProxy'
After:
webDriverProxy: 'http://sauceProxy'
Unknown flags are options sent that is unrecognized by the CLI. For users that
encounter this error but would like to silence it, use: --disableChecks
.
closes #3216
This is a breaking change because it changes the default root element behavior
and removes the config.useAllAngular2AppRoots
flag. Modern angular apps now
default to using all app hooks, and ng1 apps now check several places, notably
the element the app bootstraps to.
closes #1742
Removes the sauceProxy
config field, and uses webDriverProxy
when creating
the SauceLabs client.
Also had to make some minor changes to the website to handle longer inheritance chains Closes https://github.com/angular/protractor/issues/1940
This adds support for BlockingProxy behind the flag --useBlockingProxy.
If set, the driver providers will start a proxy during their setup phase, passing the selenium address to the proxy and starting a webdriver client that talks to the proxy.
Starting a proxy for each driver provider isn't strictly necessary. However, when we run with multiple capabilities it's easier to handle the logging if each Protractor instance has it's own proxy.
Known issues:
Doesn't yet work with webDriverProxy (but it's an easy fix)
(ca4f1ac) chore(driverProviders): add warnings to extra driver provider parameters (#3873)
(681b54a) refactor(browser): Remove protractor.wrapDriver() breaking change (#3827)
Before:
Users could create their own selenium driver instance and enable Protractor on it like so:
let capabilities = webdriver.Capabilities.chrome();
let driver = new webdriver.Builder().usingServer(seleniumAddress)
.withCapabilities(capabilities).build();
let browser = protractor.wrapDriver(driver);
Over the years, wrapDriver() has become increasingly broken as Protractor needs extra configuration options that wrapDriver() doesn't set.
After:
This method is removed. If users need a new browser instance, they can
use browser.forkNewDriverInstance()
.
closes #3875
WebElement
s, browser.isElementPresent
was broken (#3871)Closes #3864
Type then
as optional on ElementFinder.
(4d87c9c) deps(update): update tslint and @types/selenium-webdriver (#3941)
closes #3939
This implementation now relies mostly on promises explicitly, so the control flow is only used to add one large task to the queue. This should pave the way for the eventual removal of the control flow, as well as getting element explorer to work immediately.
BREAKING CHANGE
You can no longer use the repl
command from within browser.pause()
. Instead,
use browser.explore()
to directly enter the repl.
--versions.chrome 2.26
from circle.yml (#3865)(397bf65) deps(update): move @types/jasmine to devDependencies (#3795)
(a3e8b43) deps(selenium-webdriver): upgrade to selenium 3 (#3781)
Please see the selenium-webdriver changelog
- Removed method `WebDriver.prototype.isElementPresent`
- Removed method `WebElement.prototype.getRawId`
- Removed `getInnerHtml` and `getOutterHtml`
- Dependency required for upgrade: use `jasminewd2@0.1.0`.
- Selenium-webdriver requires node version 6+, updating travis and circle yml
to use node 6 and 7.
- Use `instanceof` selenium-webdriver error instead of error code.
Selenium-webdriver error codes have been deprecated.
- Use executor with selenium-webdriver from `lib/http`. Deferred executor has
been deprecated.
- Fix quitting `driverProviders`. When calling `webdriver.quit`, the control
flow is shutdown and will throw an error.
- Driver provider for direct connect has been modified to use `ServiceBuilder`
and to call the `Service` to `createSession`
- Note: Since this upgrade is still using FF 47, direct connect for Firefox is
required to pass "marionette: false" in the capabilities. If you do not pass
marionette to false, it will look for gecko driver in the PATH.
- Added a TODO to support FF after 48+ with direct connect and gecko driver.
- Updated `browser.manage().addCookie('testcookie', 'Jane-1234');` to use
`browser.manage().addCookie({name:'testcookie', value: 'Jane-1234'});`
- Updated debug commons for breakpoint updated to selenium-webdriver
`lib/http` line 432.
- For mocha tests, `selenium-webdriver/testing` uses the global `it` and
cannot be reassigned as Protractor's global `it`. Some code has been
copied / modified to `lib/frameworks/mocha` to make this work.
- Capabilities for Firefox 47 requires setting marionette to false.
- Setup still requires selenium standalone server 2.53.1 for Firefox tests.
Firefox version used is 47.
- Using selenium standalone server 3, with Firefox 48+ tests fail with gecko
driver still do not work.
- Selenium standalone 3 + FF 49 + gecko driver 0.11.1 does not work
- Selenium standalone 3 + FF 48 + gecko driver 0.11.1 appears to work for a
single test but after it quits, selenium standalone no longer works with
firefox. When firefox 48 exists, logs show the following:
```
20:01:14.814 INFO - Executing: [delete session: e353fa1b-e266-4ec3-afb3-88f11a82473a])
[GFX1-]: Receive IPC close with reason=AbnormalShutdown
[Child 30665] ###!!! ABORT: Aborting on channel error.: file /builds/slave/m-rel-m64-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2052
[Child 30665] ###!!! ABORT: Aborting on channel error.: file /builds/slave/m-rel-m64-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2052
```
Fixes issue #3879 and adds the protractor.Key.chord method
(83694f5) fix(types): update for selenium-webdriver types creating transpile errors (#3848)
(ea09be4) fix(jasmine): Return the full test name in Jasmine test results. (#3842)
Fixes #3510
(688f5d6) deps(update): update vrsource-tslint-rules and webdriver-manager (#3856)
(c437fd3) deps(selenium-webdriver): clean up types selenium-webdriver (#3854)
(c3978ec) fix(revert): element(locator).then should not appear in the docs and change reverted. (#3808)
element(locator).then
(742f264) fix(driverProviders): quit forked instances w/ local driver provider (#3787)
(7d481d6) fix(ExpectedConditions): non-static ExpectedConditions for browser (#3766)
(2048182) docs(timeout): Update timeout error message and docs (#3723)
(f3938f9) fix(jvmArgs): fixes jvmArgs launching selenium from config (#3698)
closes #3697
(21d534f) fix(types): Make element.then()'s signature more broad. (#3719)
(e9061b3) chore(types): make plugins.ts more strongly-typed (#3685)
(f42e0b3) fix(globals): Resolve exported globals dynamically. (#3716)
fixes #3677
Upgrading to 2.5.2 causes #3606. We'll need to wait on a fix for jasmine/jasmine-npm#95 before upgrading.
closes #3648
MSEdge does not properly remove newlines, which causes false negatives when using
textToBePresentInElement()
(c11945a) deps(outdated): webdriver-manager and @types updated
This version includes a breaking change to the TypeScript import statement. Please see the feature below.
Breaking change for TypeScript:
Instead of importing globals like browser
from protractor/globals
,
import from protractor
.
Before:
import {browser, element} from 'protractor/globals';
import {ElementFinder} from 'protractor';
describe('my app', () => {
myElement: ElementFinder;
beforeEach(() => {
browser.get('example.com');
myElement = element(by.css('foo'));
});
});
After
import {browser, element, ElementFinder} from 'protractor';
describe('my app', () => {
myElement: ElementFinder;
beforeEach(() => {
browser.get('example.com');
myElement = element(by.css('foo'));
});
});
Closes #3564
(58459a9) fix(types): do not publish built/globals.d.ts (#3546)
(a68dd3f) deps(jasmine): lower jasmine version down to 2.4.1 (#3540)
closes #3533
In this version, there are several small changes that affect TypeScript users from the previous version 4.0.4. Here are some of the steps to resolve any transpiling errors:
@types/node
and @types/jasmine
installed in node_modules.jasmine
and node
from your typings.json
since these types are
already included via @types
. If these were the only ambient typings
installed, remove the typings.json
file.typings.json
file, remove typings
directory and
install a fresh set of ambient typings with: typings install
.Fixes #3522. Also fix the mocha spec to stop yelling at us about ES6 arrow functions.
Fixes #3505 and #2790, which is caused by JasmineWd and Protractor using different controlflow instances
(64b4910) fix(debugger): Fix issues when calling pause() multiple times (#3501) (#3504)
(143c710) chore(types): webdriver typings for elements and browser (#3513)
(8ca9833) fix(mocha): Wrap it.only with the selenium adapter. (#3512)
Fixes #3045. Since mocha 2.4.1, we should be wrapping global.it.only.
(f23d027) chore(types): webdriver typings for locators (#3507)
(e0b151a) fix(launcher): Handle uncaught exceptions that are strings. (#3506)
Also clean up instances where we were throwing strings instead of Errors.
(c5faf08) feat(browser): auto-unwrap ElementFinder into WebElement for selenium funtions (#3471)
(a379b33) feat(plugins): support onPrepare in plugins (#3483)
(d10bc99) deps(outdated): update types/q and saucelab
(4252000) deps(types): typescript and typings dependencies (#3485)
(5f690fe) fix(export): export selenium-webdriver (#3433)
(27f7981) fix(config): fix interface for functions such as onPrepare (#3434)
closes #3431
closes #3414
closes #3410
closes #3256
Needed for angular2 after rc2
(2a3a0dc) fix(exports): fix type exports and require('protractor') exports (#3404)
(b2eaa29) fix(types): output plugin typings (#3389)
(d2145b1) fix(launcher): output uncaught exception error (#3390)
(d7cf42e) fix(protractor): export class definitions under the protractor namespace (#3393)
closes #3377
(2e83dcd) fix(types): add webdriver.promise and webdriver.WebElement to namespace (#3392)
(dcbc832) fix(types): use protractor from global namespace (#3388)
(ee038f9)
fix(error message): do not crash of thrown error has made stack
readonly (#3372)
This version includes some big changes, so we've decided to make it version 4.0!
webdriver-manager is now it's own NPM, so you
can use it in your own projects. Protractor depends on it, though, so you shouldn't need to change
anything. However, because it is a new dependency you'll need to rerun webdriver-manager update
.
Protractor has TypeScript typings! See the example for details on how to use TypeScript in your tests.
(d932ad7) chore(browser): rename protractor to browser and add a protractor namespace (#3214)
Selenium Webdriver has deprecated getInnerHtml and getOuterHtml. You'll need to update your tests to not use these methods.
Protractor node module no longer has a config.json file. This is now handled in the webdriver-manager node module and the files are also downloaded to the webdriver-manager/selenium folder.
(d6910c1) fix(edge): Use resetUrl about:blank for MicrosoftEdge (#3267)
(f205518) fix(launcher): resolve promise for getMultiCapabilities (#3195)
closes #3191
closes #3170
Cucumber allows line numbers to be passed in the filename in the form of
features/some.feature:42
. Glob expanding that results in an empty array and nothing being passed
to the framework runner. This change checks for glob magic characters and only tries expanding it
if found. Otherwise it just passes the filename verbatim. This was previously handled in [#2445]
by stripping the line number first, but this is a more generic (non-cucumber) way to do it.
Glob needed to be upgraded for this which resulted in a weird npm 3 bug. Removing the rimraf package resolved this. It was only
used to generate documentation which itself was removed a while ago.
closes #3233
closes #3224
This is no longer necessary in the latest version of selenium-webdriver. Without this change,
--capabilities.chromeOptions.binary
will do nothing, for example.
Closes #3290
(78f3c64) chore(exitCodes): adding exit code for browser connect errors (#3133)
(85209f4) feat(webdriver): extract webdriver-manager into a separate node module (#3068)
Wedriver-manager downloads the file to the node_modules/webdriver-manager/selenium folder. This will no longer appear in the protractor directory.
(8316917) feat(expectedConditions): adding urlIs and urlContains (#3237)
Updated the following outdated packages: body-parser, chai, chai-as-promised, glob, jshint, mocha, request, saucelabs, typescript, typings
closes #3173, closes #3167, closes #3058
(2a391bc) chore(es7): async/await example
(bb65e5a) chore(website): clean up documentation (#3334)
(f5dc4f9) chore(example): add a protractor typescript example (#3323)
The Protractor Website API docs have been streamlined. We've also, internally, moved to using TypeScript and building down to JS! Also, the logger has been improved.
Trying to use the debug label for window.name fails for versions of angular older than 1.2.24. See #3115
(bd78dfc) fix(protractor): isPresent() should work with out of bounds errors (#3108)
(88dd568) fix(NoSuchElementError): add 'new' keyword to instantiate class
The class NoSuchElementError is called without the new keyword in the
ElementArrayFinder.prototype.count
causing a Class constructors cannot be invoked without
'new'
closes #3079
(5fa94db) feat(exitCodes): adding exit codes for configuration file errors (#3128)
(76861fd) feat(element): equals
Easier to use version of webdriver.WebElement.equals
(b4d1664) deps(jasminewd2): bump jasminewd2 to 0.0.9
(b6f1a63) feat(protractor): Shows locator used when a timeout occurs
(de4b33e) feat(webdriver): Added NO_PROXY environment variable support to webdriver-manager
closes #3046
This release is a hotfix for webdriver-manager iedriver
(c6a3b5e) fix(webdriver) - fix file type for internet explorer driver file
(d3bd170) fix(bootstrap): enable debug info before setting defer label
Note that in most cases, this should not have surfaced as an issue because the base test mock modules will also try to turn on debug info.
Closes #3009
This release is a hotfix for modules that require protractor
This allows plugins to turn Protractor's default synchronization on and off as needed.
(7372267) feat(webdriver): add support for custom versions for selenium, chrome driver, and ie driver
(1cbbe4f) feat(config): no globals option
(9608201) feat(typescript): adding typescript to protractor
Converting a 3 files over to typescript.
Adding an npm prepublish
step that will use gulp to download the typings, transpile the files
with tscto the built/ directory and copy the rest of the javascript files from lib/ to the built/
folder.
Also adding scripts to package.json for npm run tsc
and npm run tsc:w
for transpiling help.
See the full changelog at https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md#v2520
Fixes #2928
To prevent bugs like #2925 in the future.
Selenium-standalone update to 2.51.0. Update chromedriver to 2.21.
Chromedriver changelog: http://chromedriver.storage.googleapis.com/2.21/notes.txt Selenium changelog: https://github.com/SeleniumHQ/selenium/blob/master/dotnet/CHANGELOG
Attaching an existing selenium browser session to protractor rather than always creating new one. The session can be passed into the config file as a string via the sessionId.
You can now pass a complete object of configuration for the SeleniumServer class. This allows enabling loopback on the selenium server.
Currently Angular application which for performance reasons, have debug information turn off cannot be tested. This PR allows users to add the Angular debug logging flag to the Protractor run.
(aa5ceb5) feat(webdriver): add support for selenium webdriver proxy
(b110ed9) feat(debugger): allow multiple browser.pause()
After this change, you can put multiple browser.pause() in the code. Each browser.pause() is like a traditional breakpoint.
To detach from the debugger, press ^D (CTRL+D). This will continue code execution until it hits the next browser.pause() or code finishes running.
This PR also fixes a number of small formatting issues.
Fixes #2300
Closes #1944
Makes error messages better
We're releasing version 3.0 with some breaking changes. In summary - Jasmine 1.3 is removed, only Jasmine 2 is now supported, old Node.JS support is dropped, and plugins now need to be explicitly required. Full details below.
(18e1f71) chore(webdriver): upgrade Protractor to webdriver 2.48.2
(1f44a6e) chore(deps): bump chromedriver and iedriver versions IEDriver from 2.47.0 to 2.48.0
ChromeDriver from 2.19 to 2.20. Changelog: http://chromedriver.storage.googleapis.com/2.20/notes.txt
(97e6703) feat(protractor): Add protractor.prototype.restart
(2007f06) feat(protractor): add flag to stop protractor from tracking $timeout
(a40a4ba) feat(ElementArrayFinder#get): Implemented ability to pass promise as index to ElementArrayFinder#get
(a54c0e0) feat(plugins): Add config option to disable logging of warnings in console plugin
Running tests in multiple browsers ends up printing out a lot of useless warnings I'm already aware of. To make skimming through logs in the case of an actual failure easier, I want to be able to disable the logging of warnings in the console plugin.
Also added BrowserStack to CI
Discovered while investigating issue #2365
and update docs. Also, use jasmine 2 for running all Protractor's unit tests.
BREAKING CHANGE: Now, both jasmine and jasmine2 frameworks use jasmine 2.3. Users still using jasmine version <2 will have to upgrade.
BREAKING CHANGE: 1) Users will no longer be able to use node versions <4. 2) There is significant changes to the control flow, and tests may need to be
modified to be compliant with the new control flow. See
https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
BREAKING CHANGE:
The Accessibility, NgHint, Timeline, and Console plugins are now located in their own separate node modules. You will need to explicitly require each module you use. See https://github.com/angular/protractor/blob/master/docs/plugins.md#first-party-plugins for info for each module.
BREAKING CHANGE:
Cucumber has been community maintained for a while, and in order to allow it to move faster, it is no longer part of the core Protractor library. It is now published on npm under protractor-cucumber-framework
and will require setting frameworkPath
in your configuration file. See https://github.com/angular/protractor/blob/master/docs/frameworks.md#using-cucumber for full instructions on use now.
This release is a hotfix for node 0.10 support
Closes #2588
This release contains a hotfix for windows path issues and early support for Angular2 apps
This allows waiting for all angular applications on the page, for angular2 apps only.
Use Angular2's testability API, if present, when waiting for stability or loading a page.
Closes #2396
This allows absolute paths absolute paths in to be properly parsed in windows. This should maintain the line-number feature introduced in ff88e without breakage.
This release contains only a version update to selenium-webdriver
, webdriver javascript bindings, and associated bug fixes.
Along with it, update jasminewd2
to avoid situations where the control flow gets locked up and
hangs.
Potential Breaking Change:
This is passing all existing Protractor tests, but there is a possibility that the changes to the
control flow will cause some test flows to hang. If this causes issues, such as tests hanging or commands executing out of order, please revisit your use of functions affecting the control flow, such as flow.execute
.
See the selenium-webdriver changelog at https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md
Previously, the order of frames and tasks on the control flow was different depending on
browser.ignoreSynchronization
. This fixes the inconsistency by creating an empty task when
ignoreSynchronization is true.
Practically, this fixes the polling spec failing after the update to selenium-webdriver@2.47.0.
This release contains updates which fix some issues with dependencies that had gotten stale. However, it does not yet contain an update to the selenium-webdriver dependency, because of potential breaking changes. That update will be done in a separate Protractor@2.4.0 release. See issue 2245.
Updating Selenium standalone from 2.45.0 to 2.47.0 Updating ChromeDriver from 2.15 to 2.19 Selenium Changelog: https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md ChromeDriver Changelog: http://chromedriver.storage.googleapis.com/2.19/notes.txt
(802b20f) chore(selenium): update selenium from 2.47.0 to 2.47.1
(7a7aca8) chore(jasmine): bump jasmine version from 2.3.1 to 2.3.2
(eab828e) chore(travis): test against node 4
Test against node 4 on Travis, and remove support for node 0.10.
The new option allows to download the 32-bit version of the IE driver on a 64-bit system, as the 64-bit version has been broken for over a year now (the sendKeys() function works very slowly on it).
example:
specs: [
'cucumber/lib.feature:7'
]
Fixes #2456
(2ff7a07) fix(Chrome Accessibility Plugin): resolving the location of AUDIT_FILE
(f9b0a92) fix(debugger): Fix potential debugger lockups
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.Closes #2205
(f2a11a7) feat(plugins): Changed and expanded the plugin API
onPageLoad
and onPageSync
entry points for plugins for modifying browser.get
waitForPromise
and waitForCondition
entry points for plugins for modifying
waitForAngular
This closes #2126 and helps out @andresdominguez
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) feat(plugins): reporting loaded plugins
(6c10378) 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.
(c30afdd) fix(test): fixed tests under npm test
(3508335) 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)
Closes #2335
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
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) docs(tutorial): use Jasmine v2 in the tutorial
(e60dc0f) 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).
Fixes the run failures reported in https://github.com/cucumber/cucumber-js/issues/342.
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.
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) feat(plugins): allow plugins.postTest to know what test just ran
(0f80696) feat(plugins): inline plugins
(de49969) 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 callreqContinue
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) feat(browser.get): Return a promise that handles errors in browser.get
See #2051
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
Letters run into a problem with a maximum of 26. See #2042
Closes #2040
(fa699b8) fix(debugger): fix 'getControlFlowText()' broken in webdriver 2.45
(b783dd8) fix(browser): remove subsequent duplicate module
browser.removeMockModule() misses next duplicate module because of iteration over an array it's modifying.
(e3d4ad1) fix(stacktrace): remove jasmine2 specific stacktraces
(3cded9b) fix(locators): escape query in byExactBinding
See http://stackoverflow.com/q/3561711
Closes #1918
Why is this change version 2.0? Protractor is following semver, and there's some breaking changes here.
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
(997937d) feat(console plugin): Added new console plugin
(ef6a09d) 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
.
Instead of just printing the first N characters of the element's template, print the first and last N/2.
See #1854
(2a765c7) fix(element): return not present when an element disappears
(8a3412e) fix(bug): by.buttonText() should not be effected by CSS style
Closes issue #1904
(5d23280) fix(debugger): fix issue where output does not display circular dep and functions
(ef0fbc0) fix(debugger): expose require into debugger
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:
element(by.css('foo')).then(function(el) {
return el.getText().then(...);
});
After:
element(by.css('foo')).getText().then(...);
In other words, an ElementFinder is now no longer a promise until an action has been called.
Before:
var el = element(by.css('foo'));
protractor.promise.isPromise(el); // true
protractor.promise.isPromise(el.click()); // true
After:
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.
chromeOnly
This has been replaced with directConnect
.
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:
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:
onPrepare: function() {
browser.driver.manage().window().maximize();
return browser.get('http://juliemr.github.io/protractor-demo');
}
Due to changes in WebDriverJS, wait
without a timeout will now default
to waiting for 0 ms instead of waiting indefinitely.
Before:
browser.wait(fn); // would wait indefinitely
After
browser.wait(fn, 8000) // to fix, add an explicit timeout
This will be reverted in the next version of WebDriverJS.
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
Also includes missing Angular map files. See plugins/accessibility/index.js for usage.
Additionally, add some tests to make sure that plugins can fail properly.
Closes #1842
(13d34c9) feat(a11yPlugin): add support for Tenon.io
(5f8cffd) feat(plugins): allow plugins to export a name for use in reporting
(aabdd56) fix(debugger): breakpoint isn't set properly for windows
(361ae21) fix(plugins): add a 'test' or 'fail' string to plugins
Closes #1843
Chromedriver 2.14 contains support for accessing elements inside 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'
}
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
(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
See #1813
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
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
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'"
See https://github.com/angular/protractor/blob/master/docs/debugging.md for usage.
Enables adding getMultiCapabilities: function(){}
to your configuration file. The function
returns either multiCapabilities or a promise of a multiCapabilities that is resolved after
beforeLaunch
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.
Enables adding restartBrowserBetweenTests: true
to your configuration file. Note that this will
slow down test suites considerably. Closes #1435
Now browser.getRegisteredMockModules()
returns a list of the functions or strings that have
been registered as mock modules. For troubleshooting.
Closes #1434.
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:
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
};
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.
Chromedriver to 2.13. CI browser version bumps for Chrome 39 and Firefox 34.
(adf30ba) fix(test): use a platform agnostic way to run minijasminenode
(50ee0b4) fix(test): allow to run 'npm start' or 'npm test' from windows too
(b28355d) fix(cucumber): emit on cucumber scenario instead of step
(33dcd77) fix(util): webdriver could deadlock
when prepare scripts containing promises are wrapped in a flow.execute
(a877268) fix(locators): ng-repeat-start should not return extra null element
(d505249) 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:
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.
You may now use config.resultJsonOutputFile
to specify a location for
output. See docs/referenceConf.js for more usage.
For information on usage, see plugins/ngHintPlugin.js
. More documentation
on plugins will be added soon.
Closes https://github.com/angular/protractor/issues/381
Usage: browser.forkNewDriverInstance
.
Improve error messages and add debug info when
element
Unify format used for warnings and errors.
setTestPreparer would always set the testPrepare to config.onprepare during
runner.run()
. This is breaking for code that relies on setTestPreparer directly.
(47f12ba) fix(clientsidescripts): make findByCssContainingText tolerate elements with no textContent/innerText
(6a9b87c) fix(elementexplorer): eval always treat result as promise
(289dbb9) fix(util): properly handle exceptions from onPrepare and onExit
(a132fac) 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
protractor.getInstance()
had been unused (replaced by global browser
in v0.12.0)
and is now removed.
Before:
var myBrowser2 = protractor.getInstance();
After:
// 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.
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.
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
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.
Upgrade to WebDriver 2.44.0 and ChromeDriver 2.12.
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
Closes #1378
(4f1fe68) feat(runner): Allow onCleanup to accept a file
(548f0c0) feat(webdriver): bump WebDriver to version 2.43
(466b383) 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()
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) 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
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 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.Modified protractor to support testing node-webkit by using string concatenation vs url.resolve() when the baseUrl begins with file://
Closes #1266.
This fixes issues with unzipping - see #1259
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.
This is a minor release with no functional changes. It contains a couple implementation switches that new versions of Angular will use.
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.
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.
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.
Use config.sauceSeleniumAddress
to connect to a custom URL for Sauce Labs.
Allow a comma-separated list of suites be provided on the command line, like
--suite=suite1,suite2
See https://github.com/angular/protractor/issues/1152
Other URLs use http, make chromedriver use this as well.
See https://github.com/angular/protractor/issues/1021
See https://github.com/angular/protractor/issues/1131
No changes from rc6.
This version contains a fix for too many timeout messages.
When angular/protractor@3c0e727136
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.
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)
Closes #1043
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.
browser.get(url, 4)
browser.get(url, 4000)
SafariDriver fails with data urls - see #1049. Reverting to use about:blank for now.
Except on internet explorer, which does not allow data urls.
Closes #1023.
This adds several options for the reporter, which can be included in protractor's
config.jasmineNodeOpts
// 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
This fixes extra logging when a timeout occurs.
(82c1d47) feat(protractor): add iteration index to ElementArrayFinder.each
(62bcf7e) 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.
(6906c93) feat(webdriver-manager): use proxy for webdriver-manager
(7d90880) feat(locators): implement by.options
(4e1cfe5) feature(launcher): aggregate failures at the end and output message from the launcher
(ff3d5eb) feat(locators): add toString() wrapper for this.message
(c892c2a) feat(protractor): implement reduce and filter for ElementArrayFinder
See https://github.com/angular/protractor/issues/877
Using browser.pause(portNumber) will now start the debugger on the specified port number.
Closes #956
See https://github.com/angular/protractor/issues/925
(6641c81) fix(launcher): report summary when specs fail
(36e0e0a) fix(protractor): allow exceptions from actions to be catchable
See https://github.com/angular/protractor/issues/959
It used to remove the last module - now is a noop.
Closes #764
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.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(a43f983) fix(protractor): make ElementFinder.then resolve to itself instead of null
(31d42a3) fix(protractor): throw index-out-of-bounds
See https://github.com/angular/protractor/issues/915
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
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'.
Version 0.24.0 introduced a bug where child processes would error without outputting the error message. Fix. See #902.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(7299155) feat(sauceprovider): append spec filename to capabilities.name
(f22456d) refactor(jasminewd): use jasminewd from its own node module
The Jasmine Webdriver Adapter is now its own npm module. The code has been moved to http://www.github.com/angular/jasminewd.
Remove the code from Protractor, and add a dependency on jasminewd@1.0.0.
(f23565d) feat(protractor): new API allowAnimations(bool) on protractor elements.
(876a3c0) feat(runner): support running dart2js spec files
This commit supports running Dart2JS output in NodeJS. Officially, Dart2JS in supposed to only generate code for running in a real webbrowser. With this patch, the dart2js code can also be executed in NodeJS.
This feature allows folks who are generating their spec files from a different language to see stack traces that use the line numbers from their sources before translation.
This commit introduces a dependency on the source-map-support
library.
For general information about sourcemaps, refer:
If any functions called by clientSideScripts throws a an exception that doesn't inherit from
Error
, the stack trace is completely unhelpful and the message is just "unknown error." This
commit wraps such errors into
Error
instances so that we have meaningful stack traces and the correct exception message.
(e.g. This is the common case when running dart2js code. This commit gives us the Dart stack
trace and exception message.)
In addition, I've pushed the construction of the string to install into the browser into clientsidescripts.js.
Closes #852
This should address #841
Ignoring the error and trying again has worked for all of my test cases, and the error has never occurred more than once in a row.
Previously, element.all(by.repeater('foo in foos')) would find non-element nodes for ng-repeat-start elements, which could cause IEDriver to fall over if the test tried to get text from those nodes.
(3c0e727) refactor(protractor): reorganize internal structure of elementFinder/webelement
element(By.x).clear().sendKeys('abc')
)element.all is chained differently
Before: element(By.x).element.all(By.y)
Now: element(By.x).all(By.y)
However, using element.all without chaining did not change,
i.e. `element.all(By.x)`
Changed the way for retrieving underlying webElements
Before: element(By.x).find(), element(By.x).findElement(By.y),
and element(By.x).findElements(By.y)
Now: element(By.x).getWebElement(),
element(By.x).element(By.y).getWebElement(),
and element(By.x).element(By.y).getWebElements(),
respectively
browser.findElement returns a raw WebElement so $, $$, and evaluate will no longer be available
(fbfc72b) feat(launcher): Add support for maxSession
changed the config to shard test files; also sharding is specific to capabilities now
Before: config.splitTestsBetweenCapabilities
Now: config.capabilities.shardTestFiles or config.multiCapabilities[index].shardTestFiles
(9e5d9e4) feat(locators): remove deprecated locator APIs
This is a breaking change. The following deprecated Locator APIs have been removed.
by.input
by.select
by.selectedOption
by.textarea
input
, select
, and textarea
can be replaced by by.model
.
element(by.selectedOption('foo'))
can be replaced by
element(by.model('foo')).$('option:checked')
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Navigating to an empty data URL won't work for internet explorer, sadly.
Reverting to about:blank. Will watch for flakes and explore other options.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Allow Protractor’s 'addMockModule' method to pass context to its mocks, providing an argument to the script which overrides a module. Rely on the WebDriver’s 'executeScript' method.
Closes #695
(546d41f) feat(sauceprovider): runner now prints a link to saucelabs test URL
(fd7fe4a) feat(launcher): Add support for splitTestsBetweenCapabilities.
(b93bf18) feat(elementFinder): keep a reference to the original locator
(98f4ba5) feat(locators): add by.exactBinding
Google changed selenium-server-standalone.jar's location and is returning 302 http module does not follow redirects
Closes #826
(95093c3) fix(configParser): don't run suite if specs are supplied
(27a5706) fix(loading): fix timeouts with about:blank removal
As documented at https://github.com/jnicklas/capybara/pull/1215 there are sometimes issues with webdriver and about:blank pages.
Switching instead to try a data url.
(cbcdb48) fix(runner): add -r for each cucumber require
(e36c32a) fix(jasminewd): Use promise.all to combine promises and done
(b5c18db) fix(drivers): prevent Sauce Labs login credentials from showing up in logs
Closes #754
(b85af50) fix(protractor): change angular-bootstrap wrapper for navigation
(8abea3c) fix(jasminewd): fix timeout for beforeEach and afterEach
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
This new locator find elements by css selector and inner text in response to the lack of ':contains' selector.
Example: By.cssContainingText('ul .pet', 'Dog') will find all ul children with class 'pet' containing the text 'Dog'.
Allow a faster way to navigate within the app. The current browser.get method forces the entire app to load every time you navigate to a new page. The proposed browser.setLocation method uses the same format as $location.url().
Closes #368
Closes #615
(b81cf5a) chore(webdriver): update WebDriverJS version to 2.41.0
(a96df4d) chore(minijasminenode): update to version 0.4.0.
This allows the use of because('message')
before expectations, to give additional information
when a failure occurs.
It also removes warnings for Node 0.11.* users about util.print being deprecated.
Closes #377
Closes #712
Closes #469
Accidentally got changed to 'excludes'. As discussed earlier, should be single to be consistent with Karma.
Closes #637
Prior, $(foo).$$(bar) would return a promise which resolved to an array of WebElements. This is unexpected, since $(foo).$(bar) returns an ElementFinder, and element(by.css(foo)).element.all(by.css(bar)) returns an ElementArrayFinder. Fixed so things are more consistent.
Closes #640
Closes #656
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(0c4ef69) feat(launcher): launcher outputs a final summary of how the browsers did
(f1db8b4) feat(runner): make runner an event emitter and log passes or failures from the launcher
Now, for runs with multiple capabilities, the launcher will output '.' or 'F' for each pass or fail instead of just '.' for every chunk of data. TODO - complete the event emitter API for the Cucumber runner.
(f9c4391) feat(cli+config): allow defining multiple test suites in the config and running them separately from the command line.
(06bd573) feat(pause): add the browser.pause method to enter a webdriver-specific debugger
Warning: this is still beta, there may be issues. Usage: In test code, insert a browser.pause()
statement. This will stop the test at that point in the webdriver control flow. No need to change
the command line you use to start the test. Once paused, you can step forward, pausing before
each webdriver command, and interact with the browser. Exit the debugger to continue the tests.
(43aff83)
fix(pageload): Changing how about:blank
unload waits Also changing executeScript
script
comment from //
to /**/
format. These two small changes should not affect functionality but
make Protractor work with Selendroid.
(1334662) fix(locators): Improve custom locators message
Increase readability of custom locator message by displaying each argument instead of the arguments object.
Closes #603
(26d67a2) fix(launcher): launcher should report a failure when only one capability is running
(9530a0c) (fix): Convert test.sh to test.js
This would enable the tests to be run on both Linux and Windows.
(6d85ab4) fix(jasminewd): display stack traces in correct order and with WebElement method failure details
(8964ac9) fix(test): Fixed path of configuration file to pass on windows
(99bda1a) fix(waitForAngular): when timeout overflows, at least pass the negative to error messages
Closes #622
Previously, do to an action such as drag and drop, one would have to use
element(by.foo).find()
. Now, just passing element(by.foo)
works. For example:
browser.actions().doubleClick(element(by.id('mybutton'))).perform();
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
17de697
](https://github.com/angular/protractor/commit/17de697fe9f64e238a8df0fbc6358b8e578e45f2
fix(debug): make new debug work on windows tooCloses #580
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(220d793), (6603a7e) chore(webdriver): update selenium version to 2.40.0 and download location
(ad5f3aa) feat(jasminewd): allow custom matchers to return promises
Allow custom jasmine matchers to return a promise which resolves to a boolean and match against the resolution of the promise
Motivation: Support for multiple tags on the cucumber test execution, to be able to filter with more complex expressions the scenarios to run.
How to use:
cucumberOpts: {
tags: '@dev'
}
or
cucumberOpts: {
tags: ['@dev', '~@ignore']
}
More information on tags: https://github.com/cucumber/cucumber/wiki/Tags
Closes #552
This allows users to continue to use optimist (or other process.argv) processing within their tests and grab values from the command line.
Closes #571.
(767c306), (02defe3) fix(jasminewd): include full pre-async-call stack trace in expectation failure message
(b6df2cf) fix(configParser): load coffee and LiveScript for child processes
Without loading coffee in configParser.js, child processes which try and load a coffeescript config file do not have coffee registered with node's required, and child tests fail.
Fixes an issue with using coffeescript config files.
When using a custom locator with multiple arguments, only the first argument was used when
calling webdriver.findElements
.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Adding simultaneous runner capability (grid-style), refactoring launch/runner init system, and abstracting out configParser module.
(642de06) feat(protractor): add removeMockModule method
(88c339f) feat(runner): add adapter for cucumber.js
Conflicts: lib/runner.js
(8924bbc) fix(cli): convert capabilities arguments to dot-notation for WebDriver compatibility
(a96d32f) fix(webdriver-manager): upcase in IE download url
The url for the Win32 version of the IEDriverServer is apparently case sensitive: win32 vs Win32
scope defaults to document, and is an optional argument so now be moved to the end. Came up from debugging and trying to use window.clientSideScripts.findInputs('username'); which failed. Refactored to match original intent.
BREAKING CHANGE: anything relying on clientsidescripts should no longer pass
element scope as first argument.
Before:
window.clientSideScripts.findInputs(document, 'username');
After:
window.clientSideScripts.findInputs('username', document);
// or simply
window.clientSideScripts.findInputs('username');
Also, any custom locators using addLocator will now break since the
arguments order has changed. To migrate the code follow the example below:
Before:
var findMenuItem = function() {
var domScope = arguments[0];
var myArg = arguments[1];
// balh blah blah
};
by.addLocator('menuItem', findMenuItem);
After:
var findMenuItem = function() {
var myArg = arguments[0];
var domScope = arguments[1];
// balh blah blah
};
by.addLocator('menuItem', findMenuItem);
Closes #497
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Fixes #495
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
The config now accepts exclude
, an array of patterns to exclude.
Adds client side JS implementations of by.buttonText and by.partialButtonText, enabling element lookup based on innerText.
Closes #452
Fixes #493
Implement support for multi-argument matchers in promise wrapper.
Closes #477
(11c4210) fix(testForAngular): add a message when page load does not complete in time
(6ae6261) refactor(waitForAngular): improve error messages when timeouts occur
(5dd93c2) fix(config): allow CoffeeScript 1.7 to be used
CoffeeScript now requires a register call to be made.
The 300 ms wait caused problems when testing IE on Sauce Labs. It seems way too short. "browser.get()" invariably timed out. Increasing it solved our problem.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Chaining calls to element will now build a scoped element finder. No webdriver functions will be called until a method (such as getText) is called on the final element. Example:
var elem = element(by.id('outer')).element(by.css('inner'));
browser.get('myPage');
elem.click();
Closes #340.
Add an onCleanUp callback to be able to hook into when all the tests have been run.
Conflicts: referenceConf.js
change lib/runner to allow setting mocha options from config.
Added a map function to element.all to apply a function to each element and return the result of the transformation.
Resolve promises if there is an object that contains multiple promises. Added index as a second argument to the map function callback.
Closes #392
Require CoffeeScript in the cli file to enable CS configuration and spec files.
Possibly fixes #38
Some systems would not wait for the browser unload event to finish before beginning the asynchronous script execution.
Only setup Selenium if there are actual spec files passed in
baseUrl
before ignoring synchronizationFixes issues where setting ignoreSynchronization = true
ignores the value of baseUrl
entirely.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Note: 0.16.0 was released as a canary - no changelog for it.
(a75fa04) docs(readme): add the travis status widget
(478c00a) feat(runner): add beta support for using mocha as your test framework
This change adds limited support for using mocha as the test framework instead of jasmine. Make
the switch by using --framework=mocha
on the command line or adding framework: 'mocha'
to the
config. Tests will be run using the BDD interface. The interface is adapted so that tests run
asynchronously without needing to call done()
.
Note that there is currently no support for an assertion framework, so you will need to require whichever assertion framework you prefer. This means there is no adapter to make the assertions unwrap promises, so you will need to resolve promises yourself and run the assertions afterwards.
Added seleniumPort command line option so that the standalone selenium server can be started with the supplied port number as opposed to the default port 4444.
$ webdriver-manager start --seleniumPort 4443
To allow the user to customize their framework, the protractor runner will now wait
until just before onPrepare
to load the framework. This means that jasmine
will
not be available in global until onPrepare
. For example, this means that requiring
the jasmine-reporters module must be done inside onPrepare, since that module expects
jasmine to be available at the time it is loaded.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
This is notable because in the newer 0.2.6 version of minijasminenode, ddescribe and iit are supported. These should be available after running an 'npm update'.
In some cases knowing when the runner has finished is a requirement (e.g. an async grunt task).
(d44ef01) feat(debugging): remove webdriver lines from stacktraces by default to improve readability
(33fa4a4) feat(locators): by model works for anything with a model, not just input
Notably, by.model will now find selects and textareas.
Closes #321.
Now, when ignoring synchronization, calls to browser.get are equivalent to calling browser.driver.get.
Closes #306
Usage:
element.all(by.model('foo')).each(function(webElement) {
// Do stuff with webElement.
});
Closes #298
Make by.repeat (and its column and row friends) work with ng-repeat-start and ng-repeat-end elements.
Fix "UnknownError: angular.element(...).data(...).$binding[0] is undefined" error raised when trying to use "by.binding" locator in any element of a page that contains at least one "bind-template" directive.
This addresses selenium server shutdown in two ways
if the user inputs to STDIN (e.g. press space) selenium will shut down gracefully
(e98f71e) fix(webdriver-manager): fix IEDriver install and running via windows
Changed the binaries.ie.url function to return the correct URL for the IEDriverServer. Created the zip object in the win32 section to be able to decompress IEDriverServer. Added a function to normalize a command across OS and spawn it. It allows start the webdriver in win32.
Seen here: https://github.com/yeoman/generator/blob/master/lib/actions/spawn_command.js
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Breaking Change.
As outlined in Issue #296, redoing the way the selenium/webdriver
install and run helper scripts work. Now, the 'webdriver-manager' script
will be available either locally or globally (depending on how protractor
was installed). It replaced install_selenium_standalone and the 'start' script
that was provided after install. Run webdriver-manager update
to download
new versions of selected webdriver binaries. Run webdriver-manager start
to start the standalone server. In addition, this fixes issues with running
the server starter in Windows, and allows automated downloading of the IEDriver.
Thanks to kurthong and vipper for their PRs with windows fixes, which were very useful in preparing this.
Closes #304
Closes #307
Closes #283
Breaking Change.
Your old selenium/start script will continue to work, but install_selenium_standalone no longer exists.
To do a clean update, remove the selenium folder. Then run
webdriver-manager update
Breaking Change Previously, onPrepare and specs were relative to the location of the config, but seleniumServerJar and chromeDriver were relative to the cwd when the test was called. If you were calling the tests from somewhere other than the same directory as the config location, you will need to change the paths of seleniumServerJar and/or chromeDriver. Closes #222.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(ce5f494) feat(element): element.all now has 'first' and 'last' methods
(ef61662) feat(runner): allow bypassing the selenium standalone server if running only chrome
Using the config option chromeOnly
now enables running ChromeDriver directly,
without going through the Selenium Standalone. The chromedriver binary should be
available in your PATH, or should be specified with the config option
chromeDriver
.
(76c094a) feat(getLocationAbsUrl) - allows current url to be obtained on IE (and Chrome/Firefox)
(6a1c918) feat(runner): add error message for bad jar path
(98bce7e) feat(locators): add the ability to add custom element locators with by.addLocator
Custom locators can now be added using by.addLocator(name, script), where script is a self-contained snippet to be executed on the browser which returns an array of elements. Closes #236.
Previously, the runner would throw an error if any one of the spec patterns did not match any files. Now it logs a warning in that case, and errors out only if there are no found files in any spec patterns. Closes #260
Closes #267
Closes #139.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(201b59c) feat(jasminewd): better error messaging when expect is called with a WebElement
(d383770) feat(clientsidescripts): better error reporting from testForAngular and waitForAngular
Update to the latest version of Chromedriver. This fixes the issue with OS X 10.9. Closes #181.
(ebc528f) fix(debugging): switch debugging tests to the new test app urls.
(8ff4787) fix(runner): exit with proper code when tests fail
When errors with messages matching /timeout/ were created, Protractor clears the control flow so that the remainder of the tasks scheduled for that spec don't bleed over into the next spec. This was messing up the promises used in the runner, since they are also webdriver promises. Long term, the runner should not use webdriver promises. For now, fix by having the runner resolve promises directly rather than through chaining, and add a TODO to use promises which aren't connected to WebDriver's control flow in the runner.
Closes #214.
(81501c5) fix(clientsidescripts): workaround for IE 8 "async page reload" init problem
(21264fd) fix(find): fix error when exposed to ng-options element with a default option
Protractor will now ignore elements with the ng-bind class that don't have a proper binding on their data, instead of blowing up when encoutering them.
Also add better description for what the command line options are.
Tiny breaking change:
Rename the 'includeStackTrace' command line option to 'stackTrace' for brevity.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
This change introduces major syntax updates. Using the new syntax is recommended, but the old version is still supported for now. Note also that the test application, docs, and example tests have been updated.
In an effort to make tests more readable and clear, a few more global variables will now be exported.
browser
is an instance of protractor. This was previously accessed using
protractor.getInstance
.
by
is a collection of element locators. Previously, this was protractor.By
.
$
is a shortcut for getting elements by css. $('.foo')
=== element(by.css('.foo'))
All changes should be backwards incompatible, as tested with the new 'backwardscompat' tests.
onPrepare can take a string, which is a filename containing a script to load adn execute before any tests run. This fixes the string to resolve the filename relative to the config file, instead of relative to the current working directory where protractor is called.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Adds a config object 'params' which is passed directly to instances of protractor. 'params' may contain nested objects, and can be changed via the command line as:
--params.login.user 'Joe' --params.login.password 'abc'
This change also switches to using optimist to parse command line flags for more flexibility and better usage documentation. Closes #32.
Introducing the $ shortcut method for finding a single element by css without having to call protractor.By.css. Additionally $$ for finding all elements by css.
Examples:
ptor.$$('.some .selector')
(7d74184) feat(explorer): add an interactive element explorer
When debugging or first writing test suites, you may find it helpful to try out Protractor commands without starting up the entire test suite. You can do this with the element explorer. This change introduces a first version of the element explorer. Closes #107
Now, finding an element with the strategy 'protractor.By.repeater()' returns a promise which will resolve to an array of WebElements, where each WebElement is a row in the repeater. Closes #149.
When using findElements with a css locator, wrap the returned list of elements with protractor specific functionality.
If all necessary fields are specified (e.g. seleniumAddress and at least one spec), a config file shouldn't be necessary.
BREAKING CHANGE: Finding rows with protractor.By.repeater now indexes from 0 instead of 1. This should be more familiar to most modern programmers. You will need to edit existing tests. Closes #90.
Before:
// The fourth foo
ptor.findElement(protractor.By.repeater('foo in foos').row(4));
After:
// The fourth foo
ptor.findElement(protractor.By.repeater('foo in foos').row(3));
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
To improve the readability of error messages, when waitForAngular times out it now produces a custom message. This should help clarify confusion for pages that continually poll using $interval. This change also adds more documentation on timeouts. See issue #109.
Adds better messages in the selenium server install script, and also makes the script output a 'start' executable which can be used to quickly start up the selenium standalone. not yet windows friendly. Closes #108.
Adds examples for how to log in when the login page is not written in Angular. New examples are in spec/login.
This onPrepare callback is useful when you want to do something with protractor before running the specs. For example, you might want to monkey-patch protractor with custom functions used by all the specs, or add the protractor instance to the globals. An example usage is shown in the spec/onPrepareConf.js file and its associated spec.
The cli usage says:
USAGE: protractor configFile [options] However, the options passed as argument are merged into the default configuration as soon as the configFile is met in the args parsing loop. This fix merges the options in the default configuration only after the loop, allowing to pass the options to the cli before or after, or around the config file.
Using jasmine.Matchers.prototype to generate the chained methods for expect() calls is flawed because it does not pick up custom matchers defined using addMatcher. Instead, use either the matchersClass for the current spec or from the environment.
getCurrentUrl, getPageSource, and getTitle should sync with Angular before executing. Closes #92.
(dd06756) fix(clientsidescripts): findElements and isElementPresent for protractor.By.select
(c607459) fix (navigation): The defer label should appear before other window names, not after.
(806f381) Fix: findElements() and isElementPresent() now work for protractor.By.input. Closes #79.
This changes the default script timeout from 100 seconds down to 11. Tests
which relied on extremely long timeouts will need to change the default script
timeout with driver.manage().timeouts().setScriptTimeout(<bigNumber>)
.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(0e8de99) Wrap WebElements with Protractor specific features. This change allows chained findElement calls to work with Protractor locators. It also adds a function, evaluate, to evaluate an angular expression in the context of a WebElement's scope.
(9f53118) Improving the command line interface (adding more options). This allows the --spec option to be passed with test files that will be resolved relative to the current directory. Smarter merging of default config values. Closes #65.
(73821fb) Adding an 'ignoreSynchronization' property to turn off Protractor's attempt to wait for Angular to be ready on a page. This can be used to test pages that poll with $timeout or $http.
(cfc6438) Adding support for isElementPresent with Protractor locators. Closes #11.
(8329b01) Adding waitForAngular calls before WebElement functions. Closes #37.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
Added documentation to the docs folder.
(08ef244) Adding debugging tests showing different types of timeouts, and fixing a bug where scheduled tasks from a previous it block would run into the next in case of a timeout.
(1c7eae0) Updating the binary script to understand debug, so that protractor debug conf.js works.
(7a59479) Adding a 'debug' function to protractor. This schedules a debugger pause within the webdriver control flow.
(679c82d) Mixing in all webdriver exports to protractor. This means that webdriver classes such as ActionSequence and Keys are accessible on the global protractor.
(3c76246) Added nested angular app (ng-app on an element other than <html>
or <body>
) capability via conf file.
Now running selenium 2.25. Requires updating WebDriverJS and the selenium standalone binary and chromedriver binary.
(a54abfb) Spec paths in configuration files are now resolved from the location of the spec file instead of the current working directory when the command line is run.
Note: Major version 0 releases are for initial development, and backwards incompatible changes may be introduced at any time.
(7966912) Updating to Selenium 2.24.
(90f0a94) Instead of having tests run with the protractor runner need to require() the protractor library, publish it to the global namespace. This insures the instance of protractor used within the tests is the same as the one used on the command line. Closes #36. Version bump for incompatible API changes.
(cb373c9) Adding glob matching to the spec files from the config. Closes #29.
Now running on selenium 2.24. Requires updating WebDriverJS and the selenium standalone binary.
The protractor runner now publishes protractor
to the global namespace and sets up the Jasmine-WebDriver adapter. Tests run with this should no longer include
// var protractor = require('protractor'); // No longer needed!
// require('protractor/jasminewd'); // No longer needed!
var ptor = protractor.getInstance(); // This should just work now.