From d0c0b7ce476971c039bf8ad5d6dd9e325b975ea5 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 25 Nov 2021 22:05:39 +0900 Subject: [PATCH] Fix intermittent beatmap thumbnail test --- .../Visual/Beatmaps/TestSceneBeatmapCardThumbnail.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Tests/Visual/Beatmaps/TestSceneBeatmapCardThumbnail.cs b/osu.Game.Tests/Visual/Beatmaps/TestSceneBeatmapCardThumbnail.cs index 1b4542d946..a5b52f75f6 100644 --- a/osu.Game.Tests/Visual/Beatmaps/TestSceneBeatmapCardThumbnail.cs +++ b/osu.Game.Tests/Visual/Beatmaps/TestSceneBeatmapCardThumbnail.cs @@ -70,6 +70,11 @@ public void TestThumbnailPreview() AddWaitStep("wait some", 3); AddAssert("button still visible", () => playButton.IsPresent); + // The track plays in real-time, so we need to check for progress in increments to avoid timeout. + AddUntilStep("progress > 0.25", () => thumbnail.ChildrenOfType().Single().Progress.Value > 0.25); + AddUntilStep("progress > 0.5", () => thumbnail.ChildrenOfType().Single().Progress.Value > 0.5); + AddUntilStep("progress > 0.75", () => thumbnail.ChildrenOfType().Single().Progress.Value > 0.75); + AddUntilStep("wait for track to end", () => !playButton.Playing.Value); AddUntilStep("button hidden", () => !playButton.IsPresent); }