Resolve broken test scene

This commit is contained in:
smoogipoo 2020-04-23 10:37:05 +09:00
parent 7796593b2c
commit 40f11ed15c
2 changed files with 7 additions and 4 deletions

View File

@ -19,7 +19,6 @@ namespace osu.Game.Tests.Visual.Editor
}
private EditorBeatmap editorBeatmap;
private TestEditor editor;
public override void SetUpSteps()
{
@ -153,9 +152,11 @@ namespace osu.Game.Tests.Visual.Editor
AddAssert("no hitobject added", () => addedObject == null);
}
private void addUndoSteps() => AddStep("undo", () => editor.Undo());
private void addUndoSteps() => AddStep("undo", () => ((TestEditor)Editor).Undo());
private void addRedoSteps() => AddStep("redo", () => editor.Redo());
private void addRedoSteps() => AddStep("redo", () => ((TestEditor)Editor).Redo());
protected override Screens.Edit.Editor CreateEditor() => new TestEditor();
private class TestEditor : Screens.Edit.Editor
{

View File

@ -36,9 +36,11 @@ namespace osu.Game.Tests.Visual
{
base.SetUpSteps();
AddStep("load editor", () => LoadScreen(Editor = new Editor()));
AddStep("load editor", () => LoadScreen(Editor = CreateEditor()));
AddUntilStep("wait for editor to load", () => Editor.ChildrenOfType<HitObjectComposer>().FirstOrDefault()?.IsLoaded == true
&& Editor.ChildrenOfType<TimelineArea>().FirstOrDefault()?.IsLoaded == true);
}
protected virtual Editor CreateEditor() => new Editor();
}
}