1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 04:32:57 +08:00

Move test to a mod test and add more resilient test logic

This commit is contained in:
Dean Herbert 2023-02-14 15:07:45 +09:00
parent a820c0c8eb
commit 9e04a36d86
2 changed files with 10 additions and 13 deletions

View File

@ -3,26 +3,23 @@
using NUnit.Framework;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Tests.Visual;
using osuTK.Input;
namespace osu.Game.Rulesets.Osu.Tests
namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public partial class TestSceneInstantResume : TestSceneOsuPlayer
public partial class TestSceneOsuModAutopilot : OsuModTestScene
{
protected override bool HasCustomSteps => true;
protected override TestPlayer CreatePlayer(Ruleset ruleset)
{
SelectedMods.Value = new[] { new OsuModAutopilot() };
return new TestPlayer();
}
[Test]
public void TestInstantResume()
{
CreateTest();
CreateModTest(new ModTestData
{
Mod = new OsuModAutopilot(),
PassCondition = () => true,
Autoplay = false,
});
AddUntilStep("wait for gameplay start", () => Player.LocalUserPlaying.Value);
AddStep("press pause", () => InputManager.PressKey(Key.Escape));
AddUntilStep("wait until paused", () => Player.GameplayClockContainer.IsPaused.Value);
AddStep("release pause", () => InputManager.ReleaseKey(Key.Escape));

View File

@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual
protected override bool CheckModsAllowFailure() => allowFail;
public ModTestPlayer(ModTestData data, bool allowFail)
: base(false, false)
: base(true, false)
{
this.allowFail = allowFail;
currentTestData = data;