From 4a00f4b5226155e25768fcfee1d69c9dd95906af Mon Sep 17 00:00:00 2001 From: Lihua <1017343802@qq.com> Date: Wed, 28 Oct 2026 00:54:15 -0700 Subject: [PATCH] test(workspace): open every closed work disclosure in goal-workspace-m2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 200-item expansion toggled each "其余 N 项任务" summary from a positional list taken before the first toggle. Hosted dashboard-browser shard 2 still stops at "All work remains reachable" with 126 of 200 visible, even after polling for five seconds: exactly two of the five 37-item disclosures stay closed. A positional list that re-resolves while owner groups re-render can toggle an open disclosure shut and skip another. Open, by keyboard, whichever disclosure is still closed until all work is visible, inside the same budget. The assertions and the 2s budget are unchanged. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lihua <1017343802@qq.com> --- .../goal-workspace-m2.mjs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/personal-workspace-browser/goal-workspace-m2.mjs b/examples/personal-workspace-browser/goal-workspace-m2.mjs index 2c9c4f6776..91279f1482 100644 --- a/examples/personal-workspace-browser/goal-workspace-m2.mjs +++ b/examples/personal-workspace-browser/goal-workspace-m2.mjs @@ -151,16 +151,15 @@ export const goalWorkspaceM2Scenario = { await page.screenshot({path:resolve(outputDir,'overview-populated-mobile.png'),animations:'disabled'}); await page.setViewportSize({width:1440,height:1000}); const expandStart = performance.now(); - // A late dependency read can reprioritize the owner groups. Keep each - // keyboard target bound to its owner rather than its current position. - const ownerIds = await now.locator('.goal-owner-group').evaluateAll(groups => groups.map(group => group.dataset.ownerId)); - for (const ownerId of ownerIds) { - const summary = now.locator(`.goal-owner-group[data-owner-id="${ownerId}"] .goal-work-more > summary`); - await summary.focus();await page.keyboard.press('Enter'); - } - // Each toggle renders asynchronously; the budget below covers all of them. + // Open each still-closed disclosure by keyboard. Owner groups can re-render + // while this runs, so a positional list could re-toggle an open group shut + // and skip another; the budget below covers every toggle. + const closedWork = now.locator('.goal-work-more:not([open]) > summary'); const visibleWork = () => now.locator('.goal-owner-group [data-todo-id]:visible').count(); - for (const deadline = Date.now() + 5000; await visibleWork() !== 200 && Date.now() < deadline;) await page.waitForTimeout(50); + for (const deadline = Date.now() + 5000; await visibleWork() !== 200 && Date.now() < deadline;) { + if (await closedWork.count()) {await closedWork.first().focus();await page.keyboard.press('Enter');} + else await page.waitForTimeout(50); + } assert.equal(await visibleWork(),200,"All work remains reachable in the original owner order"); const expandMs = performance.now() - expandStart; assert.ok(expandMs < 2000, `Full 200-item expansion exceeded 2s budget: ${expandMs}ms`);