use launchPersistentContext instead of storageState, works in headful now, support multiple games

This commit is contained in:
Ralf Vogler 2021-12-31 02:40:41 +01:00
parent db1b61d797
commit e34a5fed60
4 changed files with 82 additions and 62 deletions

View file

@ -48,6 +48,7 @@ const { chromium } = require('playwright');
}
const page = await context.newPage();
console.log('userAgent:', await page.evaluate(() => navigator.userAgent));
await page.goto('https://www.epicgames.com/store/en-US/free-games');
// await expect(page.locator('a[role="button"]:has-text("Sign In")')).toHaveCount(0);
await page.click('button:has-text("Accept All Cookies")'); // to not waste screen space in --debug