minor adjustments
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { chromium } from 'playwright';
|
||||
const browser = await chromium.launch();
|
||||
for (const [label, supporter] of [['plain', false], ['supporter', true]]) {
|
||||
const ctx = await browser.newContext({ viewport: { width: 1280, height: 950 } });
|
||||
if (supporter) await ctx.addInitScript(() => localStorage.setItem('supporter_cache_v1', JSON.stringify({ valid: true, expires: null, checkedAt: 1785578719118 })));
|
||||
const page = await ctx.newPage();
|
||||
await page.goto('http://localhost:5186/en/weather/week/berlin/', { waitUntil: 'load', timeout: 120000 });
|
||||
await page.waitForTimeout(9000);
|
||||
const btn = page.getByRole('button', { name: /Support Drizz|Supporter extras/ }).first();
|
||||
await btn.screenshot({ path: `/tmp/badge-${label}.png` });
|
||||
await ctx.close();
|
||||
}
|
||||
// locked panel
|
||||
const ctx = await browser.newContext({ viewport: { width: 1280, height: 950 } });
|
||||
const page = await ctx.newPage();
|
||||
await page.goto('http://localhost:5186/en/weather/seasonal/berlin/', { waitUntil: 'load', timeout: 120000 });
|
||||
await page.waitForTimeout(6000);
|
||||
await page.locator('h2').first().locator('xpath=..').screenshot({ path: '/tmp/badge-panel.png' }).catch(() => {});
|
||||
console.log('ok');
|
||||
await browser.close();
|
||||
Reference in New Issue
Block a user