mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
e70fac7b44
The capability matrix admitted `viewport` on every Apple simulator and device while no Apple interactor implements `setViewport`, so the command was routed to the device and only rejected inside dispatch with the backend-shaped "viewport is not supported by this backend". Nothing can serve it there: Apple screen geometry is fixed by the selected device type and neither simctl nor XCTest exposes a resize primitive, so viewport is a web-surface contract (its CLI summary and docs already say so). Deny it in the descriptor's capability facet, matching the adjacent Android denial, and give the Apple family an unsupported hint that names the surface that does support it. Admission now fails before the request reaches the device: "viewport is not supported on this device" with supportedOn: web. The iOS simulator coverage manifest's known-gap row becomes a capability-denial row owned by the static coverage test, which retires the whole known-gap level and the `full:known-gaps` live scenario that existed only to pin this failure. Closes #1407
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
export type IosSimulatorScenario = {
|
|
id: string;
|
|
tier: 'smoke' | 'full';
|
|
};
|
|
|
|
type ScenarioRunnerKey =
|
|
| 'automationInput'
|
|
| 'captureClose'
|
|
| 'deviceLifecycle'
|
|
| 'fixtureReplays'
|
|
| 'formInput'
|
|
| 'inventoryInstall'
|
|
| 'lifecycleSystem'
|
|
| 'observabilityArtifacts';
|
|
|
|
type ScenarioDefinition = IosSimulatorScenario & {
|
|
runner: ScenarioRunnerKey;
|
|
};
|
|
|
|
const SCENARIO_DEFINITIONS: readonly ScenarioDefinition[] = [
|
|
{ id: 'smoke:inventory-install', runner: 'inventoryInstall', tier: 'smoke' },
|
|
{ id: 'smoke:automation-input', runner: 'automationInput', tier: 'smoke' },
|
|
{ id: 'smoke:form-input', runner: 'formInput', tier: 'smoke' },
|
|
{ id: 'smoke:capture-close', runner: 'captureClose', tier: 'smoke' },
|
|
{ id: 'full:lifecycle-system', runner: 'lifecycleSystem', tier: 'full' },
|
|
{
|
|
id: 'full:observability-artifacts',
|
|
runner: 'observabilityArtifacts',
|
|
tier: 'full',
|
|
},
|
|
{ id: 'full:fixture-replays', runner: 'fixtureReplays', tier: 'full' },
|
|
{ id: 'full:device-lifecycle', runner: 'deviceLifecycle', tier: 'full' },
|
|
] as const;
|
|
|
|
export const IOS_SIMULATOR_LIVE_SCENARIOS: readonly IosSimulatorScenario[] = SCENARIO_DEFINITIONS;
|
|
|
|
export function bindIosSimulatorScenarios<Context>(
|
|
runners: Record<ScenarioRunnerKey, (context: Context) => Promise<void>>,
|
|
): readonly (IosSimulatorScenario & { run: (context: Context) => Promise<void> })[] {
|
|
return SCENARIO_DEFINITIONS.map(({ id, runner, tier }) => ({
|
|
id,
|
|
run: runners[runner],
|
|
tier,
|
|
}));
|
|
}
|