fix(web): settle each Outliner expand before the next toggle
The armature panel case failed ten headed reruns because the fixture's expand loop clicked a label list scanned before earlier replies landed: it re-clicked rows the reply had just opened and closed them again, so each round flipped the same rows and the loop never settled. Re-read each row's own label before clicking and wait for that toggle to reach the tree; no timeout budget changes. The armature row was never missing from the tree. It hangs under its parent ScaledRigParent one level deeper, exactly as desktop make_object_parent_hierarchy_collections builds it. Correct the known limitations and module coverage entries, and keep the resolved gap rows so the history and its evidence stay traceable. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
22
web/tests/fixtures/native-ui-workflow.ts
vendored
22
web/tests/fixtures/native-ui-workflow.ts
vendored
@@ -139,13 +139,29 @@ export class NativeUIWorkflow {
|
||||
* nested object stays hidden behind a collapsed branch exactly as it does
|
||||
* in desktop Blender for the same saved tree store (TSE_CLOSED). Expand
|
||||
* branches until the row is reachable, which is the desktop interaction. */
|
||||
for (let round = 0; round < 4 && !(await item.isVisible()); round++) {
|
||||
for (let round = 0; round < 6 && !(await item.isVisible()); round++) {
|
||||
const collapsed = await this.page.locator('button.tree-expand[aria-label^="展开"]')
|
||||
.evaluateAll((buttons) => [...new Set(buttons.map((button) => button.getAttribute("aria-label") ?? ""))]);
|
||||
if (!collapsed.length) break;
|
||||
if (!collapsed.length) {
|
||||
/* The open reply reaches worker listeners before React paints the
|
||||
* opened Main's rows, so an early round can see an empty tree and stop.
|
||||
* Wait for the row list, then expand it like the desktop user does. */
|
||||
const painted = await this.page.locator('[role="treeitem"]').first()
|
||||
.waitFor({ state: "visible", timeout: 30_000 }).then(() => true, () => false);
|
||||
if (!painted) break;
|
||||
continue;
|
||||
}
|
||||
for (const label of collapsed) {
|
||||
if (await item.isVisible()) break;
|
||||
await this.page.locator(`button.tree-expand[aria-label="${label}"]`).click({ timeout: 5_000 }).catch(() => {});
|
||||
const button = this.page.locator(`button.tree-expand[aria-label="${label}"]`);
|
||||
/* The list above was scanned before earlier replies landed. A row the
|
||||
* reply already opened still reads 展开 here, and clicking it again
|
||||
* closes it, so the next round re-opens it and the loop oscillates
|
||||
* instead of settling. Re-read the row's own state, then wait for this
|
||||
* toggle to reach the tree before deciding the next one. */
|
||||
if (await button.getAttribute("aria-label").catch(() => null) !== label) continue;
|
||||
await button.click({ timeout: 5_000 }).catch(() => {});
|
||||
await expect(button).toHaveAttribute("aria-label", label.replace("展开", "折叠"), { timeout: 10_000 }).catch(() => {});
|
||||
}
|
||||
}
|
||||
await expect(item).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
@@ -68,7 +68,7 @@ test("gap ids are unique and every referenced id is registered", () => {
|
||||
});
|
||||
|
||||
test("every registered gap carries a known state and priority", () => {
|
||||
const states = new Set(["OPEN", "PARTIAL", "BLOCKED", "FROZEN"]);
|
||||
const states = new Set(["OPEN", "PARTIAL", "BLOCKED", "FROZEN", "RESOLVED"]);
|
||||
for (const [id, , , , , priority, state] of registerRows) {
|
||||
assert.ok(states.has(state.replaceAll("`", "")), `${id} has an unknown state: ${state}`);
|
||||
assert.match(priority, /^P[1-3]$/);
|
||||
|
||||
Reference in New Issue
Block a user