Read a control's position after the browser music test's last scroll

The Apps list scrolls when a control sits low on the screen. The fourth
attempt scrolled and then clicked the position read before that scroll.
With the apps the node offers listed below Lists, the list moved and the
click opened Library instead of Lists, so release-ready failed while the
same code passed before the node's catalog changed.
This commit is contained in:
waozi committed 2026-10-27 04:54:32 -03:00
1 parent 5159e7f098
commit 82383c3d5d
1 file changed
+5 -2
+5 -2
View File
@@ -103,7 +103,10 @@ export async function verifyMusicAcrossTabs({ evaluate, click, scroll, resize, c
await settle();
const scrollableAction = action === 0 || action === 1 || (action >= 2 && action <= 5) || action === 8;
let point;
for (let attempt = 0; attempt < 4; attempt++) {
// The last attempt never scrolls: a click must use a position read after
// the list's last move. Apps the node offers can lengthen the list.
const attempts = 6;
for (let attempt = 0; attempt < attempts; attempt++) {
// Entering Audio can suspend the first draw while cue files decode.
// Wait for that draw and its actual control before choosing a position.
const deadline = Date.now() + 10000;
@@ -136,7 +139,7 @@ export async function verifyMusicAcrossTabs({ evaluate, click, scroll, resize, c
await delay(600);
continue;
}
if (point.rawX < 0 || point.rawY < 0 ||
if (point.rawX < 0 || point.rawY < 0 || attempt === attempts - 1 ||
(!scrollableAction || point.y <= point.bottom * 0.75)) break;
await scroll(point.x, point.bottom * 0.6, point.y - point.bottom * 0.65 + 100);
await delay(600);