← back to Rentv Tour

desk-probe.mjs

26 lines

import { chromium } from 'playwright';
const BASE='https://rentv.agentabrams.com';
const b=await chromium.launch();
const ctx=await b.newContext({viewport:{width:1440,height:810},httpCredentials:{username:'admin',password:'DW2024!'}});
const p=await ctx.newPage();
const errs=[];
p.on('console',m=>{if(m.type()==='error')errs.push(m.text().slice(0,120))});
p.on('pageerror',e=>errs.push('PAGEERR: '+e.message.slice(0,120)));
await p.goto(BASE+'/desk',{waitUntil:'networkidle',timeout:45000});
await p.waitForTimeout(3000);
const info=await p.evaluate(()=>{
  const bodyText=document.body.innerText.trim().slice(0,200);
  const main=document.querySelector('main');
  return {
    bodyLen:document.body.innerText.trim().length,
    bodyPreview:bodyText,
    hasMain:!!main,
    mainLen:main?main.innerText.trim().length:0,
    childCount:document.body.children.length,
    tags:[...document.body.children].map(e=>e.tagName+'.'+(e.className||e.id||'').toString().slice(0,20))
  };
});
console.log('DESK errs:',errs.slice(0,8));
console.log('DESK info:',JSON.stringify(info,null,1));
await b.close();