aboutsummaryrefslogtreecommitdiffstats
path: root/tools/profile-stream-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/profile-stream-test.js')
-rw-r--r--tools/profile-stream-test.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/profile-stream-test.js b/tools/profile-stream-test.js
index b7dfb9b..2b426bb 100644
--- a/tools/profile-stream-test.js
+++ b/tools/profile-stream-test.js
@@ -27,7 +27,7 @@ try {
await page.waitForSelector('.user-search-main', { timeout: 10000 });
await page.type('.user-search-main', Q, { delay: 60 });
// the result rows: people (not the "posts that say this" or #topic rows)
- const rows = () => page.evaluate(() => [...document.querySelectorAll('.list .item')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim())).map((r) => r.textContent.trim().slice(0, 40)));
+ const rows = () => page.evaluate(() => [...document.querySelectorAll('.list .item:not(.search-scoped-row)')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim())).map((r) => r.textContent.trim().slice(0, 40)));
let found = [];
for (let i = 0; i < 60 && !found.length; i++) { found = await rows(); if (!found.length) await sleep(250); }
if (!found.length) console.log(await page.evaluate(() => document.querySelector('.user-search-main')?.closest('.col')?.parentElement?.innerHTML.slice(0, 1500)));
@@ -35,7 +35,7 @@ try {
const wait = Number(process.env.WAIT || 0); // ms between results and the tap (prefetch's head start)
if (wait) await sleep(wait);
const t0 = Date.now();
- await page.evaluate(() => [...document.querySelectorAll('.list .item')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim()))[0].click());
+ await page.evaluate(() => [...document.querySelectorAll('.list .item:not(.search-scoped-row)')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim()))[0].click());
let ghostAt = 0, firstAt = 0, rowsAt3 = 0;
for (let i = 0; i < 200; i++) {
const s = await page.evaluate(() => ({
@@ -57,10 +57,10 @@ try {
// Adam 2026-11-14 — they updated a page hidden under the profile)
await page.setViewport({ width: 1300, height: 900 });
await sleep(500);
- const field = await page.$('.header-search');
+ const field = await page.$('input.header-search, .header-search-field');
check('the desktop header has a search field', !!field);
if (field) {
- await page.evaluate(() => { const f = document.querySelector('.header-search'); f.focus(); f.value = ''; });
+ await page.evaluate(() => { const f = document.querySelector('input.header-search, .header-search-field'); f.focus(); f.value = ''; });
await field.type('jack', { delay: 60 });
let again = [];
for (let i = 0; i < 80 && !(again.length && again[0] !== found[0]); i++) { again = await rows(); if (!(again.length && again[0] !== found[0])) await sleep(250); }