aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-video-pager-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/feed-video-pager-test.js')
-rw-r--r--tools/feed-video-pager-test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/feed-video-pager-test.js b/tools/feed-video-pager-test.js
index 6d34cf1..ab5aa2a 100644
--- a/tools/feed-video-pager-test.js
+++ b/tools/feed-video-pager-test.js
@@ -115,6 +115,11 @@ try {
console.log('\n[the seek bar]');
check('the seek bar is up once the clip knows its length', await waitFor((cur) => !!eval(cur)()?.querySelector('.mp-seek.ready'), '(' + CUR + ')', 4000));
+ // clear of the phone's gesture strip along the bottom, and of the side edges (back gesture)
+ const geo = await page.evaluate((cur) => { const r = eval(cur)().querySelector('.mp-seek').getBoundingClientRect(); return { bottom: Math.round(innerHeight - r.bottom), left: Math.round(r.left), right: Math.round(innerWidth - r.right) }; }, '(' + CUR + ')');
+ check('the seek bar sits clear of the bottom edge', geo.bottom >= 32, JSON.stringify(geo));
+ check('…and in from the sides', geo.left >= 16 && geo.right >= 16, JSON.stringify(geo));
+ if (process.env.SHOT) { await page.evaluate(() => document.querySelector('.media-pager').classList.add('show')); await sleep(300); await page.screenshot({ path: process.env.SHOT }); await page.evaluate(() => document.querySelector('.media-pager').classList.remove('show')); }
const bar = await page.evaluate((cur) => { const r = eval(cur)().querySelector('.mp-seek').getBoundingClientRect(); return { x: r.x, y: r.y + r.height - 4, w: r.width }; }, '(' + CUR + ')');
await page.mouse.move(bar.x + bar.w * 0.1, bar.y);
await page.mouse.down();
@@ -135,6 +140,7 @@ try {
check('a tap pauses', v && v.paused, JSON.stringify(v));
check('…and shows the details', s.show);
check('…with the author and the words', await page.evaluate((cur) => { const x = eval(cur)(); return /Clip Poster/.test(x.textContent) && /a wide one/.test(x.textContent); }, '(' + CUR + ')'));
+ check('…clear of the seek bar', await page.evaluate((cur) => { const x = eval(cur)(); const bar = x.querySelector('.mp-seek-track').getBoundingClientRect(); return [...x.querySelectorAll('.mp-left > *, .mp-counts > *')].every((n) => n.getBoundingClientRect().bottom <= bar.top - 4); }, '(' + CUR + ')'));
check('…still in the pager', s.open && s.fs);
await tapPager();
v = await curVideo(); s = await pagerState();