Files
selfphoneng/scripts/e2e/mobile.mjs
T
iamdoubz 9a81e37725
ci / check (push) Canceled after 0s
ci / images (push) Canceled after 0s
users: admin CRUD API and admin shell UI
Login, forced password change, admin layout with every 05 §2 page in the
sidebar (unbuilt ones name their milestone), Users table/cards + drawer
(General tab), one-time temporary passwords, reset password. The last
active admin can't be demoted, deactivated or deleted. Audit diffs only
mask secret strings. scripts/e2e has a dependency-free CDP browser check
for this task's acceptance flow.

Task: M1-T4
2026-10-17 15:18:08 -05:00

24 lines
1016 B
JavaScript

// SPDX-License-Identifier: AGPL-3.0-or-later
// Screenshots of the admin shell at 360 px (05 §1: works at 360 px; tables become cards).
import { launch } from './cdp.mjs';
const [base, email, pw, shotsDir] = process.argv.slice(2);
const p = await launch({ width: 360, height: 740, shotsDir });
try {
await p.goto(`${base}/login`);
await p.waitFor(`!!document.querySelector('input[type=email]')`);
await p.fill('Email', email);
await p.fill('Password', pw);
await p.click('Sign in');
await p.waitFor(`location.pathname === '/admin'`);
await p.goto(`${base}/admin/users`);
await p.waitFor(`document.body.innerText.includes('admin@example.com')`);
const overflow = await p.evaluate('document.documentElement.scrollWidth > innerWidth');
await p.shot('m-users');
await p.click('Menu');
await p.waitFor(`document.body.innerText.includes('Trunks')`);
await p.shot('m-menu');
console.log('horizontal overflow:', overflow, '| console errors:', p.consoleErrors);
} finally {
await p.close();
}