Rayrun
← Back to Discord Forum

Is it possible to authenticate once for multiple test in multiple test files ?

I authenticate as dependency in setup but my dep get executed once for each test file. I want this only one for all test files. Any idea / example to share pls ? (most test files have multiple tests)

This thread is trying to answer question "Is it possible to authenticate once for multiple tests in multiple test files?"

8 replies
dadamsgreenspark

I have a globalSetup file that is run before my tests. https://playwright.dev/docs/test-global-setup-teardown

dadamsgreenspark

that globalSetup creates a storageState json file that is then loaded into the browser

it get execute only once for multiple test files ?

dadamsgreenspark

I am authenticated for all tests after that

dadamsgreenspark

yes. read that global set up doc for more info

dadamsgreenspark

I authenticate to our AWS Cognito provider and save the results of that

Thx !

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.