Rayrun
โ† Back to Discord Forum

auth.setup.ts not running (following documentation)

augustinsorelposted in #help-playwright
Open in Discord
augustinsorel

Hi guys,

I am trying to add e2e tests with playwright and I am following the documentation (https://playwright.dev/docs/auth) I have copied the exact same code from the docs but I encounter an error with it. I get:

I am guessing that my auth.setup.ts file isn't being run. As I can't see any user.json output. I have tried to create that user.json file manually but that does not solve the error.

Any help would be very much appricated ๐Ÿ™Œ

Here is my github repo if it helps: https://github.com/AugustinSorel/gym-graphs/tree/FEAT/e2e-oauth And here is the code:

This thread is trying to answer question "Why isn't 'auth.setup.ts' being executed, and why is 'user.json' not being generated when following the Playwright documentation for authentication in e2e tests?"

3 replies
augustinsorel

auth.setup.ts

config file:

augustinsorel

ok never mind It turns out running npx playwright test --ui does not trigger the auth.setup.ts

augustinsorel

but npx playwright test will

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.