Fix multiplayer gameplay flow test scene failures due to button not being ready

This commit is contained in:
Dean Herbert 2021-10-14 15:58:42 +09:00
parent 464bcd2b24
commit 119e9ad83e

View File

@ -564,11 +564,17 @@ namespace osu.Game.Tests.Visual.Multiplayer
}
});
AddRepeatStep("click spectate button", () =>
AddUntilStep("wait for ready button clickable", () => readyButton.ChildrenOfType<OsuButton>().Single().Enabled.Value);
AddStep("click ready button", () =>
{
InputManager.MoveMouseTo(this.ChildrenOfType<MultiplayerReadyButton>().Single());
InputManager.MoveMouseTo(readyButton);
InputManager.Click(MouseButton.Left);
}, 2);
});
AddUntilStep("wait for start match available", () => readyButton.ChildrenOfType<OsuButton>().Single().Text.ToString().Contains("Start match"));
AddStep("click start button", () => InputManager.Click(MouseButton.Left));
AddUntilStep("wait for player", () => Stack.CurrentScreen is Player);
@ -582,6 +588,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddUntilStep("wait for results", () => Stack.CurrentScreen is ResultsScreen);
}
private MultiplayerReadyButton readyButton => this.ChildrenOfType<MultiplayerReadyButton>().Single();
private void createRoom(Func<Room> room)
{
AddUntilStep("wait for lounge", () => multiplayerScreen.ChildrenOfType<LoungeSubScreen>().SingleOrDefault()?.IsLoaded == true);