1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:32:55 +08:00

Ensure tests wait for screen load

This commit is contained in:
Bartłomiej Dach 2021-08-12 19:48:57 +02:00
parent 828268ad4d
commit d08d22e3e9
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -18,6 +18,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test] [Test]
public void TestDisplayWithTeams() public void TestDisplayWithTeams()
{ {
MultiplayerResultsScreen screen = null;
AddStep("show results screen", () => AddStep("show results screen", () =>
{ {
var rulesetInfo = new OsuRuleset().RulesetInfo; var rulesetInfo = new OsuRuleset().RulesetInfo;
@ -48,13 +50,17 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ 1, new BindableInt(1048576) } { 1, new BindableInt(1048576) }
}; };
Stack.Push(new MultiplayerResultsScreen(score, 1, playlistItem, teamScores)); Stack.Push(screen = new MultiplayerResultsScreen(score, 1, playlistItem, teamScores));
}); });
AddUntilStep("wait for loaded", () => screen.IsLoaded);
} }
[Test] [Test]
public void TestDisplayWithoutTeams() public void TestDisplayWithoutTeams()
{ {
MultiplayerResultsScreen screen = null;
AddStep("show results screen", () => AddStep("show results screen", () =>
{ {
var rulesetInfo = new OsuRuleset().RulesetInfo; var rulesetInfo = new OsuRuleset().RulesetInfo;
@ -81,8 +87,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
SortedDictionary<int, BindableInt> teamScores = new SortedDictionary<int, BindableInt>(); SortedDictionary<int, BindableInt> teamScores = new SortedDictionary<int, BindableInt>();
Stack.Push(new MultiplayerResultsScreen(score, 1, playlistItem, teamScores)); Stack.Push(screen = new MultiplayerResultsScreen(score, 1, playlistItem, teamScores));
}); });
AddUntilStep("wait for loaded", () => screen.IsLoaded);
} }
} }
} }