mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Allow testing settings panel with interactivity by default
This commit is contained in:
@ -35,13 +35,19 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
State = { Value = Visibility.Visible }
|
State = { Value = Visibility.Visible }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
[Test]
|
||||||
|
public void TestBasic()
|
||||||
|
{
|
||||||
|
AddStep("do nothing", () => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFiltering([Values] bool beforeLoad)
|
public void TestFiltering([Values] bool beforeLoad)
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
if (beforeLoad)
|
if (beforeLoad)
|
||||||
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
||||||
|
|
||||||
@ -67,6 +73,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestFilterAfterLoad()
|
public void TestFilterAfterLoad()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
|
AddUntilStep("wait for items to load", () => settings.SectionsContainer.ChildrenOfType<IFilterable>().Any());
|
||||||
|
|
||||||
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
AddStep("set filter", () => settings.SectionsContainer.ChildrenOfType<SearchTextBox>().First().Current.Value = "scaling");
|
||||||
@ -75,6 +83,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void ToggleVisibility()
|
public void ToggleVisibility()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddWaitStep("wait some", 5);
|
AddWaitStep("wait some", 5);
|
||||||
AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
|
AddToggleStep("toggle visibility", _ => settings.ToggleVisibility());
|
||||||
}
|
}
|
||||||
@ -82,6 +92,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestTextboxFocusAfterNestedPanelBackButton()
|
public void TestTextboxFocusAfterNestedPanelBackButton()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
||||||
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
||||||
|
|
||||||
@ -107,6 +119,8 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestTextboxFocusAfterNestedPanelEscape()
|
public void TestTextboxFocusAfterNestedPanelEscape()
|
||||||
{
|
{
|
||||||
|
AddStep("reset mouse", () => InputManager.MoveMouseTo(settings));
|
||||||
|
|
||||||
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
AddUntilStep("sections loaded", () => settings.SectionsContainer.Children.Count > 0);
|
||||||
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
AddUntilStep("top-level textbox focused", () => settings.SectionsContainer.ChildrenOfType<FocusedTextBox>().FirstOrDefault()?.HasFocus == true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user