Rayrun
← Back to Discord Forum

Bypassing Google Authentication Implemented with Next-auth for E2E Testing Using Playwright in App.

shirotamakiposted in #help-playwright
Open in Discord
shirotamaki
shirotamaki

Hello, Bypassing Google Authentication Implemented with Next-auth for E2E Testing Using Playwright in a Next.js App.

I am currently developing an application using Next.js and have implemented Google Login authentication using Next-auth. In this application, most functionalities are only accessible after successful login.

I aim to implement E2E testing for these post-login functionalities. However, I've encountered a challenge: the Google Login process involves real-world external systems, which I can't programmatically authenticate in test cases.

This issue has become a roadblock, preventing me from performing E2E tests as I am unable to bypass the Google Login authentication in my testing environment.

Please note that my goal is not to test the Google login functionality itself, but the features and functionalities that become available once login is successful.

Therefore, I'm seeking advice or methods to bypass Google Login authentication for testing purposes, allowing me to proceed with E2E testing for post-login features.

This thread is trying to answer question "How can I bypass Google Login authentication implemented with Next-auth for E2E testing using Playwright in a Next.js app?"

4 replies

There are some topics already. You can use storage session and global setup

shirotamaki
shirotamaki
@rluisn1: Thank you for comment. So all you have to do is run a storage session or global setup. I will first look into this based on the keywords you gave me.

Thank you for comment. So all you have to do is run a storage session or global setup.

I will first look into this based on the keywords you gave me.

Sure, this examples may help you, using global setup

https://playwright.dev/docs/auth#session-storage

shirotamaki
shirotamaki
@rluisn1: Thank you

Thank you

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

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 luc@ray.run.