From 86d9818abfc160dac031bb292abe28d6f28fc624 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Oct 2026 12:02:51 -0700 Subject: Browser tests: public relays answered in the page, never reached A suite run let ~90 throwaway test wallets subscribe and publish on public relays from one home address, and nos.lol and relay.damus.io banned it. tools/puppeteer.js wraps puppeteer-core: every socket to a non-local host gets an in-page stand-in relay (EVENT -> OK, REQ -> EOSE). Tests that read real content launch with { relays: 'read' } (real reads, publishes answered in place); feed-live, chat-layout and cordn-ui launch with { relays: 'live' }. LIVE_RELAYS=read|1|host,... overrides per run. profile-key-qr: measure the QR again if a repaint swapped it out. Co-Authored-By: Claude Opus 5.5 --- tools/feed-media-cache-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/feed-media-cache-test.js') diff --git a/tools/feed-media-cache-test.js b/tools/feed-media-cache-test.js index 46c485d..02850ef 100644 --- a/tools/feed-media-cache-test.js +++ b/tools/feed-media-cache-test.js @@ -3,7 +3,7 @@ // slow picture), a reload paints the grid from that cache at once and // resumes the crawl where it stopped, and tile frames are kept as pictures. // Run: bun tools/feed-media-cache-test.js -import puppeteer from 'puppeteer-core'; +import puppeteer from './puppeteer.js'; import { cacheKeyFor } from '../src/wallet.js'; import { generateSecretKey, getPublicKey, finalizeEvent } from 'nostr-tools/pure'; import { buildHtml } from '../build.js'; @@ -64,7 +64,7 @@ all.push(tagged(151, 'size hidden ' + base + '/h/h4.mp4', base + '/h/h4.mp4')); all.push(tagged(152, 'no cors ' + base + '/n/n5.mp4', base + '/n/n5.mp4')); all.push(tagged(153, 'seen in the feed first ' + base + '/r/r6.mp4', base + '/r/r6.mp4')); -const browser = await puppeteer.launch({ executablePath: process.env.CHROME || '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'] }); +const browser = await puppeteer.launch({ relays: 'read', executablePath: process.env.CHROME || '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'] }); const page = await browser.newPage(); await page.evaluateOnNewDocument(([evs, pk]) => { window.__reqs = []; -- cgit v1.2.3