mirror of
https://github.com/ppy/osu.git
synced 2025-01-22 15:12:54 +08:00
Fix intermittent PerformFromScreen
test failures due to incorrect screen sequence
These tests were manually pushing the `PlayerLoader` / `Player` instances to `SongSelect`, which bypasses safeties in place which avoid the exact issue that came up in https://github.com/ppy/osu/runs/2951759236 (see `AllowSelection` flag specifically).
This commit is contained in:
parent
7a6e67e694
commit
719852435f
@ -11,6 +11,7 @@ using osu.Game.Overlays;
|
|||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Tests.Beatmaps.IO;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
using static osu.Game.Tests.Visual.Navigation.TestSceneScreenNavigation;
|
using static osu.Game.Tests.Visual.Navigation.TestSceneScreenNavigation;
|
||||||
|
|
||||||
@ -57,8 +58,11 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPerformAtSongSelectFromPlayerLoader()
|
public void TestPerformAtSongSelectFromPlayerLoader()
|
||||||
{
|
{
|
||||||
|
AddStep("import beatmap", () => ImportBeatmapTest.LoadQuickOszIntoOsu(Game).Wait());
|
||||||
PushAndConfirm(() => new TestPlaySongSelect());
|
PushAndConfirm(() => new TestPlaySongSelect());
|
||||||
PushAndConfirm(() => new PlayerLoader(() => new SoloPlayer()));
|
|
||||||
|
AddStep("Press enter", () => InputManager.Key(Key.Enter));
|
||||||
|
AddUntilStep("Wait for new screen", () => Game.ScreenStack.CurrentScreen is PlayerLoader);
|
||||||
|
|
||||||
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true, new[] { typeof(TestPlaySongSelect) }));
|
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true, new[] { typeof(TestPlaySongSelect) }));
|
||||||
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is TestPlaySongSelect);
|
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is TestPlaySongSelect);
|
||||||
@ -68,8 +72,11 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestPerformAtMenuFromPlayerLoader()
|
public void TestPerformAtMenuFromPlayerLoader()
|
||||||
{
|
{
|
||||||
|
AddStep("import beatmap", () => ImportBeatmapTest.LoadQuickOszIntoOsu(Game).Wait());
|
||||||
PushAndConfirm(() => new TestPlaySongSelect());
|
PushAndConfirm(() => new TestPlaySongSelect());
|
||||||
PushAndConfirm(() => new PlayerLoader(() => new SoloPlayer()));
|
|
||||||
|
AddStep("Press enter", () => InputManager.Key(Key.Enter));
|
||||||
|
AddUntilStep("Wait for new screen", () => Game.ScreenStack.CurrentScreen is PlayerLoader);
|
||||||
|
|
||||||
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true));
|
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true));
|
||||||
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||||
|
Loading…
Reference in New Issue
Block a user