diff options
| author | Adam Soltys <[email protected]> | 2026-11-06 23:13:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-06 23:13:26 -0700 |
| commit | 2dc574fceac569dea95e57be4134ed4ecd757d40 (patch) | |
| tree | 53baf962e819d9c19d37ab17e451272693e28f76 /tools/onboard-backup-test.js | |
| parent | f698dd9b1c638092c5c313889c1ac94feb91245f (diff) | |
| download | coinosv3-2dc574fceac569dea95e57be4134ed4ecd757d40.tar.gz coinosv3-2dc574fceac569dea95e57be4134ed4ecd757d40.zip | |
The front door is two choices: "Create a new wallet" or "Sign in to an existing account". "Login page is getting busy" (Adam, 2026-11-06): it had grown a door per method — Google, passkey, Nostr, twelve words, coinos.io — under the way in, and a footer of credits, pickers and the build stamp under that. Now the welcome step holds the two choices and nothing else (no footer on the front-door steps; the language follows the browser's), and the second opens a sign-in step with the ways in: "Sign in with seed phrase" first (was "Restore from twelve words"), then the feature's doors (Google, passkey, Nostr), then "Migrate a coinos account". Back from the seed-phrase import, the Nostr card and the coinos.io move returns to the sign-in step. Tests follow the extra step: onboard-backup (two choices, no footer; the seed phrase first among the ways in), onboard-migrate-door (Back to the sign-in choices), amber-login, account-access (logout lands on the two choices)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6Ts5Tktega8VbLg31q
Diffstat (limited to 'tools/onboard-backup-test.js')
| -rw-r--r-- | tools/onboard-backup-test.js | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/tools/onboard-backup-test.js b/tools/onboard-backup-test.js index 3cb607c..e7740ae 100644 --- a/tools/onboard-backup-test.js +++ b/tools/onboard-backup-test.js @@ -43,7 +43,10 @@ async function signIn() { await page.goto('http://localhost:5291/', { waitUntil: 'domcontentloaded' }); await page.evaluate(() => localStorage.setItem('btc-wallet-network', 'regtest')); await page.reload({ waitUntil: 'domcontentloaded' }); - // wait for the front door to actually be painted before poking it + // wait for the front door to actually be painted before poking it; the + // sign-in ways are one step in + await waitText(page, 'sign in to an existing account'); + await page.evaluate(() => document.getElementById('onb-signin')?.click()); await waitText(page, 'sign in with nostr'); const sk = generateSecretKey(); const nsec = bech32.encode('nsec', bech32.toWords(sk), 1000); @@ -62,23 +65,23 @@ try { await page.setViewport({ width: 390, height: 844 }); await page.goto('http://localhost:5291/', { waitUntil: 'domcontentloaded' }); await sleep(1500); + // Two choices and nothing else (2026-11-06): a new wallet, or one you + // already have — the sign-in methods wait behind the second. const front = await page.evaluate(() => { const btns = [...document.querySelectorAll('button')].filter((b) => b.offsetParent); const primary = document.getElementById('onb-create'); - const idx = btns.indexOf(primary); - const signins = btns.filter((b) => /sign in with/i.test(b.textContent)); + const signin = document.getElementById('onb-signin'); return { label: primary ? primary.textContent.trim() : null, - first: idx === 0 || (idx >= 0 && idx < btns.findIndex((b) => /sign in with/i.test(b.textContent))), - primaryTop: primary ? primary.getBoundingClientRect().top : -1, - signinTop: signins.length ? signins[0].getBoundingClientRect().top : -1, - divider: !!document.querySelector('.onb-or'), + labels: btns.map((b) => b.textContent.trim()), + order: !!primary && !!signin && primary.getBoundingClientRect().top < signin.getBoundingClientRect().top, + footer: !!document.querySelector('.footer'), }; }); check('the way in says what it makes', /wallet/i.test(front.label || ''), front.label || 'missing'); - check('...and comes before the sign-in buttons', front.first && front.primaryTop < front.signinTop, - `create at ${Math.round(front.primaryTop)}, first sign-in at ${Math.round(front.signinTop)}`); - check('...with a line between them, so they read as the alternative', front.divider); + check('...and the only other choice is signing in to one you have', front.order && front.labels.length === 2, + front.labels.join(' | ')); + check('...with no footer under them', !front.footer); // The welcome card is just the title and the buttons now (42c8d4e): the // way in itself says what the wallet is — tapping it puts the twelve // words on screen at once, with what they are. @@ -104,14 +107,16 @@ try { await page.goto('http://localhost:5291/', { waitUntil: 'domcontentloaded' }); await page.evaluate(() => localStorage.setItem('btc-wallet-network', 'regtest')); await page.reload({ waitUntil: 'domcontentloaded' }); + await waitText(page, 'sign in to an existing account'); + await page.evaluate(() => document.getElementById('onb-signin')?.click()); await waitText(page, 'sign in with nostr'); const door = await page.evaluate(() => { + const btns = [...document.querySelectorAll('button')].filter((b) => b.offsetParent && b.textContent.trim()); const b = document.getElementById('onb-restore'); - const c = document.getElementById('onb-create'); - return b && c ? { label: b.textContent.trim(), below: b.getBoundingClientRect().top > c.getBoundingClientRect().top, visible: !!b.offsetParent } : null; + return b ? { label: b.textContent.trim(), first: btns[0] === b, visible: !!b.offsetParent } : null; }); - check('the front page has a door for an existing wallet', !!door && door.visible && /twelve words|seed/i.test(door.label), door ? door.label : 'missing'); - check('...below the way in, with the other alternatives', !!door && door.below); + check('signing in offers the seed phrase', !!door && door.visible && /seed phrase/i.test(door.label), door ? door.label : 'missing'); + check('...first, above the other ways', !!door && door.first); await page.evaluate(() => document.getElementById('onb-restore')?.click()); await sleep(600); const pane = await page.evaluate(() => ({ |
