diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/send-enter-keys-test.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/send-enter-keys-test.js b/tools/send-enter-keys-test.js index 67997c0..aac95f8 100644 --- a/tools/send-enter-keys-test.js +++ b/tools/send-enter-keys-test.js @@ -72,11 +72,28 @@ try { check('back on Spending, history again', !(await lit()), await lit()); console.log('[recipient: Enter picks the top suggestion]'); - await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Send')?.click()); + // a REAL click: Chrome focuses the button clicked, and the recipient field + // must still take the cursor from it + const openSend = async () => { + for (const b of await page.$$('button')) if ((await b.evaluate((n) => n.textContent.trim())) === 'Send') { await b.click(); return; } + }; + await openSend(); await page.waitForSelector('textarea.send-dest', { timeout: 10000 }); await sleep(300); check('desktop: Send opens with the cursor in the recipient field', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + // away and back, two ways: the cursor lands again each time + await page.evaluate(() => document.activeElement?.blur()); + await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Receive')?.click()); await sleep(600); + await openSend(); await sleep(600); + check('...again after Receive and back to Send', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + await page.evaluate(() => document.activeElement?.blur()); + await swipeTo('face-savings'); await sleep(1200); + await swipeTo('face-spending'); await sleep(1200); + await openSend(); await sleep(600); + check('...and after swiping to Savings and back', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); await page.focus('textarea.send-dest'); await page.keyboard.type('adam', { delay: 80 }); let top = ''; |
