Avoid test failures on non-triangle intro tests

This commit is contained in:
Dean Herbert 2022-01-30 18:59:18 +09:00
parent 52f1c2bfdb
commit 6a21d58325
4 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,8 @@ public abstract class IntroTestScene : OsuTestScene
[Cached] [Cached]
private OsuLogo logo; private OsuLogo logo;
protected abstract bool IntroReliesOnTrack { get; }
protected OsuScreenStack IntroStack; protected OsuScreenStack IntroStack;
private IntroScreen intro; private IntroScreen intro;
@ -103,6 +105,8 @@ public virtual void TestPlayIntroWithFailingAudioDevice()
}); });
AddUntilStep("wait for menu", () => intro.DidLoadMenu); AddUntilStep("wait for menu", () => intro.DidLoadMenu);
if (IntroReliesOnTrack)
AddUntilStep("wait for notification", () => notifications.UnreadCount.Value == 1); AddUntilStep("wait for notification", () => notifications.UnreadCount.Value == 1);
AddStep("uninstall delegate", () => trackResetDelegate?.Cancel()); AddStep("uninstall delegate", () => trackResetDelegate?.Cancel());

View File

@ -9,6 +9,7 @@ namespace osu.Game.Tests.Visual.Menus
[TestFixture] [TestFixture]
public class TestSceneIntroCircles : IntroTestScene public class TestSceneIntroCircles : IntroTestScene
{ {
protected override bool IntroReliesOnTrack => false;
protected override IntroScreen CreateScreen() => new IntroCircles(); protected override IntroScreen CreateScreen() => new IntroCircles();
} }
} }

View File

@ -9,6 +9,7 @@ namespace osu.Game.Tests.Visual.Menus
[TestFixture] [TestFixture]
public class TestSceneIntroTriangles : IntroTestScene public class TestSceneIntroTriangles : IntroTestScene
{ {
protected override bool IntroReliesOnTrack => true;
protected override IntroScreen CreateScreen() => new IntroTriangles(); protected override IntroScreen CreateScreen() => new IntroTriangles();
} }
} }

View File

@ -10,6 +10,7 @@ namespace osu.Game.Tests.Visual.Menus
[TestFixture] [TestFixture]
public class TestSceneIntroWelcome : IntroTestScene public class TestSceneIntroWelcome : IntroTestScene
{ {
protected override bool IntroReliesOnTrack => false;
protected override IntroScreen CreateScreen() => new IntroWelcome(); protected override IntroScreen CreateScreen() => new IntroWelcome();
public override void TestPlayIntro() public override void TestPlayIntro()