Expand test coverage

- Covers fail case that wasn't covered before
- Removes arbitrary wait step that was inevitably going to cause
  intermittent test failures
This commit is contained in:
Bartłomiej Dach 2024-06-28 09:30:28 +02:00
parent b36e0f0875
commit ace6427d40
No known key found for this signature in database
1 changed files with 5 additions and 5 deletions

View File

@ -126,10 +126,11 @@ public void TestGameplayTestWhenTrackRunning()
AddAssert("sample playback re-enabled", () => !Editor.SamplePlaybackDisabled.Value);
}
[Test]
public void TestGameplayTestAtEndOfBeatmap()
[TestCase(2000)] // chosen to be after last object in the map
[TestCase(22000)] // chosen to be in the middle of the last spinner
public void TestGameplayTestAtEndOfBeatmap(int offsetFromEnd)
{
AddStep("seek to last 2 seconds", () => EditorClock.Seek(importedBeatmapSet.MaxLength - 2000));
AddStep($"seek to end minus {offsetFromEnd}ms", () => EditorClock.Seek(importedBeatmapSet.MaxLength - offsetFromEnd));
AddStep("click test gameplay button", () =>
{
var button = Editor.ChildrenOfType<TestGameplayButton>().Single();
@ -140,8 +141,7 @@ public void TestGameplayTestAtEndOfBeatmap()
AddUntilStep("player pushed", () => Stack.CurrentScreen is EditorPlayer);
AddWaitStep("wait some", 5);
AddAssert("current screen is editor", () => Stack.CurrentScreen is Editor);
AddUntilStep("current screen is editor", () => Stack.CurrentScreen is Editor);
}
[Test]