angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Add plugin hook for createBrowser #4230

Open sjelin opened 7 years ago

sjelin commented 7 years ago

People want to modify the capabilities of a browser before it is created. Seems like a legitimate use case to me. We should add a plugin hook at the top of Runner#createBrowser().

NickTomlin commented 7 years ago

👍

Do we have a diagram or documentation on all the hooks/possible transformations? I feel like it would be awesome to review the current state and then come up with an "ideal" state of lifecycle methods we could expose.

seanmay commented 7 years ago

I feel like this is the appropriate short-term solution.

It might cause future headaches, in terms of plugins monkey-patching content, especially if we ever look at separating the direct Selenium WebDriver bindings from that object (something I'm working on initial steps for, by turning it into a façade that proxies calls, rather than a subclass). But this shouldn't hurt too many people, and if they're taking this tack, it seems like either they aren't going to be using TS types, or they don't care about any leaking into their tests, anyway.