1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

Merge pull request #15800 from smoogipoo/fix-beatmap-thumbnail-test

Fix intermittent beatmap thumbnail test
This commit is contained in:
Dean Herbert 2021-11-25 23:00:26 +09:00 committed by GitHub
commit 837eaebdc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,6 +70,11 @@ namespace osu.Game.Tests.Visual.Beatmaps
AddWaitStep("wait some", 3); AddWaitStep("wait some", 3);
AddAssert("button still visible", () => playButton.IsPresent); 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<PlayButton>().Single().Progress.Value > 0.25);
AddUntilStep("progress > 0.5", () => thumbnail.ChildrenOfType<PlayButton>().Single().Progress.Value > 0.5);
AddUntilStep("progress > 0.75", () => thumbnail.ChildrenOfType<PlayButton>().Single().Progress.Value > 0.75);
AddUntilStep("wait for track to end", () => !playButton.Playing.Value); AddUntilStep("wait for track to end", () => !playButton.Playing.Value);
AddUntilStep("button hidden", () => !playButton.IsPresent); AddUntilStep("button hidden", () => !playButton.IsPresent);
} }