import { chromium } from 'playwright-core'; import { PAGE } from './paths.mjs'; const b = await chromium.launch({ executablePath: process.env.CH }); const p = await b.newPage(); const errs = []; p.on('pageerror', e => errs.push(e.message)); await p.goto(PAGE('site/index.html')); await p.waitForTimeout(1000); await p.focus('#byoA'); const v = await p.inputValue('#byoA'); await p.type('#byoA', 'Lond'); const opts = await p.$$eval('#byocities option', o => o.filter(x => x.value.toLowerCase().startsWith('lond')).map(x => x.value)); console.log('after focus:', JSON.stringify(v), 'matches for "Lond":', opts.slice(0, 4), 'ERRORS', JSON.stringify(errs)); await b.close();