1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
const pw=require("playwright");(async()=>{const b=await pw.chromium.launch();const pg=await b.newPage();await pg.setViewportSize({width:1440,height:1000});await pg.goto("http://localhost:3333");await pg.waitForTimeout(2000);await pg.screenshot({path:"login-templates/v4-showcase/debug-page.png",fullPage:true});console.log("full page screenshot saved, size:",fs.statSync("login-templates/v4-showcase/debug-page.png").size);const info=await pg.evaluate(()=>{return{totalGps:document.querySelectorAll(".gp").length,showGps:document.querySelectorAll(".gp.show").length,bodyH:document.body.scrollHeight,wrapH:document.querySelector(".wrap")?document.querySelector(".wrap").offsetHeight:0,gpC:{w:document.querySelector("[data-t=\\"C\\"]")?document.querySelector("[data-t=\\"C\\"]").offsetWidth:0,h:document.querySelector("[data-t=\\"C\\"]")?document.querySelector("[data-t=\\"C\\"]").offsetHeight:0},phoneC:{w:document.querySelector("[data-t=\\"C\\"] .phone")?document.querySelector("[data-t=\\"C\\"] .phone").offsetWidth:0,h:document.querySelector("[data-t=\\"C\\"] .phone")?document.querySelector("[data-t=\\"C\\"] .phone").offsetHeight:0},scrC:{w:document.querySelector("[data-t=\\"C\\"] .scr")?document.querySelector("[data-t=\\"C\\"] .scr").offsetWidth:0,h:document.querySelector("[data-t=\\"C\\"] .scr")?document.querySelector("[data-t=\\"C\\"] .scr").offsetHeight:0}}});console.log(JSON.stringify(info,null,2));await b.close()})().catch(e=>console.log("err:",e.message)); |