diff options
Diffstat (limited to 'tools/image-tap-test.js')
| -rw-r--r-- | tools/image-tap-test.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/image-tap-test.js b/tools/image-tap-test.js index 2bf840b..d3bcb7e 100644 --- a/tools/image-tap-test.js +++ b/tools/image-tap-test.js @@ -56,7 +56,7 @@ try { const beside = process.env.DBG && await page.evaluate(([x, y]) => { const e = document.elementFromPoint(x, y); const chain = []; for (let n = e; n && chain.length < 5; n = n.parentElement) chain.push(n.tagName + '.' + (n.className || '').toString().split(' ').join('.') + (n.onclick ? '[click]' : '')); return chain; }, [r.x + 8, r.y + r.h / 2]); await page.mouse.click(r.x + 8, r.y + r.h / 2); await sleep(1200); - const band = await page.evaluate(() => ({ thread: !!document.querySelector('.thread-page'), lightbox: !!document.querySelector('.lightbox') })); + const band = await page.evaluate(() => ({ thread: !!document.querySelector('.thread-page'), lightbox: !!document.querySelector('.lightbox, .media-pager') })); check('a tap on the blank band opens the post', band.thread && !band.lightbox, JSON.stringify(band)); await page.goBack(); await sleep(1200); @@ -64,7 +64,7 @@ try { const r2 = await page.evaluate(() => { const b = document.querySelector('.notes-feed img.note-img').getBoundingClientRect(); return { x: b.left, y: b.top, w: b.width, h: b.height }; }); await page.mouse.click(r2.x + r2.w / 2, r2.y + r2.h / 2); await sleep(800); - const pic = await page.evaluate(() => ({ thread: !!document.querySelector('.thread-page'), lightbox: !!document.querySelector('.lightbox') })); + const pic = await page.evaluate(() => ({ thread: !!document.querySelector('.thread-page'), lightbox: !!document.querySelector('.lightbox, .media-pager') })); check('a tap on the picture opens the picture', pic.lightbox && !pic.thread, JSON.stringify(pic)); } finally { await browser.close(); server.stop(true); } console.log(ok ? '\nā
bands open the post, the picture opens the picture' : '\nā failed'); |
