Implement player PoC (#7)
This commit is contained in:
28
src/Recordingtest.Player/IPlayerHost.cs
Normal file
28
src/Recordingtest.Player/IPlayerHost.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user