feat(waiter): English-first texts, part c: shift, log, chat, offline, notifications; language switch; guard (platform-v2 step 4.5c)
- Shift overview, order log, chat list / thread, offline + server search + rediscovery screens, notifications, the refused-lines sheet and the offline queue's reasons become keys; times and dates through useFormat() in the venue's clock. - User menu: the other language(s) (data-testid menu-language-<lng>), saved to the person's profile (PATCH /api/auth/me) and the bootstrap reloaded (D-12). - tests/no-greek.test.mjs: no Greek letter in waiter_pwa/src (the one Greek word the app recognises in staff messages is a \u escape). - e2e: the test venue is English: waiter / browser / android use the English texts; waiter.mjs +3 (English by default, switch to Greek at once and saved, after reload); android bundle checks print what they saw when they fail. - Pack README: the waiter texts rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,7 @@ try {
|
||||
// ── Install-app dialog + drawer entry ─────────────────────────────────────
|
||||
const r2 = reporter('browser: install-app dialog')
|
||||
const phone = ua => browser.newContext({ userAgent: ua, viewport: { width: 393, height: 852 }, deviceScaleFactor: 2.75, isMobile: true, hasTouch: true })
|
||||
const dialog = page => page.getByRole('dialog', { name: 'Εφαρμογή Xenia' })
|
||||
const dialog = page => page.getByRole('dialog', { name: 'The Xenia app' })
|
||||
const hamburger = page => page.locator('button').filter({ has: page.locator('svg') }).first()
|
||||
|
||||
let ctx = await phone(ANDROID_UA)
|
||||
@@ -85,21 +85,21 @@ try {
|
||||
r2.check('first visit on Android: dialog opens by itself', await dialog(page).isVisible())
|
||||
const box = await dialog(page).boundingBox()
|
||||
r2.check('dialog is taller than wide', box && box.height > box.width, box ? `${Math.round(box.width)}×${Math.round(box.height)}` : '')
|
||||
r2.check('download link points at the APK', (await page.getByRole('link', { name: 'Λήψη εφαρμογής' }).getAttribute('href')) === '/downloads/xenia-waiter.apk')
|
||||
r2.check('download link points at the APK', (await page.getByRole('link', { name: 'Download the app' }).getAttribute('href')) === '/downloads/xenia-waiter.apk')
|
||||
await page.screenshot({ path: path.join(OUT, 'install-dialog.png') })
|
||||
await page.getByRole('button', { name: 'Όχι τώρα' }).click()
|
||||
await page.getByRole('button', { name: 'Not now' }).click()
|
||||
await sleep(400)
|
||||
await page.reload()
|
||||
await sleep(3500)
|
||||
r2.check('"Όχι τώρα" → never opens by itself again', !(await dialog(page).isVisible()))
|
||||
r2.check('"Not now" → never opens by itself again', !(await dialog(page).isVisible()))
|
||||
await page.evaluate(t => localStorage.setItem('token', t), token)
|
||||
await page.goto(`http://${LAN}:15173/tables`)
|
||||
await sleep(4000)
|
||||
await hamburger(page).click()
|
||||
await sleep(600)
|
||||
const install = page.getByRole('button', { name: 'Εγκατάσταση εφαρμογής' })
|
||||
const install = page.getByRole('button', { name: 'Install the app' })
|
||||
const [ib, sb] = [await install.boundingBox(), await page.getByRole('button', { name: 'Settings' }).boundingBox()]
|
||||
r2.check('drawer shows "Εγκατάσταση εφαρμογής" right above Settings', !!(ib && sb && ib.y < sb.y && sb.y - ib.y < 80))
|
||||
r2.check('drawer shows "Install the app" right above Settings', !!(ib && sb && ib.y < sb.y && sb.y - ib.y < 80))
|
||||
await install.click()
|
||||
await sleep(500)
|
||||
r2.check('drawer entry reopens the dialog', await dialog(page).isVisible())
|
||||
@@ -115,7 +115,7 @@ try {
|
||||
const noDialog = !(await dialog(page).isVisible())
|
||||
await hamburger(page).click()
|
||||
await sleep(500)
|
||||
r2.check(`${label}: never offered (no dialog, no drawer entry)`, noDialog && !(await page.getByRole('button', { name: 'Εγκατάσταση εφαρμογής' }).isVisible()))
|
||||
r2.check(`${label}: never offered (no dialog, no drawer entry)`, noDialog && !(await page.getByRole('button', { name: 'Install the app' }).isVisible()))
|
||||
await ctx.close()
|
||||
}
|
||||
ctx = await phone(ANDROID_UA)
|
||||
|
||||
Reference in New Issue
Block a user