angular/protractor — pull request #1537 by jonhoo (2014-11-18 01:38:00+00:00)
Title: Support spawning additional browser instances

Many end-to-end application tests require having multiple browser instances (windows/tabs/etc.) open at the same time so that functionality across clients can be tested. This patch implements a `newInstance` method on `Protractor.prototype` which returns a new `Protractor` wrapping a new instance of the underlying driver.

Drivers can advertise that they support this capability by exposing the `newDriverInstance` method (no arguments). This patch also implements this feature for the `direct` provider. Porting to other driver providers *should* be fairly straightforward, but has not been attempted.

Notes about the patchset:
- `Protractor` now needs to have access to the driver provider, and not just the provider. It also needs access to certain parts of the config (from `Runner`) so that it can correctly set script timeouts. This has currently been solved by passing in the entire `Runner` to prevent an excessive number of arguments. Perhaps a better approach would be to make a config object where the necessary parameters (including `baseUrl` and `rootEl`) are contained.
- Setting the script timeout is currently done by `Runner` (and now `Protractor`). Would it not be better for this to always be done by the driver? Or maybe even now by `Protractor`?
- Should `newDriverInstance` be added to the driver provider [interface overview](lib/driverProviders/README.md)?

This PR fixes #381.