Skip to content

Commit 65ecd8b

Browse files
committed
前端测试中进度提示:每5秒跳动显示状态,测试完成/失败自动停止
1 parent f1aedb4 commit 65ecd8b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

extension/src/sidebarProvider.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
14861486
}
14871487
}
14881488
1489+
let testingTimer = null;
14891490
function onTestStarted() {
14901491
controlSection.classList.remove("hidden");
14911492
resultSection.classList.add("hidden");
@@ -1497,9 +1498,21 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
14971498
stepSection.classList.add("hidden");
14981499
logArea.innerHTML = "";
14991500
addLog("测试任务已启动...", "info");
1501+
// 持续跳动提示,让用户知道系统在运行
1502+
let dots = 0;
1503+
const phases = ["正在连接模拟器...", "正在执行测试步骤...", "仍在测试中,请耐心等待..."];
1504+
let phase = 0;
1505+
if (testingTimer) clearInterval(testingTimer);
1506+
testingTimer = setInterval(() => {
1507+
dots = (dots + 1) % 4;
1508+
const dotStr = ".".repeat(dots + 1);
1509+
addLog("⏳ " + phases[phase] + dotStr, "info");
1510+
if (dots === 3) phase = Math.min(phase + 1, phases.length - 1);
1511+
}, 5000);
15001512
}
15011513
15021514
function onTestResult(report) {
1515+
if (testingTimer) { clearInterval(testingTimer); testingTimer = null; }
15031516
lastReport = report;
15041517
controlSection.classList.add("hidden");
15051518
screenshotSection.classList.add("hidden");
@@ -1593,6 +1606,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
15931606
}
15941607
15951608
function onTestError(data) {
1609+
if (testingTimer) { clearInterval(testingTimer); testingTimer = null; }
15961610
controlSection.classList.add("hidden");
15971611
addLog("测试失败: " + data.error, "error");
15981612
}

0 commit comments

Comments
 (0)