From 672c1d36dc29a7580c6fb8028ac95d1a120de5b4 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 13 Jan 2022 05:52:04 +0900 Subject: [PATCH] Fix intermitten screen navigation tests --- .../Visual/Navigation/TestSceneScreenNavigation.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs index d094d8b688..60aabf5639 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs @@ -251,8 +251,9 @@ namespace osu.Game.Tests.Visual.Navigation [Test] public void TestModSelectInput() { - TestPlaySongSelect songSelect = null; + AddUntilStep("Wait for toolbar to load", () => Game.Toolbar.IsLoaded); + TestPlaySongSelect songSelect = null; PushAndConfirm(() => songSelect = new TestPlaySongSelect()); AddStep("Show mods overlay", () => songSelect.ModSelectOverlay.Show()); @@ -272,8 +273,9 @@ namespace osu.Game.Tests.Visual.Navigation [Test] public void TestBeatmapOptionsInput() { - TestPlaySongSelect songSelect = null; + AddUntilStep("Wait for toolbar to load", () => Game.Toolbar.IsLoaded); + TestPlaySongSelect songSelect = null; PushAndConfirm(() => songSelect = new TestPlaySongSelect()); AddStep("Show options overlay", () => songSelect.BeatmapOptionsOverlay.Show()); @@ -293,6 +295,8 @@ namespace osu.Game.Tests.Visual.Navigation [Test] public void TestSettingsViaHotkeyFromMainMenu() { + AddUntilStep("Wait for toolbar to load", () => Game.Toolbar.IsLoaded); + AddAssert("toolbar not displayed", () => Game.Toolbar.State.Value == Visibility.Hidden); AddStep("press settings hotkey", () => @@ -308,10 +312,11 @@ namespace osu.Game.Tests.Visual.Navigation [Test] public void TestToolbarHiddenByUser() { - AddStep("Enter menu", () => InputManager.Key(Key.Enter)); - AddUntilStep("Wait for toolbar to load", () => Game.Toolbar.IsLoaded); + AddStep("Enter menu", () => InputManager.Key(Key.Enter)); + AddUntilStep("Toolbar is visible", () => Game.Toolbar.State.Value == Visibility.Visible); + AddStep("Hide toolbar", () => { InputManager.PressKey(Key.ControlLeft);