Merge pull request #9420 from peppy/fix-welcome-test-fail

Fix "welcome" intro test failure due to no wait logic
This commit is contained in:
Dan Balasescu 2020-07-02 12:36:24 +09:00 committed by GitHub
commit 4bf45ea99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Audio.Track;
using osu.Framework.Screens;
using osu.Game.Screens.Menu;
@ -14,15 +15,11 @@ public class TestSceneIntroWelcome : IntroTestScene
public TestSceneIntroWelcome()
{
AddAssert("check if menu music loops", () =>
{
var menu = IntroStack?.CurrentScreen as MainMenu;
AddUntilStep("wait for load", () => getTrack() != null);
if (menu == null)
return false;
return menu.Track.Looping;
});
AddAssert("check if menu music loops", () => getTrack().Looping);
}
private Track getTrack() => (IntroStack?.CurrentScreen as MainMenu)?.Track;
}
}