Closed KATT closed 3 years ago
You are obviously also using Playwright + Jest, but I'm getting a feeling our setups look a bit differently. Would be amazing to see how you use it, either if you explained a bit more in detail or maybe did an examples/react-app
🙏
Edit - on further inspection, it doesn't really seem to to work to first open a page in a BrowserContext
to login and then simply doing a .newPage()
and assume being logged in..
Closing this - did a workaround with a custom useBeforeEach(loginProvider(...))
After login it is necessary to save the browser context for later reuse.
Ideas welcome on how we can improve the standard provider library.
But yeah it is trivial to roll your own too.
Perceived Problem
I was expecting to reuse the same auth and only do auth once in
beforeAll
(speeds tests up a lot).https://github.com/prisma-labs/kont/blob/b3cd265545ea39e4c0d908be5b2e9b84787f832f/src/Providers/Page/Page.ts#L62-L66
Ideas / Proposed Solution(s)
providers.browsers()
could instead make a context.page()
providers.page()
intoproviders.context()
+providers.page()
Further context
My draft PR with adding kont with our existing jest/Playwright setup: https://github.com/calendso/calendso/pull/931
I've written my own
loginProvider
and trying to use this code: