Files
recordingtest/src/Recordingtest.Player/IPlayerHost.cs
2026-04-07 14:28:11 +09:00

29 lines
1.0 KiB
C#

using Recordingtest.Player.Model;
namespace Recordingtest.Player;
/// <summary>Element bounds in screen pixels.</summary>
public readonly record struct ElementBounds(double X, double Y, double Width, double Height);
/// <summary>Resolved element handle (opaque to the engine).</summary>
public readonly record struct ResolvedElement(ElementBounds Bounds, object? Native);
public readonly record struct ScreenPoint(int X, int Y);
public interface IPlayerHost
{
/// <summary>Resolve a UIA path with retry/timeout. Returns null if not found.</summary>
ResolvedElement? ResolveElement(string uiaPath, TimeSpan timeout);
/// <summary>Wait for a wait_for hint to be satisfied. Returns false on timeout.</summary>
bool WaitFor(string waitForHint, TimeSpan timeout);
void Click(ScreenPoint point);
void Type(string text);
void Drag(ScreenPoint from, ScreenPoint to);
void Hotkey(string keys);
void CaptureCheckpoint(int afterStep, string saveAs);
void CaptureFailureArtifacts(int stepIndex, string reason);
}