Closed matthewp closed 5 years ago
Just a question. Is it still possible to use page.js without page.create({...})
, just by calling page()
?
@paulocoghi Yeah, this doesn't break any existing usage at all. It's a refactor so that instead of having the global state it's all contained within an instance. So there's still the default instance that is exported and covers 99% of everyone's needs. No worries, wouldn't ever want to get away from page.js' ease of use! :)
Looks like the refactor decreased test coverage by 2.5%! Since no tests were removed I'm guessing that it exposed some stuff that wasn't being tested before. Think I can increase this by testing the new .configure()
and by testing the unhandled
function.
Hi to all. Any updates about this improvement are it going to be in next release ? Thanks.
Just need to find the time to fix the test coverage.
Finally!
This adds a new feature,
page.create()
that allows for there to be multiple pages. Callingpage.create(options)
create a new page function that behaves just like the global page. It contains its own internal state, options, and event handlers. You can target the page to another window, like an iframe or a popup, if you want.The main reason for adding this feature was to clean up or testing infrastructure. Numerous things had to be done in the past to make sure each test was cleanly in isolation. That stuff is no longer necessary now that we can just create a new page instance for each test.
Closes #13