From 119e9ad83e8faa76ef3bb38bb4a16577502c290f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 14 Oct 2021 15:58:42 +0900 Subject: [PATCH 1/2] Fix multiplayer gameplay flow test scene failures due to button not being ready --- .../Visual/Multiplayer/TestSceneMultiplayer.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs index 0b70703870..d40f808f06 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs @@ -564,11 +564,17 @@ namespace osu.Game.Tests.Visual.Multiplayer } }); - AddRepeatStep("click spectate button", () => + AddUntilStep("wait for ready button clickable", () => readyButton.ChildrenOfType().Single().Enabled.Value); + + AddStep("click ready button", () => { - InputManager.MoveMouseTo(this.ChildrenOfType().Single()); + InputManager.MoveMouseTo(readyButton); InputManager.Click(MouseButton.Left); - }, 2); + }); + + AddUntilStep("wait for start match available", () => readyButton.ChildrenOfType().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().Single(); + private void createRoom(Func room) { AddUntilStep("wait for lounge", () => multiplayerScreen.ChildrenOfType().SingleOrDefault()?.IsLoaded == true); From 0fd5fa17c0f67430a90fede2d93dcc0d9ac3f37e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 14 Oct 2021 16:50:38 +0900 Subject: [PATCH 2/2] Add more thorough check --- osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs index d40f808f06..2bb77395ef 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs @@ -564,7 +564,7 @@ namespace osu.Game.Tests.Visual.Multiplayer } }); - AddUntilStep("wait for ready button clickable", () => readyButton.ChildrenOfType().Single().Enabled.Value); + AddUntilStep("wait for ready button to be enabled", () => readyButton.ChildrenOfType().Single().Enabled.Value); AddStep("click ready button", () => { @@ -572,7 +572,8 @@ namespace osu.Game.Tests.Visual.Multiplayer InputManager.Click(MouseButton.Left); }); - AddUntilStep("wait for start match available", () => readyButton.ChildrenOfType().Single().Text.ToString().Contains("Start match")); + AddUntilStep("wait for player to be ready", () => client.Room?.Users[0].State == MultiplayerUserState.Ready); + AddUntilStep("wait for ready button to be enabled", () => readyButton.ChildrenOfType().Single().Enabled.Value); AddStep("click start button", () => InputManager.Click(MouseButton.Left));