Files
paseo/packages/app/e2e/support/helpers/timeline-resume.ts
T
Mohamed BoudraandGitHub 5a30affd7f Skip unrelated required checks without losing their names (#2542)
* fix(ci): skip unrelated required checks cleanly

Matrix jobs had to start no-op runners to preserve interpolated required-check names. Static named jobs let GitHub report genuine skipped conclusions while keeping those names stable.

* fix(ci): gate changes to install patching script

* fix(ci): route cross-package test contracts narrowly

* fix(ci): keep routed contracts merge-blocking

* fix(server): exclude nested test utilities from builds

* fix(ci): cover app-owned native and browser domains

* refactor(ci): align tests with runtime domains

Own browser specs, desktop specs, and Electron-only app code by stable directories so PR routing does not depend on filename conventions. Keep desktop integration coverage inside the required desktop check.

* fix(ci): keep routing and desktop suites isolated

The routing regression must run before dependency installation, and desktop Vitest must not collect Playwright-owned specs.

* fix(ci): isolate desktop e2e runtime

* perf(test): isolate Playwright workers

* perf(test): parallelize Playwright within specs

* fix(test): keep Playwright file scheduling

* fix(test): share dynamic Metro fixture

* fix(test): preserve own-host restart fixtures

* fix(ci): preserve routed contracts after rebase

* Stabilize Playwright wheel-scroll assertions
2026-08-02 00:56:05 +08:00

69 lines
2.1 KiB
TypeScript

import { expect, type Page } from "@playwright/test";
import type { installDaemonWebSocketGate } from "./daemon-websocket-gate";
import type { LongTimelineAgent } from "./timeline-pagination";
import { expectReconnectingToastGone, expectReconnectingToastVisible } from "./workspace-ui";
type DaemonWebSocketGate = Awaited<ReturnType<typeof installDaemonWebSocketGate>>;
export interface TimelineRequestCounts {
after: number;
tail: number;
}
export interface BackgroundTimelineTurns {
firstPrompt: string;
newestPrompt: string;
}
function backgroundPrompt(index: number): string {
return `timeline-resume-background-${index}: emit 1 coalesced agent stream updates`;
}
export async function commitTimelineTurnsWhileDisconnected(
agent: LongTimelineAgent,
count: number,
): Promise<BackgroundTimelineTurns> {
for (let index = 0; index < count; index += 1) {
await agent.client.sendAgentMessage(agent.agentId, backgroundPrompt(index));
await agent.client.waitForFinish(agent.agentId, 15_000);
}
return {
firstPrompt: backgroundPrompt(0),
newestPrompt: backgroundPrompt(count - 1),
};
}
export function rememberTimelineRequestCounts(gate: DaemonWebSocketGate): TimelineRequestCounts {
return {
after: gate.getTimelineRequestCount("after"),
tail: gate.getTimelineRequestCount("tail"),
};
}
export function expectOneTailCheckWithoutCatchUpPages(
gate: DaemonWebSocketGate,
before: TimelineRequestCounts,
): void {
expect(gate.getTimelineRequestCount("tail") - before.tail).toBe(1);
expect(gate.getTimelineRequestCount("after") - before.after).toBe(0);
}
export async function disconnectViewedTimeline(
page: Page,
gate: DaemonWebSocketGate,
): Promise<void> {
await gate.drop();
await expectReconnectingToastVisible(page);
}
export async function restoreViewedTimelineWithHeldTail(
page: Page,
gate: DaemonWebSocketGate,
): Promise<void> {
gate.holdNextServerMessage("fetch_agent_timeline_response");
gate.restore();
await gate.waitForHeldServerMessage();
gate.releaseHeldServerMessage();
await expectReconnectingToastGone(page);
}