Fix smoke gaps: recorder target + VK translation, player enum + null guard (#11)
This commit is contained in:
@@ -153,6 +153,66 @@ baselines:
|
||||
Assert.Single(s.Baselines);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PlayerEngine_NullTarget_SkipsWithoutCalling()
|
||||
{
|
||||
var engine = new PlayerEngine();
|
||||
var host = new FakePlayerHost();
|
||||
var scenario = new Scenario
|
||||
{
|
||||
Steps =
|
||||
{
|
||||
new Step { Kind = StepKind.Click, Target = null },
|
||||
new Step { Kind = StepKind.Drag, Target = null },
|
||||
new Step { Kind = StepKind.Type, Target = null, Value = "hello" },
|
||||
},
|
||||
};
|
||||
|
||||
engine.Run(scenario, host);
|
||||
|
||||
Assert.Empty(host.Clicks);
|
||||
Assert.Empty(host.Drags);
|
||||
Assert.Empty(host.Types);
|
||||
Assert.Empty(host.Failures);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PlayerEngine_WheelKind_DoesNotThrow()
|
||||
{
|
||||
var engine = new PlayerEngine();
|
||||
var host = new FakePlayerHost();
|
||||
var scenario = new Scenario
|
||||
{
|
||||
Steps =
|
||||
{
|
||||
new Step { Kind = StepKind.Wheel, Value = "-120" },
|
||||
new Step { Kind = StepKind.Focus },
|
||||
},
|
||||
};
|
||||
|
||||
engine.Run(scenario, host);
|
||||
Assert.Empty(host.Failures);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ScenarioLoader_ParsesWheelAndFocusKinds()
|
||||
{
|
||||
const string yaml = """
|
||||
name: wheel-focus
|
||||
steps:
|
||||
- kind: wheel
|
||||
value: "-120"
|
||||
- kind: focus
|
||||
target:
|
||||
uia_path: "Window/Edit"
|
||||
offset: [0.5, 0.5]
|
||||
""";
|
||||
var s = ScenarioLoader.LoadFromString(yaml);
|
||||
Assert.Equal(2, s.Steps.Count);
|
||||
Assert.Equal(StepKind.Wheel, s.Steps[0].Kind);
|
||||
Assert.Equal(StepKind.Focus, s.Steps[1].Kind);
|
||||
}
|
||||
|
||||
private static string LocateEngineSource([CallerFilePath] string here = "")
|
||||
{
|
||||
// here = .../tests/Recordingtest.Player.Tests/PlayerEngineTests.cs
|
||||
|
||||
Reference in New Issue
Block a user