Clean up auth state after all E2E tests are done

pull/4066/head^2
zomars 2022-08-31 12:28:29 -06:00
parent e020bb9758
commit 397d47b4b5
1 changed files with 5 additions and 0 deletions

View File

@ -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;