I am testing an app which has login via Google account. Is it possible to do anything in Playwright, so that it behaves like a conventional browser. By that I mean that I don't need to login into the app via Google account every time I try to use an app, because Browser already knows I logged in into Google account. However, in Playwright I login each time for each test. I want to speed this process up by bypassing Google login.
What I tried so far.
Here https://playwright.dev/python/docs/auth . I stored state.json with one test by using context.storage_state(path="state.json")
. And tried to add it into another test with the following command browser.new_context(storage_state="state.json")
.
For some reason that does not help.
Tried to load state.json into actual json object and use context.add_cookies(cookies)
, but alo with no success.
Anyone has experience with such a task?
This thread is trying to answer question "Is it possible to bypass Google login in Playwright while testing an app?"
If it turns out that you are, take a look at https://github.com/microsoft/playwright/issues/11164. Skip the whole extraneous debate about how Firebase stores its data. There are a few solutions in there. Also, please ๐ the issue if you agree we need this to help get more attention on it! If not, this message won't help you and sorry about that.
The timing of this question is impeccable lol I'm trying to use Playwright for logging in with Google auth in my Firebase app that I'm building for a #100DaysOfCode challenge right now on X.
Here's a more precise link to where the solution starts, @guitarsngames:
https://github.com/microsoft/playwright/issues/11164#issuecomment-1633293473
I haven't tried it yet but I'm excited to rip into it and give you props if it fixes my problem, @jennifer0419 ๐
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].