e2eReportingErrorClassification.test.ts 1.2 KB

12345678910111213141516171819202122232425262728
  1. import { describe, expect, it } from "vitest";
  2. import { classifyError } from "./e2e/reporting/e2e-reporting.js";
  3. describe("e2e reporting error classification", () => {
  4. it("classifies e2e store and workspace fixture failures as infra before assertion patterns", () => {
  5. expect(
  6. classifyError("manual compact failed split fixture 注入失败: task-workspace-not-found"),
  7. ).toBe("infra");
  8. expect(
  9. classifyError('renderer task meta 注入失败: {"ok":false,"reason":"store-api-missing"}'),
  10. ).toBe("infra");
  11. expect(classifyError("Error: element could not be located by selector")).toBe("infra");
  12. });
  13. it("keeps product assertion failures as assertion", () => {
  14. expect(classifyError("expect(received).toBe(expected)\nExpected: 1\nReceived: 0")).toBe(
  15. "assertion",
  16. );
  17. });
  18. it("classifies renderer error documents and handle binding failures as infra", () => {
  19. expect(classifyError("url=chrome-error://chromewebdata/; readyState=complete")).toBe("infra");
  20. expect(classifyError("webdriver-page-handle-url-mismatch: expected file:// renderer")).toBe(
  21. "infra",
  22. );
  23. expect(classifyError("未找到可切换的工作区 renderer target")).toBe("infra");
  24. });
  25. });