mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Ensure editor tests wait for load to complete
This commit is contained in:
@ -3,9 +3,13 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
@ -13,6 +17,8 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Editor), typeof(EditorScreen) };
|
||||
|
||||
protected Editor Editor { get; private set; }
|
||||
|
||||
private readonly Ruleset ruleset;
|
||||
|
||||
protected EditorTestScene(Ruleset ruleset)
|
||||
@ -30,7 +36,9 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
base.SetUpSteps();
|
||||
|
||||
AddStep("Load editor", () => LoadScreen(new Editor()));
|
||||
AddStep("load editor", () => LoadScreen(Editor = new Editor()));
|
||||
AddUntilStep("wait for editor to load", () => Editor.ChildrenOfType<HitObjectComposer>().FirstOrDefault()?.IsLoaded == true
|
||||
&& Editor.ChildrenOfType<TimelineArea>().FirstOrDefault()?.IsLoaded == true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user