eg: cookie comment
This commit is contained in:
parent
6305ffd15d
commit
cf9c31e544
1 changed files with 2 additions and 3 deletions
|
|
@ -63,12 +63,11 @@ const page = context.pages().length ? context.pages()[0] : await context.newPage
|
||||||
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await context.addCookies([{name: 'OptanonAlertBoxClosed', value: '2022-10-06T21:15:28.081Z', domain: '.epicgames.com', path: '/'}]);
|
await context.addCookies([{name: 'OptanonAlertBoxClosed', value: '2022-10-06T21:15:28.081Z', domain: '.epicgames.com', path: '/'}]); // Accept cookies to get rid of banner to save space on screen.
|
||||||
|
|
||||||
await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // 'domcontentloaded' faster than default 'load' https://playwright.dev/docs/api/class-page#page-goto
|
await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // 'domcontentloaded' faster than default 'load' https://playwright.dev/docs/api/class-page#page-goto
|
||||||
|
|
||||||
// Accept cookies to get rid of banner to save space on screen. Clicking this did not always work since the message was animated in too slowly.
|
// page.click('button:has-text("Accept All Cookies")').catch(_ => { }); // Not needed anymore since we set the cookie above. Clicking this did not always work since the message was animated in too slowly.
|
||||||
// page.click('button:has-text("Accept All Cookies")').catch(_ => { }); // not needed anymore since we set the cookie above
|
|
||||||
|
|
||||||
while (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) {
|
while (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) {
|
||||||
console.error('Not signed in anymore. Please login in the browser or here in the terminal.');
|
console.error('Not signed in anymore. Please login in the browser or here in the terminal.');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue