Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow protractor to use promise as capabilities for multiCapabilities #1594

Closed
hankduan opened this issue Dec 4, 2014 · 3 comments

Comments

@hankduan
Copy link
Contributor

hankduan commented Dec 4, 2014

related:
http://stackoverflow.com/questions/27264146/setting-firefox-profile-in-a-setup-with-multiple-browsers
http://stackoverflow.com/questions/26435438/creating-another-session-with-a-separate-firefox-profile-in-protractor
#1040
#1592

Right now, protractor can only accept promise as capabilities if we are NOT using multicapabilities. The reason for this is because multiCapabilities runs each task in a new process, so the promise (function) cannot be passed (single capabilities work because we're not forking). Alternatively we could resolve capabilities in the launcher, before passing the resolved capabilities into the new processes; however, this will break #1040, which relies on capability promises to be resolved after driverProvider setup (i.e. for proxy purposes).

I can't think of an easy way of doing this (without large refactoring), but it is definitely doable. Just creating this issue to get a feel of how many people would benefit from being able to use promises in multiCapabilities and/or collect ideas.

@alecxe
Copy link
Contributor

alecxe commented Dec 4, 2014

I would definitely benefit from this. Right now, I have to handle 2 different protractor configs and run protractor twice (see http://stackoverflow.com/questions/27264146/setting-firefox-profile-in-a-setup-with-multiple-browsers).

@hankduan thanks for creating the feature request.

@hankduan
Copy link
Contributor Author

hankduan commented Dec 9, 2014

fyi, this is how to do it if we don't have the constraint from #1040:
#1592

@hankduan
Copy link
Contributor Author

#1629 achieves this. You can pass in a function to config.getMultiCapabilities like onPrepare and onCleanup. This function can return a promise to multiCapabilties (i.e. array of capabilities).

See https://github.com/angular/protractor/blob/master/spec/getCapabilitiesConf.js for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants