test(e2e): display looks (two displays, two slideshows; looks UI with library pictures); docs
- terminal.mjs: the looks API drives the idle screen; a second look on the other display: two displays show two different slideshows from the library. - manager.mjs: the default look's QR design through Settings. - media.mjs: a new look with three pictures picked at once, a picture in a look can't be deleted. - pack README: the customer display row; CS-19 (screen designs are records a device picks with a ref field). - run-all --no-android: all passed except terminal's "server unreachable → banner" (8 s wait, under load); terminal.mjs alone right after: all passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,32 @@ try {
|
||||
(await page.getByTestId('media-used-by').innerText().catch(() => '')).includes(p1.name) && await page.getByTestId('media-delete').isDisabled())
|
||||
await page.keyboard.press('Escape')
|
||||
|
||||
// ── 5.3: the customer display's looks pick their pictures from the library ──
|
||||
await api('PUT', '/api/platform/modules/customer_display', { token: boss, body: { enabled: true } }).catch(() => {})
|
||||
await page.goto(`${MANAGER}/settings`)
|
||||
await page.getByText('Customer display', { exact: true }).click()
|
||||
await page.getByTestId('display-look-new').click({ timeout: 15_000 })
|
||||
await page.getByTestId('display-look-new-name').fill('Promo')
|
||||
await page.getByTestId('display-look-create').click()
|
||||
await page.locator('[data-testid="display-look"][data-name="Promo"][aria-selected="true"]').waitFor({ timeout: 10_000 })
|
||||
await page.getByTestId('display-style-slideshow').click()
|
||||
await page.getByTestId('display-slides-add').click()
|
||||
const picker = page.getByTestId('media-picker')
|
||||
for (const i of [0, 1, 2]) await picker.getByTestId('media-item').nth(i).click()
|
||||
await page.getByTestId('media-picker-add').click()
|
||||
r.check('5.3: a new look "Promo": three pictures picked at once from the library, in order',
|
||||
await page.getByTestId('display-slide-item').count() === 3)
|
||||
await page.getByTestId('display-save').click()
|
||||
await sleep(1000)
|
||||
const looks = await api('GET', '/api/display/looks', { token: boss })
|
||||
const promo = looks.find(l => l.name === 'Promo')
|
||||
r.check('5.3: saved: the look is a slideshow of three library pictures; the default look is unchanged',
|
||||
promo?.config.style === 'slideshow' && promo.config.slides.length === 3 && promo.preview.slide_urls.length === 3
|
||||
&& looks.find(l => l.is_default)?.name === 'Main', JSON.stringify(looks.map(l => [l.name, l.config.style, l.config.slides])))
|
||||
await page.screenshot({ path: path.join(OUT, 'media-display-looks.png'), fullPage: true })
|
||||
const usedSlide = await api('DELETE', `/api/media/${promo.config.slides[0]}`, { token: boss }).then(() => 'deleted', e => e.message)
|
||||
r.check('5.3: a picture in a look cannot be deleted from the library', usedSlide.includes('409'), usedSlide)
|
||||
|
||||
// ── The waiter's phone: photos fetched ahead, shown offline ─────────────────
|
||||
const phone = await browser.newContext({ viewport: { width: 393, height: 852 }, deviceScaleFactor: 2, isMobile: true, hasTouch: true })
|
||||
const w = await phone.newPage()
|
||||
|
||||
Reference in New Issue
Block a user