mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add test for clear button
This commit is contained in:
@ -64,5 +64,45 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
}, 0, true);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestClearButtonOnBindings()
|
||||
{
|
||||
KeyBindingRow backBindingRow = null;
|
||||
|
||||
AddStep("click back binding row", () =>
|
||||
{
|
||||
backBindingRow = panel.ChildrenOfType<KeyBindingRow>().ElementAt(10);
|
||||
InputManager.MoveMouseTo(backBindingRow);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
clickClearButton();
|
||||
|
||||
AddAssert("first binding cleared", () => string.IsNullOrEmpty(backBindingRow.Buttons.First().Text.Text));
|
||||
|
||||
AddStep("click second binding", () =>
|
||||
{
|
||||
var target = backBindingRow.Buttons.ElementAt(1);
|
||||
|
||||
InputManager.MoveMouseTo(target);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
clickClearButton();
|
||||
|
||||
AddAssert("second binding cleared", () => string.IsNullOrEmpty(backBindingRow.Buttons.ElementAt(1).Text.Text));
|
||||
|
||||
void clickClearButton()
|
||||
{
|
||||
AddStep("click clear button", () =>
|
||||
{
|
||||
var clearButton = backBindingRow.ChildrenOfType<KeyBindingRow.ClearButton>().Single();
|
||||
|
||||
InputManager.MoveMouseTo(clearButton);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user