const {chromium}=require('playwright');const assert=require('node:assert/strict'); (async()=>{const browser=await chromium.launch();try{ for(const pwa of [false,true])for(const width of [390,800,1440]){ const context=await browser.newContext({viewport:{width,height:1000}});if(pwa)await context.addInitScript(()=>Object.defineProperty(navigator,'standalone',{value:true})); const page=await context.newPage(); for(const theme of ['modern-light','modern-dark','warm-light','warm-dark']){ await page.goto('http://127.0.0.1:5238/fixture?desktop=Chapters&layout=full');await page.evaluate(theme=>PlotDirectorApplyApplicationTheme(theme),theme); const table=page.locator('.table-responsive'); assert.equal(await table.evaluate(node=>getComputedStyle(node).overflowWrap),'normal','Record wrapping must not break each table cell into letters'); assert.ok((await table.boundingBox()).height<300,'One scene must remain a readable compact row'); assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth),'Table scroll stays inside its container'); const title=table.getByRole('link',{name:'Arrival',exact:true});assert.ok((await title.boundingBox()).width>25,'Scene title retains a word-sized column'); } await context.close(); } console.log('PASS Chapter Details table readability and contained scrolling: browser/PWA, 390/800/1440, four themes'); }finally{await browser.close()}})().catch(error=>{console.error(error);process.exitCode=1});