mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Move test to a mod test and add more resilient test logic
This commit is contained in:
parent
a820c0c8eb
commit
9e04a36d86
@ -3,26 +3,23 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Rulesets.Osu.Mods;
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Tests.Visual;
|
|
||||||
using osuTK.Input;
|
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]
|
[Test]
|
||||||
public void TestInstantResume()
|
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));
|
AddStep("press pause", () => InputManager.PressKey(Key.Escape));
|
||||||
AddUntilStep("wait until paused", () => Player.GameplayClockContainer.IsPaused.Value);
|
AddUntilStep("wait until paused", () => Player.GameplayClockContainer.IsPaused.Value);
|
||||||
AddStep("release pause", () => InputManager.ReleaseKey(Key.Escape));
|
AddStep("release pause", () => InputManager.ReleaseKey(Key.Escape));
|
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
protected override bool CheckModsAllowFailure() => allowFail;
|
protected override bool CheckModsAllowFailure() => allowFail;
|
||||||
|
|
||||||
public ModTestPlayer(ModTestData data, bool allowFail)
|
public ModTestPlayer(ModTestData data, bool allowFail)
|
||||||
: base(false, false)
|
: base(true, false)
|
||||||
{
|
{
|
||||||
this.allowFail = allowFail;
|
this.allowFail = allowFail;
|
||||||
currentTestData = data;
|
currentTestData = data;
|
||||||
|
Loading…
Reference in New Issue
Block a user