1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 23:07:26 +08:00

Merge pull request #16609 from peppy/fix-realm-related-failures

Fix some realm-related test failures
This commit is contained in:
Dan Balasescu 2022-01-26 15:31:18 +09:00 committed by GitHub
commit 701f00a4b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -50,10 +50,20 @@ namespace osu.Game.Tests.Visual.Navigation
AddStep("close settings", () => Game.Settings.Hide());
AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely());
PushAndConfirm(() => new PlaySongSelect());
AddUntilStep("wait for selection", () => !Game.Beatmap.IsDefault);
AddStep("enter gameplay", () => InputManager.Key(Key.Enter));
AddUntilStep("wait for player", () =>
{
// dismiss any notifications that may appear (ie. muted notification).
clickMouseInCentre();
return player != null;
});
AddUntilStep("wait for gameplay", () => player?.IsBreakTime.Value == false);
AddStep("press 'z'", () => InputManager.Key(Key.Z));
@ -63,6 +73,12 @@ namespace osu.Game.Tests.Visual.Navigation
AddAssert("key counter did increase", () => keyCounter.CountPresses == 1);
}
private void clickMouseInCentre()
{
InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre);
InputManager.Click(MouseButton.Left);
}
private KeyBindingsSubsection osuBindingSubsection => keyBindingPanel
.ChildrenOfType<VariantBindingsSubsection>()
.FirstOrDefault(s => s.Ruleset.ShortName == "osu");

View File

@ -64,13 +64,13 @@ namespace osu.Game.Tests.Visual.SongSelect
{
base.SetUpSteps();
AddStep("delete all beatmaps", () =>
AddStep("reset defaults", () =>
{
Ruleset.Value = new OsuRuleset().RulesetInfo;
manager?.Delete(manager.GetAllUsableBeatmapSets());
Beatmap.SetDefault();
});
AddStep("delete all beatmaps", () => manager?.Delete());
}
[Test]