← back to Consulting Rentv Com
scripts/prod-check.mjs
38 lines
#!/usr/bin/env node
// prod-check.mjs — load the LIVE prod consulting portal in a real Chromium (browser
// fingerprint passes the edge WAF that 403's curl), screenshot it, and probe the content
// so we can definitively confirm prod is serving the refreshed 141KB growth page. $0 / local.
import { chromium } from 'playwright';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
const HERE = dirname(fileURLToPath(import.meta.url));
const OUT = join(HERE, '..', 'reports');
const URL = 'https://rentv.agentabrams.com/consulting/portal.html';
const b = await chromium.launch();
const ctx = await b.newContext({ viewport: { width: 1440, height: 1400 } });
const pg = await ctx.newPage();
let status = null;
pg.on('response', r => { if (r.url().startsWith(URL.split('?')[0])) status = r.status(); });
await pg.goto(URL, { waitUntil: 'networkidle', timeout: 45000 }).catch(e => console.error('goto:', e.message));
await pg.evaluate(() => { document.body && (document.body.style.display = 'block'); }).catch(()=>{});
await pg.waitForTimeout(1500);
const probe = await pg.evaluate(() => {
const html = document.documentElement.outerHTML;
return {
title: document.title,
htmlBytes: html.length,
hasDaynightPin: /html,body\{background:#000!important/.test(html),
bodyBg: getComputedStyle(document.body).backgroundColor,
// pull a couple of visible deal addresses to prove the refreshed CRCP data rendered
dealCards: Array.from(document.querySelectorAll('[class*="deal"], .deal-card, .card')).slice(0,3)
.map(el => (el.textContent||'').replace(/\s+/g,' ').trim().slice(0,80)),
};
});
console.log('HTTP status:', status);
console.log(JSON.stringify(probe, null, 2));
await pg.screenshot({ path: join(OUT, 'prod-portal.png'), fullPage: false });
console.log('screenshot -> reports/prod-portal.png');
await b.close();