mirror of
https://github.com/ppy/osu
synced 2025-01-12 09:09:44 +00:00
Move common step of toggling skin editor to own method
This commit is contained in:
parent
2b0e82be40
commit
243806e810
@ -26,29 +26,6 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
private TestPlaySongSelect songSelect;
|
private TestPlaySongSelect songSelect;
|
||||||
private SkinEditor skinEditor => Game.ChildrenOfType<SkinEditor>().FirstOrDefault();
|
private SkinEditor skinEditor => Game.ChildrenOfType<SkinEditor>().FirstOrDefault();
|
||||||
|
|
||||||
private void advanceToSongSelect()
|
|
||||||
{
|
|
||||||
PushAndConfirm(() => songSelect = new TestPlaySongSelect());
|
|
||||||
AddUntilStep("wait for song select", () => songSelect.BeatmapSetsLoaded);
|
|
||||||
|
|
||||||
AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely());
|
|
||||||
|
|
||||||
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void openSkinEditor()
|
|
||||||
{
|
|
||||||
AddStep("open skin editor", () =>
|
|
||||||
{
|
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
|
||||||
InputManager.PressKey(Key.ShiftLeft);
|
|
||||||
InputManager.Key(Key.S);
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
|
||||||
InputManager.ReleaseKey(Key.ShiftLeft);
|
|
||||||
});
|
|
||||||
AddUntilStep("skin editor loaded", () => skinEditor != null);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestEditComponentDuringGameplay()
|
public void TestEditComponentDuringGameplay()
|
||||||
{
|
{
|
||||||
@ -88,6 +65,24 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddAssert("value is less than default", () => hitErrorMeter.JudgementLineThickness.Value < hitErrorMeter.JudgementLineThickness.Default);
|
AddAssert("value is less than default", () => hitErrorMeter.JudgementLineThickness.Value < hitErrorMeter.JudgementLineThickness.Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHideSkinEditorWhileDragging()
|
||||||
|
{
|
||||||
|
advanceToSongSelect();
|
||||||
|
openSkinEditor();
|
||||||
|
switchToGameplayScene();
|
||||||
|
AddStep("select all components", () =>
|
||||||
|
{
|
||||||
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
|
InputManager.Key(Key.A);
|
||||||
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
|
});
|
||||||
|
|
||||||
|
toggleSkinEditor();
|
||||||
|
|
||||||
|
AddUntilStep("no components selected", () => skinEditor.SelectedComponents.Count == 0);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestComponentsDeselectedOnSkinEditorHide()
|
public void TestComponentsDeselectedOnSkinEditorHide()
|
||||||
{
|
{
|
||||||
@ -101,14 +96,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("toggle skin editor", () =>
|
toggleSkinEditor();
|
||||||
{
|
|
||||||
InputManager.PressKey(Key.ControlLeft);
|
|
||||||
InputManager.PressKey(Key.ShiftLeft);
|
|
||||||
InputManager.Key(Key.S);
|
|
||||||
InputManager.ReleaseKey(Key.ControlLeft);
|
|
||||||
InputManager.ReleaseKey(Key.ShiftLeft);
|
|
||||||
});
|
|
||||||
|
|
||||||
AddUntilStep("no components selected", () => skinEditor.SelectedComponents.Count == 0);
|
AddUntilStep("no components selected", () => skinEditor.SelectedComponents.Count == 0);
|
||||||
}
|
}
|
||||||
@ -171,6 +159,34 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddUntilStep("mod overlay closed", () => songSelect.ModSelectOverlay.State.Value == Visibility.Hidden);
|
AddUntilStep("mod overlay closed", () => songSelect.ModSelectOverlay.State.Value == Visibility.Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void advanceToSongSelect()
|
||||||
|
{
|
||||||
|
PushAndConfirm(() => songSelect = new TestPlaySongSelect());
|
||||||
|
AddUntilStep("wait for song select", () => songSelect.BeatmapSetsLoaded);
|
||||||
|
|
||||||
|
AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely());
|
||||||
|
|
||||||
|
AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openSkinEditor()
|
||||||
|
{
|
||||||
|
toggleSkinEditor();
|
||||||
|
AddUntilStep("skin editor loaded", () => skinEditor != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleSkinEditor()
|
||||||
|
{
|
||||||
|
AddStep("toggle skin editor", () =>
|
||||||
|
{
|
||||||
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
|
InputManager.PressKey(Key.ShiftLeft);
|
||||||
|
InputManager.Key(Key.S);
|
||||||
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
|
InputManager.ReleaseKey(Key.ShiftLeft);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void switchToGameplayScene()
|
private void switchToGameplayScene()
|
||||||
{
|
{
|
||||||
AddStep("Click gameplay scene button", () => skinEditor.ChildrenOfType<SkinEditorSceneLibrary.SceneButton>().First(b => b.Text == "Gameplay").TriggerClick());
|
AddStep("Click gameplay scene button", () => skinEditor.ChildrenOfType<SkinEditorSceneLibrary.SceneButton>().First(b => b.Text == "Gameplay").TriggerClick());
|
||||||
|
Loading…
Reference in New Issue
Block a user