Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

test(webui): ignore looping stars when settling tier controls

my hloli8646e1871c40
diff --git a/tests/browser/gradio_tier_checks.js b/tests/browser/gradio_tier_checks.js
index 2c69bcb7..6479a4f8 100644
--- a/tests/browser/gradio_tier_checks.js
+++ b/tests/browser/gradio_tier_checks.js
@@ -15,10 +15,13 @@ async (page) => {
if (request.method() === "POST" && /gradio_api\/(queue|run|call)/.test(request.url())) requests.push(request.url());
};
page.on("request", onRequest);
- // 等待现有 CSS 吸附动画完成,仅在测试需要稳定起点时使用。
+ // 只等待圆点和填充条的 CSS 吸附过渡,跳过无限循环的星点动画。
const settle = async () => {
await capsule.evaluate(async node => {
- await Promise.all(node.getAnimations({ subtree: true }).map(animation => animation.finished.catch(() => {})));
+ const transitions = node.getAnimations({ subtree: true }).filter(animation =>
+ animation instanceof CSSTransition
+ && animation.effect.target.matches(".mineru-tier-thumb, .mineru-tier-fill"));
+ await Promise.all(transitions.map(animation => animation.finished.catch(() => {})));
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
});
};
diff --git a/tests/browser/gradio_tier_release_checks.js b/tests/browser/gradio_tier_release_checks.js
index 8f9d7be1..f77049d0 100644
--- a/tests/browser/gradio_tier_release_checks.js
+++ b/tests/browser/gradio_tier_release_checks.js
@@ -6,10 +6,13 @@ async (page) => {
const rail = capsule.locator(".mineru-tier-rail");
const range = capsule.locator(".mineru-tier-range");
const thumb = capsule.locator(".mineru-tier-thumb");
- // 等待吸附及 Gradio 回执,最终状态不能被迟到的取消或捕获丢失覆盖。
+ // 只等待圆点和填充条的吸附过渡,跳过无限星点;最终状态不能被迟到的取消或捕获丢失覆盖。
const settled = async expected => {
await capsule.evaluate(async node => {
- await Promise.all(node.getAnimations({ subtree: true }).map(animation => animation.finished.catch(() => {})));
+ const transitions = node.getAnimations({ subtree: true }).filter(animation =>
+ animation instanceof CSSTransition
+ && animation.effect.target.matches(".mineru-tier-thumb, .mineru-tier-fill"));
+ await Promise.all(transitions.map(animation => animation.finished.catch(() => {})));
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
});
if (Number(await range.inputValue()) !== expected) throw new Error(`Tier bounced back; expected ${expected}`);