Merge pull request #17300 from smoogipoo/testscene-button-click-improvement

Improve OsuManualInputManagerTestScene button clicking helper function
This commit is contained in:
Dean Herbert 2022-03-17 19:40:08 +09:00 committed by GitHub
commit 4d495cf969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,9 +127,9 @@ namespace osu.Game.Tests.Visual
where T : Drawable
{
if (typeof(T) == typeof(Button))
AddUntilStep($"wait for {typeof(T).Name} enabled", () => (this.ChildrenOfType<T>().Single() as Button)?.Enabled.Value == true);
AddUntilStep($"wait for {typeof(T).Name} enabled", () => (this.ChildrenOfType<T>().Single() as ClickableContainer)?.Enabled.Value == true);
else
AddUntilStep($"wait for {typeof(T).Name} enabled", () => this.ChildrenOfType<T>().Single().ChildrenOfType<Button>().Single().Enabled.Value);
AddUntilStep($"wait for {typeof(T).Name} enabled", () => this.ChildrenOfType<T>().Single().ChildrenOfType<ClickableContainer>().Single().Enabled.Value);
AddStep($"click {typeof(T).Name}", () =>
{