From fb02066cdacee861f9c04098982532c9e11c3122 Mon Sep 17 00:00:00 2001 From: Vito Date: Sat, 31 Oct 2026 18:13:05 +0000 Subject: [PATCH] test(vocabulary): open the long-list check as a new page, not a reload (#567) (#570) Firefox restores the scroll position of a reloaded page's tag window, so its end scrolled into view and appended a second page before the 100-row check. Scrolling the window to its top before the reload did not always stick on CI. A fresh navigation has no position to restore. --- tests/browser/workspace-vocabulary.spec.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/browser/workspace-vocabulary.spec.mjs b/tests/browser/workspace-vocabulary.spec.mjs index d7e0cb11..ed0f9b0d 100644 --- a/tests/browser/workspace-vocabulary.spec.mjs +++ b/tests/browser/workspace-vocabulary.spec.mjs @@ -145,9 +145,10 @@ test('long vocabularies append and Load more is keyboard reachable',async({page, await expect(loadMore(page)).toHaveCount(0); await expect(rows(page).nth(200).getByRole('button',{name:'Browse',exact:true})).toBeFocused(); await expect(rows(page).locator('td:nth-child(1)')).toHaveText(manifest.tags); - // Reload with the window at its top: Firefox restores a scrolled window, whose end then appends a page before the check. - await main(page).locator('.two-col .table-wrap').evaluate(node=>new Promise(resolve=>{node.scrollTop=0;requestAnimationFrame(()=>requestAnimationFrame(resolve));})); - await page.reload(); + // Open the screen as a new history entry, not a reload: Firefox restores a reloaded page's scrolled tag window, and + // its end then appends a page before the check (#567). Scrolling the window to its top first does not always stick. + await page.goto('about:blank'); + await page.goto(route); await expect(rows(page)).toHaveCount(100); // D183: the end of the list arrives inside the tag window. const scroll=top=>main(page).locator('.two-col .table-wrap').evaluate((node,y)=>new Promise(resolve=>{node.scrollTop=y ?? node.scrollHeight;requestAnimationFrame(()=>requestAnimationFrame(resolve));}),top);