cuprite
cuprite copied to clipboard
Should we create a new browser context on reset?
Problem
Currently, when using Cuprite with a typical Capybara setup with Capybara.reset_sessions! after each test, a new blank context is created after each test.
When running tests in a heady mode, it results in stale blank pages left open at the end of the test suite run.
Also, if a test uses multiple sessions, the second one is left open (while the first one is reused).
Solution
Looks like removing a call to #attach_page from here should do the trick: https://github.com/rubycdp/cuprite/blob/2bbf3634d92af4e8b8ec3026c2b66ccf1d0590ad/lib/capybara/cuprite/browser.rb#L34
The question is: what was the purpose of adding it here (and not initializing a page lazily)?