( device: DeviceInfo, interactor: Interactor, positionals: string[], )
| 892 | } |
| 893 | |
| 894 | export async function handleRotateGestureCommand( |
| 895 | device: DeviceInfo, |
| 896 | interactor: Interactor, |
| 897 | positionals: string[], |
| 898 | ): Promise<Record<string, unknown>> { |
| 899 | // Cross-platform TV-target gate (also rejects Android TV) — see handlePinchCommand. |
| 900 | if (device.target === 'tv') { |
| 901 | throw new AppError('UNSUPPORTED_OPERATION', 'gesture rotate is not supported on tvOS'); |
| 902 | } |
| 903 | if (isMacOs(device)) { |
| 904 | throw new AppError( |
| 905 | 'UNSUPPORTED_OPERATION', |
| 906 | 'gesture rotate is not supported on macOS; XCTest rotation gestures are available only for iOS app sessions.', |
| 907 | ); |
| 908 | } |
| 909 | |
| 910 | const { degrees, x, y, velocity } = parseRotateGestureParams(positionals); |
| 911 | |
| 912 | const interactionResult = await interactor.rotateGesture(degrees, x, y, velocity); |
| 913 | return { |
| 914 | degrees, |
| 915 | ...(x !== undefined && y !== undefined ? { x, y } : {}), |
| 916 | velocity, |
| 917 | ...interactionResult, |
| 918 | ...successText(`Rotated gesture ${degrees} degrees`), |
| 919 | }; |
| 920 | } |
| 921 | |
| 922 | export async function handleTransformGestureCommand( |
| 923 | device: DeviceInfo, |
no test coverage detected