diff --git a/PlotLine.Tests/Browser/manuscript-reader.cjs b/PlotLine.Tests/Browser/manuscript-reader.cjs index 1888de6b..e1c6aa00 100644 --- a/PlotLine.Tests/Browser/manuscript-reader.cjs +++ b/PlotLine.Tests/Browser/manuscript-reader.cjs @@ -8,13 +8,20 @@ const base = process.env.PD_BROWSER_FIXTURE_URL || 'http://127.0.0.1:5238'; 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(); + const readingControls = async () => { + if (!pwa) return page; + const menu=page.locator('details.pd-context-menu').filter({has:page.locator('[data-command-identity="handler:reader-focus"]')}); + await menu.waitFor({state:'visible'}); + if (!await menu.evaluate(node=>node.open)) await menu.locator('summary').click(); + return menu; + }; for(const theme of ['modern-light','modern-dark','warm-light','warm-dark']) { const response = await page.goto(`${base}/manuscript/reader?bookId=12&chapterId=21`); assert.equal(response.status(),200); assert.match(response.headers()['cache-control'],/no-store/); assert.match(response.headers()['x-robots-tag'],/noindex/); await page.evaluate(theme => PlotDirectorApplyApplicationTheme(theme), theme); - await page.locator('.writer3-flow').waitFor(); // The reader alias now uses the measured shared workspace. + await page.locator('[data-review-columns]').waitFor(); // The reader alias now uses the measured shared workspace. const paragraphs = page.locator('.reader-paragraph'); assert.equal(await paragraphs.count(),3); assert.match(await paragraphs.nth(1).textContent(), /First paragraph: