This thread is trying to answer question "Is there any way we can retry global setup as well as beforeAll hook when fetching a bearer token fails?"
You could use expect.toPass
in your global setup so it retries the attempt to get the token:
https://playwright.dev/docs/test-assertions#expecttopass
Or you could make your global setup a project dependency, then it should be retried according to your retry config: https://playwright.dev/docs/test-global-setup-teardown#project-dependencies
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 [email protected].