microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
777 stars 34 forks source link

Global setup phase #177

Closed arjunattam closed 3 years ago

arjunattam commented 4 years ago

To avoid repetitive execution of authentication steps, some of our users rely on a global setup that 1/ logs in via the UI, 2/ extracts login state (cookies/storage), and 3/ load state in new contexts with beforeEach. To enable this scenario, the Playwright test runner could support a global setup phase.

andrewmclagan commented 3 years ago

I came here looking for just this. Elaborating on our use-case:

Used for running initial app migrations / seeds

jsjoeio commented 3 years ago

Are there any updates on this? Looking to migrate from playwright-test and we would like this.

Our global setup currently looks like this.

dgozman commented 3 years ago

Are there any updates on this? Looking to migrate from playwright-test and we would like this.

Our global setup currently looks like this.

It is currently only documented in upstream folio: https://github.com/microsoft/folio#global-setup-and-teardown. We are working on the better documentation here.

mxschmitt commented 3 years ago

We have a global setup now integration, see here: https://playwright.dev/docs/test-advanced#global-setup-and-teardown