mirror of https://github.com/ppy/osu
Fix flaky update beatmap set test
It is generally not possible to click a button that's not yet there, and it turns out that when the test in question is ran headless, it may not necessarily be there immediately.
This commit is contained in:
parent
47d7d6fad9
commit
df66a0c2e9
|
@ -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", () =>
|
||||
|
|
Loading…
Reference in New Issue