mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add failing test
This commit is contained in:
@ -871,6 +871,52 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddUntilStep("queue is empty", () => this.ChildrenOfType<MultiplayerQueueList>().Single().Items.Count == 0);
|
AddUntilStep("queue is empty", () => this.ChildrenOfType<MultiplayerQueueList>().Single().Items.Count == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestGameplayStartsWhileInSpectatorScreen()
|
||||||
|
{
|
||||||
|
createRoom(() => new Room
|
||||||
|
{
|
||||||
|
Name = { Value = "Test Room" },
|
||||||
|
Playlist =
|
||||||
|
{
|
||||||
|
new PlaylistItem
|
||||||
|
{
|
||||||
|
Beatmap = { Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.Ruleset.OnlineID == 0)).BeatmapInfo },
|
||||||
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("join other user and make host", () =>
|
||||||
|
{
|
||||||
|
client.AddUser(new APIUser { Id = 1234 });
|
||||||
|
client.TransferHost(1234);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("set local user spectating", () => client.ChangeUserState(API.LocalUser.Value.OnlineID, MultiplayerUserState.Spectating));
|
||||||
|
AddUntilStep("wait for spectating state", () => client.LocalUser?.State == MultiplayerUserState.Spectating);
|
||||||
|
|
||||||
|
runGameplay();
|
||||||
|
|
||||||
|
AddStep("exit gameplay for other user", () => client.ChangeUserState(1234, MultiplayerUserState.Idle));
|
||||||
|
AddUntilStep("wait for room to be idle", () => client.Room?.State == MultiplayerRoomState.Open);
|
||||||
|
|
||||||
|
runGameplay();
|
||||||
|
|
||||||
|
void runGameplay()
|
||||||
|
{
|
||||||
|
AddStep("start match by other user", () =>
|
||||||
|
{
|
||||||
|
client.ChangeUserState(1234, MultiplayerUserState.Ready);
|
||||||
|
client.StartMatch();
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for loading", () => client.Room?.State == MultiplayerRoomState.WaitingForLoad);
|
||||||
|
AddStep("set player loaded", () => client.ChangeUserState(1234, MultiplayerUserState.Loaded));
|
||||||
|
AddUntilStep("wait for gameplay to start", () => client.Room?.State == MultiplayerRoomState.Playing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void enterGameplay()
|
private void enterGameplay()
|
||||||
{
|
{
|
||||||
pressReadyButton();
|
pressReadyButton();
|
||||||
|
Reference in New Issue
Block a user