jukebox
All repositories: gitoria
25.3 KB
// tests/jb3.mjs — the PLAYER GATE (mission JB3): shuffle without repeats over the generated 13,459-song database, the favourites shuffle respecting N, a play counted once at its// threshold, the album and copy rules, and in a real headless Chrome (tests/cdp.mjs, real clicks, keys and touches) the shuffle buttons, the now-playing overlay (open, close// button, Escape, swipe down), next / previous by button and key, the thumbnail placeholder in every row state, the lock screen's media session. 390 px first, then 1280.// node tests/jb3.mjs env as tests/ui.mjs (JUKEBOX_UI_PORT default 8712, JUKEBOX_UI_DIR, JUKEBOX_UI_SHOTS, JUKEBOX_UI_URL, HL_PORT_BASE for Chrome)import { spawn, execFileSync } from 'node:child_process'import { rmSync, mkdirSync, writeFileSync, existsSync, readFileSync } from 'node:fs'import { dirname, join } from 'node:path'import { fileURLToPath } from 'node:url'process.env.HL_CHROME = process.env.HL_CHROME || '/opt/google/chrome/chrome'process.env.HL_PORT_BASE = process.env.HL_PORT_BASE || '8500'const { launchBrowser } = await import('./cdp.mjs')const root = join(dirname(fileURLToPath(import.meta.url)), '..')const dir = process.env.JUKEBOX_UI_DIR || '/media/STORAGE/claude-scratch/atlas/JB3/gate-jb3'const shots = process.env.JUKEBOX_UI_SHOTS || join(dir, 'shots')const port = Number(process.env.JUKEBOX_UI_PORT || 8712)const BASE = process.env.JUKEBOX_UI_URL || `http://127.0.0.1:${port}`const COLD_MS = Number(process.env.JUKEBOX_COLD_MS || 150000)let pass = 0, fail = 0const check = (name, ok, detail = '') => { console.log((ok ? 'ok ' : 'FAIL ') + name + (ok ? '' : ' — ' + detail)); if (ok) pass++; else fail++ }const sleep = (ms) => new Promise((r) => setTimeout(r, ms))mkdirSync(shots, { recursive: true })let server = null, browser = null, log = ''async function stop() {if (browser) { try { await browser.close() } catch {} browser = null }if (server) { try { server.kill('SIGTERM') } catch {} await sleep(500); server = null }}process.on('SIGINT', async () => { await stop(); process.exit(1) })// ---- the test database and the server --------------------------------------------------------------------------------------const storage = join(dir, 'storage')const tone = join(dir, 'tone.mp3')if (!process.env.JUKEBOX_UI_URL) {rmSync(storage, { recursive: true, force: true })mkdirSync(dir, { recursive: true })execFileSync('ffmpeg', ['-v', 'error', '-y', '-f', 'lavfi', '-i', 'sine=frequency=440:duration=60', '-q:a', '9', tone])const cover = join(root, 'tests/fixtures/withcover/folder.jpg')const t0 = Date.now()const made = execFileSync(join(root, 'bin/hybriel'), [join(root, 'tools/make-test-db.hl'), tone, cover], { env: { ...process.env, JUKEBOX_STORAGE: storage }, encoding: 'utf8', timeout: 600000 })console.log(made.trim() + ' (' + (Date.now() - t0) + ' ms)')server = spawn(join(root, 'bin/hybriel'), ['project.hl'], { cwd: root, env: { ...process.env, JUKEBOX_PORT: String(port), JUKEBOX_STORAGE: storage, JUKEBOX_AUTOSCAN: '0', JUKEBOX_WATCH: '0', HL_HOST: '127.0.0.1' }, stdio: ['ignore', 'pipe', 'pipe'] })server.stdout.on('data', (d) => { log += d }); server.stderr.on('data', (d) => { log += d })for (const t0 = Date.now(); ; ) {try { if ((await fetch(BASE + '/')).ok) break } catch {}if (Date.now() - t0 > COLD_MS) { console.log(log); throw new Error('the server did not come up') }await sleep(500)}}try {const j = async (p) => (await fetch(BASE + p)).json()const stats = (await j('/api/stats')).library// ---- the shuffle queue over the whole database ------------------------------------------------------------------------------const allIds = async (min) => { const ids = []; for (let off = 0; ; off += 200) { const r = await j('/api/songs?limit=200&offset=' + off + '&minPlays=' + min); for (const s of r.items) ids.push(s.id); if (off + 200 >= r.total) break } return ids }const every = await allIds(0)const q0 = await j('/api/queue?seed=4242&kind=favourites&minPlays=0&from=0&count=' + every.length)check('shuffle over everything: the pool is the 13,4xx songs shown', q0.pool === every.length && q0.pool > 13000, q0.pool + ' / ' + every.length)check('shuffle: every song once before any repeats (no id twice in the first round)', new Set(q0.ids).size === q0.ids.length && q0.ids.every((id) => every.includes(id) || true) && new Set(q0.ids.concat(every)).size === every.length)const q1 = await j('/api/queue?seed=4242&kind=favourites&minPlays=0&from=0&count=50')check('shuffle: the same seed gives the same order', JSON.stringify(q1.ids) === JSON.stringify(q0.ids.slice(0, 50)))const q2 = await j('/api/queue?seed=99&kind=favourites&minPlays=0&from=0&count=50')check('shuffle: another seed gives another order', JSON.stringify(q2.ids) !== JSON.stringify(q1.ids))const sortedFirst = every.slice(0, 50)check('shuffle: the order is not the list order', JSON.stringify(q1.ids) !== JSON.stringify(sortedFirst))const r2 = await j('/api/queue?seed=4242&kind=favourites&minPlays=0&from=' + every.length + '&count=' + every.length)check('shuffle: the second round is again every song once, in a new order', new Set(r2.ids).size === every.length && JSON.stringify(r2.ids.slice(0, 30)) !== JSON.stringify(q0.ids.slice(0, 30)))const fav5 = await allIds(5), fav9 = await allIds(9)const f5 = await j('/api/queue?seed=7&kind=favourites&minPlays=5&from=0&count=' + (fav5.length + 5))check('favourites shuffle with N = 5: the pool is the songs played at least 5 times', f5.pool === fav5.length && f5.pool < every.length, f5.pool + ' / ' + fav5.length)const set5 = new Set(fav5)check('favourites shuffle N = 5: every id is a favourite, each once, then the next round starts', new Set(f5.ids.slice(0, fav5.length)).size === fav5.length && f5.ids.every((id) => set5.has(id)))const f9 = await j('/api/queue?seed=7&kind=favourites&minPlays=9&from=0&count=' + fav9.length)const set9 = new Set(fav9)check('favourites shuffle respects N: with N = 9 the pool shrinks and only songs played 9 times or more come', f9.pool === fav9.length && f9.pool < f5.pool && f9.ids.every((id) => set9.has(id)), f9.pool + ' / ' + f5.pool)// ---- albums (CD markers) and copies ---------------------------------------------------------------------------------------const twins = (await j('/api/search?q=twin%20album')).albums.filter((a) => a.name === 'Twin Album')check('album grouping: "Twin Album CD 1" and "(Cd2)" are ONE album, not folders', twins.length === 1, JSON.stringify(twins.map((a) => a.name)))const copySong = (await j('/api/search?q=' + encodeURIComponent('Copied Song'))).songs.itemscheck('copies: two files of one song (same artist and title, lengths 1.5 s apart) are listed once as "2 copies"; the 130 s version is its own song', copySong.length === 2 && copySong.filter((s) => s.copies === 2).length === 1 && copySong.filter((s) => s.copies === 1).length === 1, JSON.stringify(copySong.map((s) => [s.title, s.copies, s.duration])))// ---- counting by the API ---------------------------------------------------------------------------------------------------const target = every[3]const before = (await j('/api/songs?limit=200&offset=0')).items.find((s) => s.id === target)const posted = await fetch(BASE + '/api/played/' + target, { method: 'POST' }).then((r) => r.json())check('POST /api/played adds 1 to the jukebox counter and leaves the file count alone', posted.jukeboxPlays === 1 && posted.filePlays === before.filePlays, JSON.stringify(posted))check('POST /api/played of an unknown song is 404', (await fetch(BASE + '/api/played/nosuch', { method: 'POST' })).status === 404)check('GET /api/played is refused (405)', (await fetch(BASE + '/api/played/' + target)).status === 405)const songAfter = (await j('/api/songs?limit=200&offset=0')).items.find((s) => s.id === target)check('the shown play count is file count + jukebox count', songAfter.playCount === before.filePlays + 1 && songAfter.jukeboxPlays === 1, JSON.stringify([before.playCount, songAfter.playCount]))// ---- the browser, phone first --------------------------------------------------------------------------------------------browser = await launchBrowser()const page = await browser.newPage()const ev = (e) => page.evaluate(e)const shot = async (name) => { const s = await page.send('Page.captureScreenshot', { format: 'png' }); writeFileSync(join(shots, name + '.png'), Buffer.from(s.data, 'base64')) }const press = async (key, code, vk, text) => { await page.send('Input.dispatchKeyEvent', { type: 'keyDown', key, code, windowsVirtualKeyCode: vk, text }); await page.send('Input.dispatchKeyEvent', { type: 'keyUp', key, code, windowsVirtualKeyCode: vk }) }const goto = async (path) => { await page.goto(BASE + path); await page.waitForSelector('jb-screen') }const playing = () => page.waitFor(`(() => { const a = document.querySelector('media-player audio'); return a && a.src.includes('/stream/') && a.currentTime > 0.4 && !a.paused })()`, { timeout: 30000, label: 'audio plays' })const nowTitle = () => ev(`(document.querySelector('.jb-bar .mp-cover h2')||{}).textContent`)const nowSrc = () => ev(`document.querySelector('media-player audio').src`)const open = () => ev(`document.querySelector('.jb-app').classList.contains('open')`)const changed = async (old) => { await page.waitFor(`document.querySelector('.jb-bar .mp-cover h2').textContent !== ${JSON.stringify(old)}`, { timeout: 15000, label: 'title changes' }); await sleep(300) }await page.send('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 2, mobile: true })await page.send('Emulation.setTouchEmulationEnabled', { enabled: true, maxTouchPoints: 5 })await goto('/'); await page.waitForSelector('virtual-list .vl-row'); await sleep(800)check('Songs: "Shuffle my favourites" is there as an ordinary button like Shuffle (JB19: no longer the big one)', (await ev(`(() => { const b = document.querySelector('#shuffle-fav'), s = document.querySelector('#shuffle'); return b.getBoundingClientRect().width < 300 && Math.abs(b.getBoundingClientRect().height - s.getBoundingClientRect().height) < 3 && !b.classList.contains('jb-big') })()`)))await shot('songs-390')await page.click('#shuffle-fav'); await playing()const first = await nowTitle()check('Shuffle my favourites: a song plays and the bar shows it', first.length > 3 && (await ev(`document.querySelector('.jb-app').classList.contains('playing')`)))const startSrc = await nowSrc()const startId = startSrc.split('/stream/')[1]check('Shuffle my favourites: the song is one of the favourites (played at least 5 times)', set5.has(startId), startId)check('the bar is not the overlay yet', !(await open()))const barGeo = await ev(`(() => { const r = (s) => document.querySelector(s).getBoundingClientRect(); const bar = r('.jb-bar'); return { h: Math.round(bar.height), bottom: Math.round(bar.bottom), vh: innerHeight, prev: r('.jb-bar .jb-prev').width, next: r('.jb-bar .jb-next').width, play: r('.jb-bar .mp-play').width, shuffle: r('.jb-bar #jb-shuffle').width, repeat: r('.jb-bar #jb-repeat').width, back: document.querySelectorAll('.jb-bar .mp-back, .jb-bar .mp-forward').length, titleOk: r('.jb-bar .mp-cover h2').width > 60 } })()`)check('the bar: shuffle / previous / play / next / repeat shown (JB19: no 10 s buttons at all), title readable, progress bar half a finger', barGeo.h >= 68 && barGeo.h <= 84 && barGeo.bottom === barGeo.vh && barGeo.prev > 40 && barGeo.next > 40 && barGeo.play > 40 && barGeo.shuffle > 40 && barGeo.repeat > 40 && barGeo.back === 0 && barGeo.titleOk, JSON.stringify(barGeo))await shot('bar-390')// the overlay: a tap on the barawait page.click('.jb-bar .mp-cover h2'); await page.waitFor(`document.querySelector('.jb-app').classList.contains('open')`)await sleep(500)const ov = await ev(`(() => { const r = (s) => document.querySelector(s).getBoundingClientRect(); const vis = (s) => { const b = r(s); return b.width > 20 && b.height > 20 && b.top >= 0 && b.bottom <= innerHeight } ; const bar = r('.jb-bar'); const lis = [...document.querySelectorAll('.jb-bar ol.mp-queue li')].filter((l) => l.getBoundingClientRect().height > 0).length; return { bar: [Math.round(bar.left), Math.round(bar.top), Math.round(bar.width), Math.round(bar.height)], cover: Math.round(r('.jb-bar .mp-cover img').width), title: document.querySelector('.jb-bar .mp-cover h2').textContent, artist: document.querySelector('.jb-bar .mp-cover p').textContent, album: document.querySelector('.jb-bar .jb-album').textContent, controls: ['#jb-shuffle', '.jb-prev', '.mp-play', '.jb-next', '#jb-repeat', '.mp-mute', '.mp-speed', '.mp-times', 'mp-seek', '.jb-close'].map((s) => vis('.jb-bar ' + s)), queue: lis } })()`)check('Overlay (phone): a tap on the bar opens it full screen', ov.bar[0] === 0 && ov.bar[1] === 0 && ov.bar[2] === 390 && ov.bar[3] === 844, JSON.stringify(ov.bar))check('Overlay: large cover (≥ 200 px), title, artist and album are shown', ov.cover >= 200 && ov.title.length > 3 && ov.artist.length > 2 && ov.album.length > 2, JSON.stringify(ov))check('Overlay: shuffle, previous, play, next, repeat, mute, speed, times, seek line and close are all on screen', ov.controls.every((x) => x), JSON.stringify(ov.controls))check('Overlay: the queue lists the playing song and the 20 after it (21 rows at most)', ov.queue >= 20 && ov.queue <= 21, '' + ov.queue)await shot('overlay-390')// next and previous with the buttonsawait page.click('.jb-bar .jb-next'); await changed(first)const second = await nowTitle()await playing()check('Next (button): the next song of the shuffle plays', second !== first && (await nowSrc()) !== startSrc)await page.click('.jb-bar .jb-prev'); await changed(second); await playing()check('Previous (button) within 3 s: the song before plays again', (await nowTitle()) === first && (await nowSrc()) === startSrc)// the lock screenconst ms = await ev(`(() => { const m = navigator.mediaSession; return m && m.metadata ? { title: m.metadata.title, artist: m.metadata.artist, album: m.metadata.album, art: m.metadata.artwork.length } : null })()`)check('Media session: title, artist, album and artwork are set for the lock screen', ms && ms.title === (await nowTitle()) && ms.artist.length > 2 && ms.album.length > 2 && ms.art === 1, JSON.stringify(ms))// close: button, Escape, swipe downawait page.click('.jb-bar .jb-close'); await page.waitFor(`!document.querySelector('.jb-app').classList.contains('open')`)check('Overlay: the close button closes it', !(await open()))await page.click('.jb-bar .mp-cover h2'); await page.waitFor(`document.querySelector('.jb-app').classList.contains('open')`); await sleep(300)const touch = async (type, x, y) => page.send('Input.dispatchTouchEvent', { type, touchPoints: type === 'touchEnd' ? [] : [{ x, y }] })await touch('touchStart', 195, 150); for (let y = 170; y <= 330; y += 20) { await touch('touchMove', 195, y); await sleep(20) } ; await touch('touchEnd', 195, 330)await sleep(400)check('Overlay: a swipe down over the cover closes it', !(await open()))await touch('touchStart', 195, 780); await page.click('.jb-bar .mp-cover h2'); await page.waitFor(`document.querySelector('.jb-app').classList.contains('open')`); await touch('touchEnd', 195, 780)// a short swipe or one on the queue must not close itawait sleep(300)await touch('touchStart', 195, 150); for (let y = 160; y <= 200; y += 10) { await touch('touchMove', 195, y); await sleep(20) } ; await touch('touchEnd', 195, 200); await sleep(300)check('Overlay: a short drag (40 px) does not close it', await open())await page.click('.jb-bar .jb-close'); await sleep(300)// the thumbnail placeholder stays in every row stateawait goto('/'); await page.waitForSelector('virtual-list .vl-row:not(.blank)'); await sleep(600)const thumbBg = () => ev(`(() => { const rows = [...document.querySelectorAll('.vl-row:not(.blank)')]; return rows.slice(0, 8).map((r) => { const t = r.querySelector('.vl-thumb'); const b = t ? t.getBoundingClientRect() : { width: 0 }; const cs = t ? getComputedStyle(t) : { backgroundColor: 'none' }; return [b.width > 20, cs.backgroundColor, r.className] }) })()`)const plain = await thumbBg()check('Rows: every row has a visible thumbnail box with a background', plain.every((x) => x[0] && x[1] !== 'rgba(0, 0, 0, 0)'), JSON.stringify(plain.slice(0, 2)))await page.click('virtual-list .vl-row:not(.blank)'); await playing(); await sleep(400)await page.focus('virtual-list .vl-row:not(.blank)')const marked = await thumbBg()check('Rows: the playing and the focused row keep their thumbnail placeholder', marked.every((x) => x[0] && x[1] !== 'rgba(0, 0, 0, 0)'), JSON.stringify(marked.slice(0, 3)))await goto('/search'); await page.type('#q', 'copied song'); await page.waitFor(`[...document.querySelectorAll('jb-hits h2')].some((x) => x.textContent.startsWith('Songs'))`, { timeout: 15000, label: 'songs heading' }); const sh = await ev(`[...document.querySelectorAll('jb-hits h2')].map((x) => x.textContent).join('|')`); check('Search: "copied song" finds the two songs (three files) and the heading counts them', sh.includes('Songs · 2'), sh)await page.focus('virtual-list .vl-row:not(.blank)'); await sleep(300)const sr = await thumbBg()check('Search: the result row with focus keeps its thumbnail placeholder', sr.length > 0 && sr.every((x) => x[0] && x[1] !== 'rgba(0, 0, 0, 0)'), JSON.stringify(sr))check('Search: the song in two folders shows once with "2 copies" in its row', (await ev(`[...document.querySelectorAll('.vl-row:not(.blank) .vl-sub')].map((e) => e.textContent).join('|')`)).includes('2 copies'))await page.type('#q', ''); await ev(`(() => { const q = document.querySelector('#q'); q.value = ''; q.dispatchEvent(new Event('input', { bubbles: true })) })()`)await page.type('#q', 'rosa'); await page.waitFor(`document.querySelectorAll('.vl-row:not(.blank)').length > 3`, { timeout: 15000 }); await sleep(500)await shot('search-390')const heads = await ev(`[...document.querySelectorAll('jb-hits h2')].map((h) => h.textContent)`)check('Search: the headings carry their own counts', heads.length > 0 && heads.every((h) => /\d/.test(h)), JSON.stringify(heads))// shuffle of a list: searchawait page.type('#q', ''); await ev(`(() => { const q = document.querySelector('#q'); q.value = ''; q.dispatchEvent(new Event('input', { bubbles: true })) })()`)await page.type('#q', 'rosa amber 16'); await sleep(1500)await page.click('#shuffle'); await playing()const sid = (await nowSrc()).split('/stream/')[1]const found = (await j('/api/search?q=' + encodeURIComponent('rosa amber 16') + '&limit=200')).songs.items.map((s) => s.id)check('Shuffle on the search list: the song that plays is one of the results', found.includes(sid))// a multi-CD album and its Shuffleawait goto('/albums/' + twins[0].id); await page.waitForSelector('.vl-row:not(.blank)'); await sleep(900)const titles = await ev(`[...document.querySelectorAll('.vl-row:not(.blank) .vl-title')].map((e) => e.textContent)`)check('Multi-CD album: one album, the rows lead with disc and track ("1-1. …", "2-1. …")', titles.length >= 4 && titles.some((t) => t.startsWith('1-1.')) && titles.some((t) => t.startsWith('2-1.')), JSON.stringify(titles))check('Multi-CD album: the head says it has 2 discs', (await ev(`document.querySelector('jb-head').textContent`)).includes('2 discs'))await shot('album-twin-390')const albumIds = new Set((await j('/api/songs?limit=200&sort=artist&album=' + twins[0].id)).items.map((s) => s.id))await page.click('#shuffle'); await playing()const aid = (await nowSrc()).split('/stream/')[1]check('Shuffle on an album plays a song of that album (and the API knows the album)', albumIds.size >= 4 && albumIds.has(aid), aid)// favourites viewawait goto('/'); await page.waitForSelector('virtual-list .vl-row'); await page.click('#fav'); await sleep(900)check('Favourites view: the Shuffle my favourites button is there too', (await ev(`document.querySelector('#shuffle-fav').getBoundingClientRect().width`)) > 0)await page.focus('#favmin'); await ev(`document.querySelector('#favmin').select()`); await page.send('Input.insertText', { text: '11' })await page.waitFor(`document.querySelector('#count').textContent.startsWith(${JSON.stringify((await allIds(11)).length.toLocaleString('en-US'))})`, { timeout: 10000, label: 'N = 11' })const set11 = new Set(await allIds(11))await shot('favourites-390')const seen = new Set()for (let i = 0; i < 3; i++) { await page.click('#shuffle-fav'); await playing(); seen.add((await nowSrc()).split('/stream/')[1]); await sleep(300) }check('Favourites view: Shuffle my favourites uses the N of the field (11): every song that played has been played 11 times or more', [...seen].every((id) => set11.has(id)), JSON.stringify([...seen]))// counting a play: after half of the 60 s song, onceawait goto('/'); await page.waitForSelector('virtual-list .vl-row')await page.click('#shuffle-fav'); await playing()const c1 = (await nowSrc()).split('/stream/')[1]const c1title = await nowTitle()await page.click('.jb-bar .jb-next'); await sleep(1500) // skipped after 1.5 s: must not countawait playing()const c2 = (await nowSrc()).split('/stream/')[1]const jbOf = async (id) => (await j('/api/search?q=' + encodeURIComponent(await ev(`document.querySelector('.jb-bar .mp-cover h2').textContent`)))).songs.items.find((s) => s.id === id)const t00 = Date.now()await sleep(20000)const at20 = await jbOf(c2)check('Counting: after 20 s of a 60 s song nothing is counted yet', at20 && at20.jukeboxPlays === 0, JSON.stringify(at20 && at20.jukeboxPlays))await page.waitFor(`(() => document.querySelector('media-player audio').currentTime > 31)()`, { timeout: 30000 })await sleep(2500)const at33 = await jbOf(c2)check('Counting: after half of the song (30 s) the play is counted: the jukebox counter is 1', at33 && at33.jukeboxPlays === 1, JSON.stringify(at33 && at33.jukeboxPlays))await sleep(6000)const at40 = await jbOf(c2)check('Counting: it counts once, not again while the song goes on', at40 && at40.jukeboxPlays === 1 && at40.playCount === at33.playCount, JSON.stringify(at40 && [at40.jukeboxPlays, at40.playCount]))console.log('counting took ' + (Date.now() - t00) + ' ms')const skipped = (await j('/api/search?q=' + encodeURIComponent(c1title))).songs.items.find((x) => x.id === c1)check('Counting: the song skipped after 1.5 s was not counted', skipped && skipped.jukeboxPlays === 0, JSON.stringify(skipped && skipped.jukeboxPlays))check('The page has no script errors', page.problems().filter((m) => m.level === 'error').length === 0, page.dumpConsole())// ---- desktop -------------------------------------------------------------------------------------------------------------await page.send('Emulation.setDeviceMetricsOverride', { width: 1280, height: 800, deviceScaleFactor: 1, mobile: false })await page.send('Emulation.setTouchEmulationEnabled', { enabled: false })await goto('/'); await page.waitForSelector('virtual-list .vl-row:not(.blank)'); await sleep(600)await shot('songs-1280')await page.click('#shuffle-fav'); await playing(); await sleep(500)const bar2 = await ev(`(() => { const r = document.querySelector('.jb-bar').getBoundingClientRect(); return { h: Math.round(r.height), times: document.querySelector('.jb-bar .mp-times').getBoundingClientRect().width > 20 } })()`)check('Desktop: the bar has the times and a half-finger progress bar', bar2.h >= 76 && bar2.h <= 92 && bar2.times, JSON.stringify(bar2))await shot('bar-1280')await page.click('.jb-bar .mp-cover h2'); await page.waitFor(`document.querySelector('.jb-app').classList.contains('open')`); await sleep(500)const panel = await ev(`(() => { const b = document.querySelector('.jb-bar').getBoundingClientRect(); const h = document.querySelector('application-header').getBoundingClientRect(); const s = document.querySelector('jb-screen').getBoundingClientRect(); return { left: Math.round(b.left), top: Math.round(b.top), width: Math.round(b.width), bottom: Math.round(b.bottom), headerBottom: Math.round(h.bottom), screenRight: Math.round(s.right), cover: Math.round(document.querySelector('.jb-bar .mp-cover img').getBoundingClientRect().width), queue: [...document.querySelectorAll('.jb-bar ol.mp-queue li')].filter((l) => l.getBoundingClientRect().height > 0).length } })()`)check('Overlay (desktop): a side panel at the right under the header, the list beside it', panel.width === 384 && panel.left === 1280 - 384 && panel.top === panel.headerBottom && panel.bottom === 800 && panel.screenRight <= panel.left + 1, JSON.stringify(panel))check('Overlay (desktop): large cover and the queue of the next songs', panel.cover >= 150 && panel.queue >= 15, JSON.stringify(panel))await shot('overlay-1280')await page.click('.jb-bar .jb-close'); await page.waitFor(`!document.querySelector('.jb-app').classList.contains('open')`)await goto('/albums/' + twins[0].id); await page.waitForSelector('.vl-row:not(.blank)'); await sleep(900)await shot('album-twin-1280')await goto('/search'); await page.type('#q', 'rosa'); await page.waitFor(`document.querySelectorAll('.vl-row:not(.blank)').length > 3`, { timeout: 15000 }); await sleep(500)await shot('search-1280')await page.close()} catch (e) {fail++; console.log('FAIL the gate stopped: ' + (e && e.stack || e)); if (log) console.log(log.slice(-2000))} finally {await stop()}console.log(`\n${pass} passed, ${fail} failed`)process.exit(fail ? 1 : 0)
Branches
Latest commits
- 8ed6da45|||PR README: media-player pin df9e7dfmre
- d5d45fc3|||PR media-player df9e7df (repeat-one fix), sync pin and SOURCEmre
- 89cdabb1Vendor Hybriel day41 (57054d9e): plugin dirs, set .somre
- 1fecd6a7Merge branch 'records-day39' into mainJukebox
- d6b3e068|||PR Records: day39 live (PR #2), mission 011 PR step, statusmre
- 5fa19e89Merge branch 'day39' into mainJukebox
- cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmre
- f3614c9bRe-vendor to Hybriel day39 (51e921d7, bin 6b481aa7)mre
- 9f5c6532Merge branch 'status-22-pr' into mainJukebox
- 5838d6c7|||PR STATUS: #22 pending decision, PR-only rulemre
- 29d2029cRecords: PR-only rule (Kunibert)mre
- adacb0abRecords: neutral ticket rule, #22 decision recordedmre
- b2d6f121Records: #308 hold liftedmre
- 7ab67533Records: day39 on hold (hybriel#308)mre
- 22f21739Records: note rebase before mergemre
- f7368ea3Records: mission 011 day39, waits for lisbethmre
- 9515d2cdRecords: jb20 livemre
- 019f6601ui gate: comment names the open bug components#27 (workaround, not fixed)mre
- 277a2722README: provenance linemre
- 4169ca6aREADME: sync pinmre