minor adjustments

This commit is contained in:
Vincent van der Wal
2026-08-01 16:07:32 +02:00
parent 17cf8df109
commit ae88140f79
13 changed files with 129 additions and 122 deletions
+20
View File
@@ -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();