protractor: Add closeBrowserOnExit option
As discussed previously in #1425, now that Protractor is able to always close all browser instances when ending its process, it would be good to have the option to avoid this for debugging purposes.
i.e. Imagine having a closeBrowserOnExit
setting that, when it is false
, will let Protractor leave any remaining browser instance open after finishing its test run.
That setting default value would be true
though.
It would be useful because I think that the developer sometimes wants to access the browser “as-is” to inspect the page or logs and find out why a test framework (jasmine, cucumber, etc…) failed to close it automatically.
Just food for thought…
About this issue
- Original URL
- State: open
- Created 10 years ago
- Reactions: 5
- Comments: 18 (8 by maintainers)
There’s a thing that is driving us crazy. Our e2e tests fail randomly. You can’t use
pause()
in this case. Using debug allover the place is not a clean option.There should be an option that stops protractor on failure, so you can debug the problem. Right now it’s not possible at all in our case and it’s really frustrating, causing our tests to have almost no value at all.
I have the same situation as topic starter. I used to develop on java + selenium webdriver and had to call driver.quit() in @after method. So when I needed to interact with browser I just commented out that line. I started to work in team that uses protractor for their tests and I’m in situation when I need to find faulty locator in some page that is hard to get to manually (you have to go through a long process of data inputs etc). I’m new to protractor and quite surprised that it doesn’t have “closeBrowserOnExit” suggested above
I want to throw my two cents in here.
I was writing a test, and suddenly chrome just closed while I was running it and protractor spat this out:
This is not very useful, especially since if I have a long test and I’m not paying attention to chrome, I have no idea why it crashed because the error message gives no hint as to where it died and I can’t look in the browser because protractor closed it. I COULD go through every single line in the it() and add
browser.pause()
statements, but it’s incredibly frustrating seeing that it would be so much easier to fix if the browser didn’t close every time.Protractor is supposed to make devs lives easier, but damn is it painful to write tests for.
You can… but when you have a a test with 10 assertions you then have to narrow down where the error happens and re-run the test… it would be nice to have the option for the test not to kill the driver so you can explore the test failure right after the assertion has failed and see what caused the failure…