Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	src/domain/browserScenario.test.ts
#	src/domain/browserScenarioValues.ts
  • Loading branch information
kaoru0822-kitauji committed Oct 21, 2026
commit 52657195e6754366c7215882f38002d521ae65b6
57 changes: 57 additions & 0 deletions src/domain/browserScenario.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,60 @@ it("refuses an action step id that the provider reserves for the initial state",
browserScenarioSchema.parse(scenario("scenario_start_2")).actions,
).toHaveLength(2);
});

it.each([
{
field: "duration_ms",
action: { action: "wait_for_timeout", duration_ms: 2_147_483_648 },
},
{
field: "timeout_ms",
action: {
action: "wait_for",
locator: { kind: "css", selector: "#btn" },
state: "visible",
timeout_ms: 2_147_483_648,
},
},
])("rejects $field at its precise owning field", ({ field, action }) => {
const parsed = browserScenarioSchema.safeParse({
browser: { mode: "launch", executable_path: "/opt/chromium" },
start_url: { url: "https://app.example.test/" },
actions: [{ step_id: "overflow", ...action }],
});
if (parsed.success)
throw new Error("Expected unrepresentable timer rejection");
expect(parsed.error.issues).toMatchObject([
{ code: "too_big", maximum: 2_147_483_647, path: ["actions", 0, field] },
]);
});

it("preserves the largest representable timers and an omitted action deadline", () => {
const parsed = browserScenarioSchema.parse({
browser: { mode: "launch", executable_path: "/opt/chromium" },
start_url: { url: "https://app.example.test/" },
actions: [
{
step_id: "max-wait",
action: "wait_for_timeout",
duration_ms: 2_147_483_647,
},
{
step_id: "max-deadline",
action: "wait_for",
locator: { kind: "css", selector: "#btn" },
state: "visible",
timeout_ms: 2_147_483_647,
},
{
step_id: "unbounded",
action: "wait_for",
locator: { kind: "css", selector: "#btn" },
state: "visible",
},
],
});
expect(parsed.actions[0]).toMatchObject({ duration_ms: 2_147_483_647 });
expect(parsed.actions[1]).toMatchObject({ timeout_ms: 2_147_483_647 });
expect(parsed.actions[2]).not.toHaveProperty("timeout_ms");
});
5 changes: 0 additions & 5 deletions src/domain/browserScenarioValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ export const scenarioIdentifierSchema = z.string().regex(IDENTIFIER_PATTERN);
*/
export const BROWSER_SCENARIO_START_STEP_ID = "scenario_start";

const browserExecutablePathSchema = localPathStringSchema.refine(isAbsolute, {
message:
"executable_path must be an absolute local filesystem path (for example /opt/chromium/chrome or C:\\chromium\\chrome.exe)",
});

const browserScenarioBaseUrlSchema = z
.string()
.min(1)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.