Publish EventLens v1.1.0 (#1)

This commit was merged in pull request #1.
This commit is contained in:
Jens committed 2026-11-20 12:20:18 +00:00
1 parent c0ade21029
commit 87432f3283
63 files changed
+7381 -1420

No files matched your search

+8 -2
View File
@@ -7,12 +7,18 @@ test("workspace navigation and primary controls expose accessible state", async
}
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await page.getByRole("button", { name: "Timeline", exact: false }).click();
await expect(page.getByRole("button", { name: "Timeline", exact: false }).first()).toHaveAttribute("aria-current", "page");
await expect(page.getByRole("button", { name: "Timeline", exact: false }).first()).toHaveAttribute(
"aria-current",
"page",
);
await expect(page.getByRole("textbox", { name: "Search normalized evidence" })).toBeVisible();
await expect(page.getByLabel("Filter by category")).toBeVisible();
await expect(page.getByLabel("Filter by level")).toBeVisible();
await expect(page.getByLabel("Filter by provider")).toBeVisible();
await expect(page.getByRole("button", { name: "Previous evidence" })).toHaveAttribute("aria-label", "Previous evidence");
await expect(page.getByRole("button", { name: "Previous evidence" })).toHaveAttribute(
"aria-label",
"Previous evidence",
);
await expect(page.getByRole("listitem").first()).toHaveAttribute("aria-setsize", /[0-9]+/);
await page.getByRole("textbox", { name: "Search normalized evidence" }).focus();
await page.keyboard.press("Tab");
+27 -13
View File
@@ -7,11 +7,13 @@ test("malformed successful analysis keeps the previous investigation", async ({
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByRole("region", { name: "Current investigation context" })).toContainText("bundled-demo");
await page.route("**/api/analyze", (route) => route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }),
}));
await page.route("**/api/analyze", (route) =>
route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }),
}),
);
await page.locator('input[type="file"]').setInputFiles(validUpload);
await expect(page.getByRole("alert")).toContainText("Analysis returned an invalid response.");
@@ -21,11 +23,15 @@ test("malformed successful analysis keeps the previous investigation", async ({
});
test("structured parser errors have safe, useful wording", async ({ page }) => {
await page.route("**/api/analyze", (route) => route.fulfill({
status: 422,
contentType: "application/json",
body: JSON.stringify({ detail: { code: "no_readable_events", message: "No readable Windows events were found in this file." } }),
}));
await page.route("**/api/analyze", (route) =>
route.fulfill({
status: 422,
contentType: "application/json",
body: JSON.stringify({
detail: { code: "no_readable_events", message: "No readable Windows events were found in this file." },
}),
}),
);
await page.goto("/#analysis");
await page.locator('input[type="file"]').setInputFiles(validUpload);
@@ -40,13 +46,21 @@ test("rejecting an invalid file cancels an older pending analysis", async ({ pag
let routeStarted!: () => void;
let releaseRoute!: () => void;
const started = new Promise<void>((resolve) => { routeStarted = resolve; });
const released = new Promise<void>((resolve) => { releaseRoute = resolve; });
const started = new Promise<void>((resolve) => {
routeStarted = resolve;
});
const released = new Promise<void>((resolve) => {
releaseRoute = resolve;
});
await page.route("**/api/analyze", async (route) => {
routeStarted();
await released;
try {
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ source: "late.evtx", events: [], incidents: [] }) });
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ source: "late.evtx", events: [], incidents: [] }),
});
} catch {
// The route can already be cancelled by the browser request abort.
}
+6 -2
View File
@@ -4,7 +4,9 @@ test("demo investigation workflow crosses Analysis, Timeline and Reports", async
await page.goto("/#analysis");
await expect(page.getByRole("heading", { name: "No event log loaded", exact: true })).toBeVisible();
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByRole("region", { name: "Current investigation context" }).getByText("bundled-demo", { exact: true })).toBeVisible();
await expect(
page.getByRole("region", { name: "Current investigation context" }).getByText("bundled-demo", { exact: true }),
).toBeVisible();
await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible();
await expect(page.getByText("Analysis status", { exact: true })).toBeVisible();
await expect(page.getByText("Deterministic demo fixture", { exact: true })).toBeVisible();
@@ -14,7 +16,9 @@ test("demo investigation workflow crosses Analysis, Timeline and Reports", async
await page.getByText("Service failure recorded", { exact: true }).click();
await expect(page).toHaveURL(/#timeline$/);
await expect(page.getByRole("heading", { name: "Event timeline", exact: true })).toBeVisible();
await expect(page.getByRole("heading", { name: "Example Sync Service terminated unexpectedly", exact: true })).toBeVisible();
await expect(
page.getByRole("heading", { name: "Example Sync Service terminated unexpectedly", exact: true }),
).toBeVisible();
await expect(page.getByText("Focus active", { exact: true })).toBeVisible();
const search = page.getByRole("textbox", { name: "Search normalized evidence" });
+54 -6
View File
@@ -2,16 +2,62 @@ import { expect, test } from "@playwright/test";
const partialAnalysis = {
source: "partial.evtx",
events: [{ id: "1", timestamp: "2026-09-09T10:00:00Z", timestamp_source: "event", timestamp_valid: true, provider: "Synthetic", event_id: 1000, level: "error", channel: "Application", computer: "TEST-PC", category: "crash", summary: "Synthetic crash", fields: {} }],
incidents: [{ id: "incident-1", rule_id: "windows.generic.attention", start: "2026-09-09T10:00:00Z", end: "2026-09-09T10:00:00Z", title: "Synthetic crash", category: "crash", severity: "warning", reasons: ["Parser retained only a partial result."], evidence_event_ids: ["1"], original_count: 1, compressed_count: 1 }],
parse: { parser: "evtx-rs", status: "partial", parsed_events: 1, records_seen: 4, skipped_records: 2, issue_count: 1, truncated: true, truncation_reason: "event_limit_reached", duration_ms: 8, issues: [{ code: "event_limit_reached", record_id: 4, message: "later records were not analyzed", skipped_record: true }] },
events: [
{
id: "1",
timestamp: "2026-09-09T10:00:00Z",
timestamp_source: "event",
timestamp_valid: true,
provider: "Synthetic",
event_id: 1000,
level: "error",
channel: "Application",
computer: "TEST-PC",
category: "crash",
summary: "Synthetic crash",
fields: {},
},
],
incidents: [
{
id: "incident-1",
rule_id: "windows.generic.attention",
start: "2026-09-09T10:00:00Z",
end: "2026-09-09T10:00:00Z",
title: "Synthetic crash",
category: "crash",
severity: "warning",
reasons: ["Parser retained only a partial result."],
evidence_event_ids: ["1"],
original_count: 1,
compressed_count: 1,
},
],
parse: {
parser: "evtx-rs",
status: "partial",
parsed_events: 1,
records_seen: 4,
skipped_records: 2,
issue_count: 1,
truncated: true,
truncation_reason: "event_limit_reached",
duration_ms: 8,
issues: [
{ code: "event_limit_reached", record_id: 4, message: "later records were not analyzed", skipped_record: true },
],
},
};
test("partial result is unmistakable and invalid extension is rejected", async ({ page }) => {
await page.route("**/api/analyze", (route) => route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(partialAnalysis) }));
await page.route("**/api/analyze", (route) =>
route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(partialAnalysis) }),
);
await page.goto("/#analysis");
await expect(page.getByRole("heading", { name: "Analysis", exact: true })).toBeVisible();
await page.locator('input[type="file"]').setInputFiles({ name: "partial.evtx", mimeType: "application/octet-stream", buffer: Buffer.from("synthetic") });
await page
.locator('input[type="file"]')
.setInputFiles({ name: "partial.evtx", mimeType: "application/octet-stream", buffer: Buffer.from("synthetic") });
await expect(page.getByRole("alert")).toContainText("Partial analysis");
await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete");
await expect(page.getByText("event_limit_reached", { exact: true })).toBeVisible();
@@ -20,6 +66,8 @@ test("partial result is unmistakable and invalid extension is rejected", async (
await page.getByRole("button", { name: "Timeline", exact: false }).click();
await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete");
await page.locator('input[type="file"]').setInputFiles({ name: "not-an-evtx.txt", mimeType: "text/plain", buffer: Buffer.from("nope") });
await page
.locator('input[type="file"]')
.setInputFiles({ name: "not-an-evtx.txt", mimeType: "text/plain", buffer: Buffer.from("nope") });
await expect(page.getByRole("alert").filter({ hasText: "Choose a Windows .evtx file." })).toBeVisible();
});
+1 -1
View File
@@ -1,6 +1,6 @@
import { expect, test } from "@playwright/test";
test("capture deterministic v1.0.6 portfolio views", async ({ page }) => {
test("capture deterministic v1.1.0 portfolio views", async ({ page }) => {
await page.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible();
+11 -1
View File
@@ -1,9 +1,19 @@
import { expect, test } from "@playwright/test";
test("core workspace actions remain usable across supported viewport widths", async ({ page }) => {
// 7 viewports x 5 workspaces; the default 30 s is too tight on shared CI runners.
test.setTimeout(90_000);
await page.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
for (const viewport of [{ width: 360, height: 800 }, { width: 390, height: 844 }, { width: 768, height: 900 }, { width: 1024, height: 768 }, { width: 1366, height: 768 }, { width: 1440, height: 900 }, { width: 1920, height: 1080 }]) {
for (const viewport of [
{ width: 360, height: 800 },
{ width: 390, height: 844 },
{ width: 768, height: 900 },
{ width: 1024, height: 768 },
{ width: 1366, height: 768 },
{ width: 1440, height: 900 },
{ width: 1920, height: 1080 },
]) {
await page.setViewportSize(viewport);
await expect(page.getByRole("button", { name: "Open .evtx", exact: true }).first()).toBeVisible();
for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) {
@@ -19,7 +19,9 @@ test("settings keeps session state and reports a persistence failure", async ({
await expect(compact).toBeChecked();
await expect(page.locator(".settings-save-feedback")).toHaveText("Preferences changed for this session only");
await expect(page.getByText("Saved automatically in this browser", { exact: true })).toBeHidden();
await expect(page.getByText("Preferences are available for this session only because browser storage is unavailable.")).toBeVisible();
await expect(
page.getByText("Preferences are available for this session only because browser storage is unavailable."),
).toBeVisible();
await expect(page.getByText("Not saved to browser storage")).toBeVisible();
await expect(page.getByText("Interface preferences for this session")).toBeVisible();
+17 -2
View File
@@ -3,14 +3,29 @@ import { expect, test } from "@playwright/test";
function largeAnalysis(count: number) {
return {
source: "synthetic-large.evtx",
events: Array.from({ length: count }, (_, index) => ({ id: String(index), timestamp: "2026-09-09T10:00:00Z", timestamp_source: "event", timestamp_valid: true, provider: "Synthetic Provider", event_id: index, level: "warning", channel: "Application", computer: "TEST-PC", category: "other", summary: `Synthetic event ${index}`, fields: { message: `Synthetic event ${index}` } })),
events: Array.from({ length: count }, (_, index) => ({
id: String(index),
timestamp: "2026-09-09T10:00:00Z",
timestamp_source: "event",
timestamp_valid: true,
provider: "Synthetic Provider",
event_id: index,
level: "warning",
channel: "Application",
computer: "TEST-PC",
category: "other",
summary: `Synthetic event ${index}`,
fields: { message: `Synthetic event ${index}` },
})),
incidents: [],
};
}
test("large timelines virtualize DOM rows and keep search usable", async ({ page }) => {
const analysis = largeAnalysis(10_000);
await page.route("**/api/demo", (route) => route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(analysis) }));
await page.route("**/api/demo", (route) =>
route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(analysis) }),
);
await page.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByText("10,000", { exact: false }).first()).toBeVisible();
+1 -1
View File
@@ -48,7 +48,7 @@ test("Hunting combines facets and opens a result in the inspector", async ({ pag
await page.getByRole("button", { name: "Hunting", exact: false }).click();
await page.getByRole("textbox", { name: "Search hunting evidence" }).fill("DNS name resolution");
await expect(page.getByRole("status")).toHaveText("1 of 6 matching events");
await expect(page.getByRole("status")).toHaveText("1 of 19 matching events");
await expect(page.getByRole("button", { name: /DNS name resolution timed out/ })).toBeVisible();
await page.getByRole("button", { name: /DNS name resolution timed out/ }).click();
await expect(page.getByRole("heading", { name: "Inspector", exact: true })).toBeVisible();