mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 06:09:54 +08:00
Manually load song select in each test case
This commit is contained in:
@@ -83,20 +83,13 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
Stack.ScreenExited += updateFooter;
|
||||
}
|
||||
|
||||
[SetUpSteps]
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
base.SetUpSteps();
|
||||
|
||||
AddStep("load screen", () => Stack.Push(new SoloSongSelect()));
|
||||
AddUntilStep("wait for load", () => Stack.CurrentScreen is Screens.SelectV2.SongSelect songSelect && songSelect.IsLoaded);
|
||||
}
|
||||
|
||||
#region Footer
|
||||
|
||||
[Test]
|
||||
public void TestMods()
|
||||
{
|
||||
loadSongSelect();
|
||||
|
||||
AddStep("one mod", () => SelectedMods.Value = new List<Mod> { new OsuModHidden() });
|
||||
AddStep("two mods", () => SelectedMods.Value = new List<Mod> { new OsuModHidden(), new OsuModHardRock() });
|
||||
AddStep("three mods", () => SelectedMods.Value = new List<Mod> { new OsuModHidden(), new OsuModHardRock(), new OsuModDoubleTime() });
|
||||
@@ -124,6 +117,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
[Test]
|
||||
public void TestShowOptions()
|
||||
{
|
||||
loadSongSelect();
|
||||
|
||||
AddStep("enable options", () =>
|
||||
{
|
||||
var optionsButton = this.ChildrenOfType<ScreenFooterButton>().Last();
|
||||
@@ -136,6 +131,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
[Test]
|
||||
public void TestState()
|
||||
{
|
||||
loadSongSelect();
|
||||
|
||||
AddToggleStep("set options enabled state", state => this.ChildrenOfType<ScreenFooterButton>().Last().Enabled.Value = state);
|
||||
}
|
||||
|
||||
@@ -143,6 +140,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
// [Test]
|
||||
// public void TestFooterRandom()
|
||||
// {
|
||||
// loadSongSelect();
|
||||
//
|
||||
// AddStep("press F2", () => InputManager.Key(Key.F2));
|
||||
// AddAssert("next random invoked", () => nextRandomCalled && !previousRandomCalled);
|
||||
// }
|
||||
@@ -150,6 +149,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
// [Test]
|
||||
// public void TestFooterRandomViaMouse()
|
||||
// {
|
||||
// loadSongSelect();
|
||||
//
|
||||
// AddStep("click button", () =>
|
||||
// {
|
||||
// InputManager.MoveMouseTo(randomButton);
|
||||
@@ -161,6 +162,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
// [Test]
|
||||
// public void TestFooterRewind()
|
||||
// {
|
||||
// loadSongSelect();
|
||||
//
|
||||
// AddStep("press Shift+F2", () =>
|
||||
// {
|
||||
// InputManager.PressKey(Key.LShift);
|
||||
@@ -174,6 +177,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
// [Test]
|
||||
// public void TestFooterRewindViaShiftMouseLeft()
|
||||
// {
|
||||
// loadSongSelect();
|
||||
//
|
||||
// AddStep("shift + click button", () =>
|
||||
// {
|
||||
// InputManager.PressKey(Key.LShift);
|
||||
@@ -187,6 +192,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
// [Test]
|
||||
// public void TestFooterRewindViaMouseRight()
|
||||
// {
|
||||
// loadSongSelect();
|
||||
//
|
||||
// AddStep("right click button", () =>
|
||||
// {
|
||||
// InputManager.MoveMouseTo(randomButton);
|
||||
@@ -198,6 +205,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
[Test]
|
||||
public void TestOverlayPresent()
|
||||
{
|
||||
loadSongSelect();
|
||||
|
||||
AddStep("Press F1", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(this.ChildrenOfType<FooterButtonMods>().Single());
|
||||
@@ -209,6 +218,12 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
|
||||
#endregion
|
||||
|
||||
private void loadSongSelect()
|
||||
{
|
||||
AddStep("load screen", () => Stack.Push(new SoloSongSelect()));
|
||||
AddUntilStep("wait for load", () => Stack.CurrentScreen is Screens.SelectV2.SongSelect songSelect && songSelect.IsLoaded);
|
||||
}
|
||||
|
||||
private void updateFooter(IScreen? _, IScreen? newScreen)
|
||||
{
|
||||
if (newScreen is IOsuScreen osuScreen && osuScreen.ShowFooter)
|
||||
|
||||
Reference in New Issue
Block a user