mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-20 13:41:38 +00:00
test: cover chat run error recovery
This commit is contained in:
@@ -2192,9 +2192,6 @@ describeControlUiE2e("Control UI mocked Gateway E2E", () => {
|
||||
await page.locator(".chat-thread-inner").getByText(partialText).waitFor({ timeout: 10_000 });
|
||||
const alert = page.locator(".chat-run-error");
|
||||
await alert.getByText(errorText).waitFor({ timeout: 10_000 });
|
||||
const details = alert.locator("details");
|
||||
expect(await details.getAttribute("open")).toBeNull();
|
||||
expect(await details.locator("pre").isVisible()).toBe(false);
|
||||
expect(await alert.locator("button").count()).toBe(0);
|
||||
expect(await page.locator(".chat-thread-inner").getByText(errorText).count()).toBe(0);
|
||||
expect(
|
||||
@@ -2210,38 +2207,6 @@ describeControlUiE2e("Control UI mocked Gateway E2E", () => {
|
||||
expect(composerBox).not.toBeNull();
|
||||
expect(Math.abs((alertBox?.x ?? 0) - (composerBox?.x ?? 0))).toBeLessThan(1);
|
||||
expect(Math.abs((alertBox?.width ?? 0) - (composerBox?.width ?? 0))).toBeLessThan(1);
|
||||
const screenshotPath = process.env.OPENCLAW_CHAT_RUN_ERROR_SCREENSHOT?.trim();
|
||||
if (screenshotPath && alertBox && composerBox) {
|
||||
const padding = 12;
|
||||
const x = Math.max(0, Math.min(alertBox.x, composerBox.x) - padding);
|
||||
const y = Math.max(0, alertBox.y - padding);
|
||||
const right = Math.max(alertBox.x + alertBox.width, composerBox.x + composerBox.width);
|
||||
const bottom = Math.max(alertBox.y + alertBox.height, composerBox.y + composerBox.height);
|
||||
await page.screenshot({
|
||||
animations: "disabled",
|
||||
caret: "hide",
|
||||
clip: {
|
||||
x,
|
||||
y,
|
||||
width: right - x + padding,
|
||||
height: bottom - y + padding,
|
||||
},
|
||||
path: screenshotPath,
|
||||
});
|
||||
}
|
||||
|
||||
await details.locator("summary").click();
|
||||
expect(await details.getAttribute("open")).not.toBeNull();
|
||||
await details.locator("pre").getByText("openclaw logs --follow").waitFor();
|
||||
const expandedScreenshotPath =
|
||||
process.env.OPENCLAW_CHAT_RUN_ERROR_EXPANDED_SCREENSHOT?.trim();
|
||||
if (expandedScreenshotPath) {
|
||||
await page.screenshot({
|
||||
animations: "disabled",
|
||||
caret: "hide",
|
||||
path: expandedScreenshotPath,
|
||||
});
|
||||
}
|
||||
|
||||
await page.locator(".agent-chat__composer-combobox textarea").fill("retry after error");
|
||||
await page.getByRole("button", { name: "Send message" }).click();
|
||||
|
||||
Reference in New Issue
Block a user