diff --git a/packages/vue/__tests__/e2eUtils.ts b/packages/vue/__tests__/e2eUtils.ts index a60f797d..2af3befc 100644 --- a/packages/vue/__tests__/e2eUtils.ts +++ b/packages/vue/__tests__/e2eUtils.ts @@ -28,10 +28,17 @@ export function setupPuppeteer() { let browser: puppeteer.Browser let page: puppeteer.Page - beforeEach(async () => { + beforeAll(async () => { browser = await puppeteer.launch(puppeteerOptions) + }) + + beforeEach(async () => { page = await browser.newPage() + await page.evaluateOnNewDocument(() => { + localStorage.clear() + }) + page.on('console', e => { if (e.type() === 'error') { const err = e.args()[0] as any @@ -44,6 +51,10 @@ export function setupPuppeteer() { }) afterEach(async () => { + await page.close() + }) + + afterAll(async () => { await browser.close() })