diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneUpdateBeatmapSetButton.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneUpdateBeatmapSetButton.cs index f76f050546..96cfbe4dd1 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneUpdateBeatmapSetButton.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneUpdateBeatmapSetButton.cs @@ -6,6 +6,7 @@ using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; +using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Testing; using osu.Game.Beatmaps; @@ -150,6 +151,7 @@ public void TestDownloadFailed() public void TestUpdateLocalBeatmap() { DialogOverlay dialogOverlay = null!; + UpdateBeatmapSetButton? updateButton = null; AddStep("create carousel with dialog overlay", () => { @@ -176,7 +178,8 @@ public void TestUpdateLocalBeatmap() carousel.UpdateBeatmapSet(testBeatmapSetInfo); }); - AddStep("click button", () => getUpdateButton()?.TriggerClick()); + AddUntilStep("wait for update button", () => (updateButton = getUpdateButton()) != null); + AddStep("click button", () => updateButton.AsNonNull().TriggerClick()); AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is UpdateLocalConfirmationDialog); AddStep("click confirmation", () =>