From 397d47b4b5a16957be8cdd8d3b1fdbd48ce8386f Mon Sep 17 00:00:00 2001 From: zomars Date: Wed, 31 Aug 2022 12:28:29 -0600 Subject: [PATCH] Clean up auth state after all E2E tests are done --- tests/config/globalSetup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/config/globalSetup.ts b/tests/config/globalSetup.ts index 63fd56d4bd..289db77983 100644 --- a/tests/config/globalSetup.ts +++ b/tests/config/globalSetup.ts @@ -38,6 +38,11 @@ async function globalSetup(/* config: FullConfig */) { // await loginAsUser("teamfree", browser); await loginAsUser("teampro", browser); await browser.close(); + // Clean up auth state after all tests are done + return () => { + const dir = `playwright/artifacts`; + fs.readdirSync(dir).forEach((f) => fs.rmSync(`${dir}/${f}`)); + }; } export default globalSetup;