Skip to content

Commit

Permalink
test remove cache
Browse files Browse the repository at this point in the history
  • Loading branch information
annarhughes committed Dec 20, 2023
1 parent d005ccd commit b0e0b85
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions config/puppeteerLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@ async function login(page) {
await page.waitForSelector('input[type="email"]', { visible: false });
}

let counter = 1;

/**
* @param {puppeteer.Browser} browser
* @param {{url: string, options: LHCI.CollectCommand.Options}} context
*/
async function setup(browser, context) {
// launch browser for LHCI
const page = await browser.newPage();
await page.setCacheEnabled(true);

if (counter === 1) {
await login(page);
} else {
await page.goto(context.url);
}
await login(page);
await page.goto(context.url);
// close session for next run
await page.close();
counter++;
}

module.exports = setup;

0 comments on commit b0e0b85

Please sign in to comment.