#!/usr/bin/env node
import { chromium } from '@playwright/test';

const ACCOUNT_ADDRESS = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266';
const WEBAPP_URL = 'http://localhost:8081';

const browser = await chromium.launch({ headless: true });
const context = await browser.newContext();

// Set auth
await context.addInitScript(() => {
  window.localStorage.setItem('authentificated', 'true');
});

const page = await context.newPage();

console.log('Loading stake page...');
await page.goto(`${WEBAPP_URL}/app/#/stake`, { waitUntil: 'networkidle' });
await page.waitForTimeout(3000);

console.log('Taking screenshot...');
await page.screenshot({ path: 'stake-page-final.png', fullPage: true });
console.log('Screenshot saved to stake-page-final.png');

await browser.close();
