(params: {
device: DeviceInfo;
x1: number;
y1: number;
x2: number;
y2: number;
count: number;
pauseMs: number;
pattern: string;
effectiveDurationMs: number;
})
| 445 | // runner-side performDragSeries the daemon no longer invokes. iOS touch targets request the same |
| 446 | // synthesized, duration-aware drag path as one-shot swipe; macOS/tvOS keep coordinate drag. |
| 447 | function buildSwipeSequenceSteps(params: { |
| 448 | device: DeviceInfo; |
| 449 | x1: number; |
| 450 | y1: number; |
| 451 | x2: number; |
| 452 | y2: number; |
| 453 | count: number; |
| 454 | pauseMs: number; |
| 455 | pattern: string; |
| 456 | effectiveDurationMs: number; |
| 457 | }): RunnerSequenceStep[] { |
| 458 | const { device, x1, y1, x2, y2, count, pauseMs, pattern, effectiveDurationMs } = params; |
| 459 | const synthesized = isIosFamily(device) && !isTvOsDevice(device); |
| 460 | return Array.from({ length: count }, (_, index) => { |
| 461 | const reverse = pattern === 'ping-pong' && index % 2 === 1; |
| 462 | const isLast = index === count - 1; |
| 463 | return { |
| 464 | kind: 'drag' as const, |
| 465 | x: reverse ? x2 : x1, |
| 466 | y: reverse ? y2 : y1, |
| 467 | x2: reverse ? x1 : x2, |
| 468 | y2: reverse ? y1 : y2, |
| 469 | durationMs: effectiveDurationMs, |
| 470 | ...(synthesized ? { synthesized: true } : {}), |
| 471 | ...(!isLast && pauseMs > 0 ? { pauseMs } : {}), |
| 472 | }; |
| 473 | }); |
| 474 | } |
| 475 | |
| 476 | // Sequence step errors carry a chunk-local failedStepIndex and completedSteps; rebase both onto the |
| 477 | // global series so the error names the true step and completed count across chunk boundaries. |
no test coverage detected