Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/contracts/src/dispatch-disclosure.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const DISPATCH_DISCLOSURE_DRIVER_OWNERS: Readonly<Record<string, string>>
'web-agent-browser.':
'packages/platform-web/src/__tests__/agent-browser-provider-dispatch-disclosure.test.ts',
'maestro-direct.':
'src/__tests__/daemon-composition/interaction/interaction-touch-direct-ios.test.ts',
'packages/daemon/src/execution/interaction/internal/interaction-touch-direct-ios.test.ts',
};

/** The per-row driving loop every driver file carries. */
Expand Down
16 changes: 0 additions & 16 deletions packages/daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
"types": "./src/execution/__tests__/interaction-get-runtime-fixture.ts",
"default": "./src/execution/__tests__/interaction-get-runtime-fixture.ts"
},
"./testing/__tests__/ios-comparison-key-fixture": {
"types": "./src/core/__tests__/ios-comparison-key-fixture.ts",
"default": "./src/core/__tests__/ios-comparison-key-fixture.ts"
},
"./testing/__tests__/legacy-snapshot-capture-fixture": {
"types": "./src/__tests__/support/legacy-snapshot-capture-fixture.ts",
"default": "./src/__tests__/support/legacy-snapshot-capture-fixture.ts"
Expand All @@ -68,10 +64,6 @@
"types": "./src/__tests__/support/platform-services-fixture.ts",
"default": "./src/__tests__/support/platform-services-fixture.ts"
},
"./testing/__tests__/replay-runtime/replay-command-fixture": {
"types": "./src/sessions/__tests__/replay-runtime/replay-command-fixture.ts",
"default": "./src/sessions/__tests__/replay-runtime/replay-command-fixture.ts"
},
"./testing/__tests__/request-router-dispatch-mocks": {
"types": "./src/__tests__/support/request-router-dispatch-mocks.ts",
"default": "./src/__tests__/support/request-router-dispatch-mocks.ts"
Expand Down Expand Up @@ -196,14 +188,6 @@
"types": "./src/execution/interaction/internal/interaction-android-escape.ts",
"default": "./src/execution/interaction/internal/interaction-android-escape.ts"
},
"./testing/interaction/internal/interaction-ios-tap-outcome": {
"types": "./src/execution/interaction/internal/interaction-ios-tap-outcome.ts",
"default": "./src/execution/interaction/internal/interaction-ios-tap-outcome.ts"
},
"./testing/interaction/internal/interaction-touch-android-readiness": {
"types": "./src/execution/interaction/internal/interaction-touch-android-readiness.ts",
"default": "./src/execution/interaction/internal/interaction-touch-android-readiness.ts"
},
"./testing/interaction/internal/interaction-touch-response": {
"types": "./src/execution/interaction/internal/interaction-touch-response.ts",
"default": "./src/execution/interaction/internal/interaction-touch-response.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { vi } from 'vitest';
import type {
Interactor,
RunnerContext,
SnapshotOptions,
SnapshotResult,
} from '@agent-device/contracts/interactor-types';
import type { DeviceInfo } from '@agent-device/kernel/device';
import { installInteractorResolution } from '../../core/interactor-resolution.ts';

type InteractorSnapshotCall = Readonly<{
device: DeviceInfo;
runnerContext: RunnerContext;
options: SnapshotOptions;
}>;

/**
* The snapshot the resolved interactor answers with. Every capture that falls back to
* `captureSnapshotWithInteractor` lands here with the `{ device, runnerContext, options }` the
* production seam hands the interactor, so a suite configures captures and reads their call
* arguments from one spy.
*/
export const mockInteractorSnapshot = vi.fn<
(call: InteractorSnapshotCall) => Promise<SnapshotResult>
>(async () => ({
nodes: [],
backend: 'xctest',
producer: 'apple-runner',
}));

/**
* Installs an interactor resolution whose interactor snapshots through
* {@link mockInteractorSnapshot}. Call from `beforeEach`; the spy keeps its configuration until the
* suite resets it.
*/
export function installInteractorSnapshotResolution(): void {
installInteractorResolution({
resolve: async (device, runnerContext) =>
({
snapshot: async (options: SnapshotOptions) =>
await mockInteractorSnapshot({ device, runnerContext, options }),
}) as unknown as Interactor,
});
}
Loading
Loading