mirror of
https://github.com/osukey/osukey.git
synced 2025-05-08 15:17:24 +09:00
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.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -150,6 +151,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
public void TestUpdateLocalBeatmap()
|
public void TestUpdateLocalBeatmap()
|
||||||
{
|
{
|
||||||
DialogOverlay dialogOverlay = null!;
|
DialogOverlay dialogOverlay = null!;
|
||||||
|
UpdateBeatmapSetButton? updateButton = null;
|
||||||
|
|
||||||
AddStep("create carousel with dialog overlay", () =>
|
AddStep("create carousel with dialog overlay", () =>
|
||||||
{
|
{
|
||||||
@ -176,7 +178,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
carousel.UpdateBeatmapSet(testBeatmapSetInfo);
|
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);
|
AddAssert("dialog displayed", () => dialogOverlay.CurrentDialog is UpdateLocalConfirmationDialog);
|
||||||
AddStep("click confirmation", () =>
|
AddStep("click confirmation", () =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user