mirror of
https://github.com/ppy/osu
synced 2025-01-20 21:10:49 +00:00
Merge pull request #14989 from peppy/osu-game-test-scene-improvements
Improve performance of `OsuGameTestScene` based tests
This commit is contained in:
commit
061697b4cd
@ -350,13 +350,13 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
// since most overlays use a scroll container that absorbs on mouse down
|
||||
NowPlayingOverlay nowPlayingOverlay = null;
|
||||
|
||||
AddStep("enter menu", () => InputManager.Key(Key.Enter));
|
||||
AddUntilStep("Wait for now playing load", () => (nowPlayingOverlay = Game.ChildrenOfType<NowPlayingOverlay>().FirstOrDefault()) != null);
|
||||
|
||||
AddStep("get and press now playing hotkey", () =>
|
||||
{
|
||||
nowPlayingOverlay = Game.ChildrenOfType<NowPlayingOverlay>().Single();
|
||||
InputManager.Key(Key.F6);
|
||||
});
|
||||
AddStep("enter menu", () => InputManager.Key(Key.Enter));
|
||||
AddUntilStep("toolbar displayed", () => Game.Toolbar.State.Value == Visibility.Visible);
|
||||
|
||||
AddStep("open now playing", () => InputManager.Key(Key.F6));
|
||||
AddUntilStep("now playing is visible", () => nowPlayingOverlay.State.Value == Visibility.Visible);
|
||||
|
||||
// drag tests
|
||||
|
||||
@ -417,7 +417,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
pushEscape(); // returns to osu! logo
|
||||
|
||||
AddStep("Hold escape", () => InputManager.PressKey(Key.Escape));
|
||||
AddUntilStep("Wait for intro", () => Game.ScreenStack.CurrentScreen is IntroTriangles);
|
||||
AddUntilStep("Wait for intro", () => Game.ScreenStack.CurrentScreen is IntroScreen);
|
||||
AddStep("Release escape", () => InputManager.ReleaseKey(Key.Escape));
|
||||
AddUntilStep("Wait for game exit", () => Game.ScreenStack.CurrentScreen == null);
|
||||
AddStep("test dispose doesn't crash", () => Game.Dispose());
|
||||
|
@ -22,6 +22,7 @@ using osu.Game.Scoring;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osuTK.Graphics;
|
||||
using IntroSequence = osu.Game.Configuration.IntroSequence;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
@ -126,7 +127,8 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
public new Bindable<IReadOnlyList<Mod>> SelectedMods => base.SelectedMods;
|
||||
|
||||
// if we don't do this, when running under nUnit the version that gets populated is that of nUnit.
|
||||
// if we don't apply these changes, when running under nUnit the version that gets populated is that of nUnit.
|
||||
public override Version AssemblyVersion => new Version(0, 0);
|
||||
public override string Version => "test game";
|
||||
|
||||
protected override Loader CreateLoader() => new TestLoader();
|
||||
@ -142,6 +144,9 @@ namespace osu.Game.Tests.Visual
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
LocalConfig.SetValue(OsuSetting.IntroSequence, IntroSequence.Circles);
|
||||
|
||||
API.Login("Rhythm Champion", "osu!");
|
||||
|
||||
Dependencies.Get<SessionStatics>().SetValue(Static.MutedAudioNotificationShownOnce, true);
|
||||
|
Loading…
Reference in New Issue
Block a user