Skip to content

question regarding globalSetup and globalTeardown #686

Open
@jdsmith2816

Description

@jdsmith2816

I am attempting to utilize globalSetup and globalTeardown to implement authentication once per suite rather than once per test.

In jest.config I customize the browsers array via environment variables like so

let browsers = ['chromium'];

if (process.env.E2E_BROWSERS) {
  browsers = process.env.E2E_BROWSERS.split(' ');
}

What is the proper way to inject the storage state into the currently available browser? The examples in the documentation assume the use of just one browser, chromium.

I saw an example from @mmarkelov that might be relevant but it appears to have been written a few months before PlaywrightEnvironment was introduced to jest-playwright

Any guidance is greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions