Team + Ads colour (Orlando's ask): Team rows carry the Pipeline stage colours (stripe + stage pill), amber quiet-3+-days flag and filter chip; ad status traffic light (live, running low at 80% spent, out, paused) on the pill, row stripe and budget bar; QA walk rebuilt for the Control Room sign-in and rail screens; cache tags bumped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-20 07:22:44 -05:00
parent 24814c9a41
commit 08bfa2afd7
16 changed files with 167 additions and 125 deletions
+34 -16
View File
@@ -1,6 +1,6 @@
// InstantAdPay QA harness: site walk.
// node qa/walk.mjs public -> live public pages (no sign-in): errors, failed requests, broken images, dead links, mobile
// node qa/walk.mjs member -> local copy: sign in, every member pane + sub-tab, every admin pane, forms
// node qa/walk.mjs member -> local copy: Control Room sign-in, every rail screen, the /tools panes + sub-tabs, every admin pane, forms
// node qa/walk.mjs all -> both
// Env: LIVE (default https://instantadpay.com), LOCAL (default http://127.0.0.1:8796), OUT (report dir),
// PW (playwright package dir; default D:/Projects/MarketingAgent/qa-tester/node_modules/playwright)
@@ -16,7 +16,7 @@ const OUT = process.env.OUT || 'qa/out';
fs.mkdirSync(OUT, { recursive: true });
const findings = [];
const note = (sev, where, what) => findings.push({ sev, where, what });
const NOISE = /walletconnect|reown|web3modal|coingecko|fonts\.|\/api\/feed\/live|\/api\/auth\/logout/;
const NOISE = /walletconnect|reown|web3modal|coingecko|fonts\.|\/api\/feed\/live|\/api\/auth\/logout|\/api\/me(\?|$)|\/api\/my\/support/; // /api/me aborts when the shell reloads after sign-in; the support desk is not reachable from a local copy
function watch(page, base) {
const bag = { console: [], failed: [], status: [] };
@@ -25,11 +25,11 @@ function watch(page, base) {
if (m.type() !== 'error') return;
const loc = (m.location() && m.location().url) || '';
if (loc && !loc.startsWith(base)) return; // third-party or framed page, not ours
if (/status of (400|401|404)/.test(m.text())) return; // expected API answers surface as console noise
if (/status of (400|401|404)/.test(m.text()) || /status of 503/.test(m.text()) && /\/api\/my\/support/.test(loc)) return; // expected API answers surface as console noise
bag.console.push(m.text());
});
page.on('requestfailed', r => { const u = r.url(); if (u.startsWith(base) && !NOISE.test(u)) bag.failed.push(u + ' ' + (r.failure() && r.failure().errorText)); });
page.on('response', r => { const st = r.status(); const u = r.url(); if (st >= 500 && u.startsWith(base)) bag.status.push(st + ' ' + u); });
page.on('response', r => { const st = r.status(); const u = r.url(); if (st >= 500 && u.startsWith(base) && !(st === 503 && /\/api\/my\/support/.test(u))) bag.status.push(st + ' ' + u); });
return bag;
}
function flush(bag, label) {
@@ -93,14 +93,30 @@ if (MODE === 'member' || MODE === 'all') {
const page = await ctx.newPage(); const bag = watch(page, LOCAL);
page.on('dialog', d => d.accept());
const L = 'LOCAL ';
await page.goto(LOCAL + '/my', { waitUntil: 'networkidle' });
await page.fill('#mcEmail', 'qa-walk@example.com'); await page.click('#mcSendBtn');
await page.waitForSelector('#mcVerifyBtn:not([hidden])'); await page.click('#mcVerifyBtn'); await page.waitForTimeout(2000);
if (await page.$('#onboardModal:not([hidden])')) { await page.fill('#obUsername', 'qawalker'); await page.click('#obSave'); await page.waitForTimeout(1200); }
await hide(page); flush(bag, L + 'sign-in');
const PANES = ['overview', 'line', 'pipeline', 'buy', 'campaigns', 'earn', 'earnings', 'promo', 'training', 'wallet', 'profile'];
// Control Room sign-in (2026-10-20): the shell opens its own email-code modal on any workspace screen
await page.goto(LOCAL + '/links', { waitUntil: 'networkidle' });
await page.waitForSelector('#siEmail'); await page.fill('#siEmail', 'qa-walk@example.com'); await page.click('#siGo');
await page.waitForSelector('#siCodeRow:not([hidden])', { timeout: 15000 }); await page.click('#siGo');
await page.waitForSelector('#siEmail', { state: 'detached', timeout: 10000 }).catch(() => note('bug', L + 'sign-in', 'sign-in modal did not close'));
flush(bag, L + 'sign-in');
const username = async () => { if (await page.$('#dlg-username')) { await page.fill('#dlg-username', 'qawalker'); await page.click('#dlgOk'); await page.waitForTimeout(1200); } };
// every Control Room screen on the rail
for (const sc of ['links', 'sources', 'pages', 'zones', 'ads', 'credits', 'reports', 'team', 'wallet', 'help']) {
const label = L + '/' + sc;
await page.goto(LOCAL + '/' + sc, { waitUntil: 'networkidle' }); await page.waitForTimeout(800); await username(); await hide(page);
if (await page.$('#siEmail')) note('bug', label, 'asked to sign in again');
const ok = await page.evaluate(() => { const el = document.getElementById('page'); return !!el && el.offsetHeight > 100 && !/could not load/.test((document.getElementById('crSub') || {}).textContent || ''); });
if (!ok && sc === 'help' && !process.env.HELPDESK_URL) note('warn', label, 'support desk not reachable from a local copy (expected)');
else if (!ok) note('bug', label, 'screen did not render (or said could not load)');
await domChecks(page, label); flush(bag, label);
await page.screenshot({ path: OUT + '/cr-' + sc + '.png' }).catch(() => {});
console.log('ok', label);
}
// the classic panes that live at /tools behind the Control Room tabs
await page.goto(LOCAL + '/tools', { waitUntil: 'load' }); await page.waitForTimeout(2500); // live feed stream: never network-idle await username();
const PANES = ['overview', 'promo', 'training', 'pipeline', 'line', 'profile'];
for (const pn of PANES) {
const label = L + 'my#' + pn;
const label = L + 'tools#' + pn;
await page.click('.bo-menu [data-pane="' + pn + '"]'); await page.waitForTimeout(1200); await hide(page);
const vis = await page.evaluate(id => { const el = document.getElementById('pane-' + id); return el && !el.hidden && el.offsetHeight > 40; }, pn);
if (!vis) note('bug', label, 'pane did not render');
@@ -109,19 +125,21 @@ if (MODE === 'member' || MODE === 'all') {
for (const s of subs) { try { await s.click(); await page.waitForTimeout(500); } catch (e) {} }
if (subs.length) await domChecks(page, label + ' (sub-tabs)');
flush(bag, label);
await page.screenshot({ path: OUT + '/my-' + pn + '.png' }).catch(() => {});
await page.screenshot({ path: OUT + '/tools-' + pn + '.png' }).catch(() => {});
console.log('ok', label, 'subtabs:', subs.length);
}
await page.click('.bo-menu [data-pane="promo"]'); await page.waitForTimeout(800);
if (!(await page.$$('#promoPosts .promo-block')).length) note('bug', L + 'promo', 'no post cards rendered');
const chat = await page.$('#chatMenuBtn'); if (chat) { await chat.click(); await page.waitForTimeout(800); await domChecks(page, L + 'messages'); flush(bag, L + 'messages'); }
const lo = await page.$('#logoutLink'); if (lo) { await lo.click(); await page.waitForTimeout(1000); }
if (!(await page.$('#authArea:not([hidden])'))) note('bug', L + 'logout', 'auth card not shown after log out');
const chat = await page.$('#chatMenuBtn'); if (chat) { await chat.click(); await page.waitForTimeout(800); await domChecks(page, L + 'messages'); flush(bag, L + 'messages'); await page.keyboard.press('Escape'); }
// the messages drawer can sit over the footer, so fire the link's own click handler
if (await page.$('#logoutLink')) { await page.evaluate(() => document.getElementById('logoutLink').click()); await page.waitForTimeout(1500); }
await page.goto(LOCAL + '/links', { waitUntil: 'networkidle' });
if (!(await page.waitForSelector('#siEmail', { timeout: 5000 }).catch(() => null))) note('bug', L + 'logout', 'still signed in after log out');
flush(bag, L + 'logout');
// admin
await page.goto(LOCAL + '/admin', { waitUntil: 'networkidle' });
await page.fill('#adEmail', process.env.ADMIN_EMAIL || 'martybostick@gmail.com'); await page.click('#adSend'); await page.waitForSelector('#adVerify:not([hidden])'); await page.click('#adVerify'); await page.waitForTimeout(1200);
for (const pn of ['overview', 'house', 'campaigns', 'members', 'reports', 'traffic', 'blog', 'kb', 'releases', 'pnl', 'settings']) {
for (const pn of ['overview', 'house', 'campaigns', 'members', 'content', 'reports', 'traffic', 'zones', 'domains', 'blog', 'kb', 'releases', 'pnl', 'settings']) {
const label = L + 'admin#' + pn;
await page.click('.bo-menu [data-pane="' + pn + '"]'); await page.waitForTimeout(1200);
const vis = await page.evaluate(id => { const el = document.getElementById('pane-' + id); return el && !el.hidden && el.offsetHeight > 40; }, pn);