You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
liamdocherty10
changed the title
[Question] Is it possible to share the browser between globalSetup and globalTeardown
[Question] Is it possible to share the browser between globalSetup and globalTeardown?
Aug 24, 2022
globalSetup and globalTeardown both run in the same process, so you can store the browser in a shared variable during setup and read it in global teardown:
We are currently using
globalSetup
in order to log in as admin user and setup data, thenglobalTeardown
to delete the data at the end.At the moment, both global functions are launching a browser and logging in as the admin user.
This works, but is there a way to share the same browser/ browser context instance between setup and teardown?
This would improve our efficiency since there is nothing in our tests that invalidates the session still active in the setup browser.
E.g.
The text was updated successfully, but these errors were encountered: