diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneDrawableStoryboardSprite.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneDrawableStoryboardSprite.cs index 494365a205..afbd9da73c 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneDrawableStoryboardSprite.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneDrawableStoryboardSprite.cs @@ -14,6 +14,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.IO.Stores; using osu.Framework.Testing; +using osu.Framework.Timing; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu; @@ -53,12 +54,20 @@ namespace osu.Game.Tests.Visual.Gameplay [Test] public void TestSpriteFadeOverflowBehaviour() { + ManualClock manualClock = new ManualClock(); + + AddStep("allow storyboard lookup", () => + { + storyboard.UseSkinSprites = false; + storyboard.ProvideResources = true; + }); + AddStep("create sprite", () => SetContents(_ => { var layer = storyboard.GetLayer("Background"); var sprite = new StoryboardSprite(lookup_name, Anchor.TopLeft, new Vector2(256, 192)); - sprite.Commands.AddAlpha(Easing.None, Time.Current, Time.Current + 2000, 0, 2); + sprite.Commands.AddAlpha(Easing.None, 0, 2000, 0, 2); layer.Elements.Clear(); layer.Add(sprite); @@ -68,13 +77,16 @@ namespace osu.Game.Tests.Visual.Gameplay RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - storyboard.CreateDrawable() + storyboard.CreateDrawable().With(d => d.Clock = new FramedClock(manualClock)) } }; })); + AddStep("seek to 1000 ms", () => manualClock.CurrentTime = 900); AddUntilStep("sprite reached high opacity once", () => sprites.All(sprite => sprite.ChildrenOfType().All(s => s.Alpha > 0.8f))); + AddStep("seek to 2000 ms", () => manualClock.CurrentTime = 1100); AddUntilStep("sprite reset to low opacity", () => sprites.All(sprite => sprite.ChildrenOfType().All(s => s.Alpha < 0.2f))); + AddStep("seek to 2000 ms", () => manualClock.CurrentTime = 1900); AddUntilStep("sprite reached high opacity twice", () => sprites.All(sprite => sprite.ChildrenOfType().All(s => s.Alpha > 0.8f))); } diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs index 2984613807..461061c568 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSongSelectNavigation.cs @@ -82,6 +82,8 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("wait for selected", () => !Game.Beatmap.IsDefault); AddStep("open menu", () => InputManager.Key(Key.F3)); + AddUntilStep("wait for footer focus", () => InputManager.FocusedDrawable is FooterButtonOptions.Popover); + AddStep("trigger edit", () => { // TODO: should be 5, not 4. diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapTitleWedge.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapTitleWedge.cs index 0d14de8b9e..2421cf7bc3 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapTitleWedge.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapTitleWedge.cs @@ -240,11 +240,11 @@ namespace osu.Game.Tests.Visual.SongSelect }); AddStep("reset event", resetEvent.Reset); AddStep("click favourite button", () => this.ChildrenOfType().Single().TriggerClick()); - AddAssert("spinner visible", () => this.ChildrenOfType().Single() - .ChildrenOfType().Single().State.Value, () => Is.EqualTo(Visibility.Visible)); + AddUntilStep("spinner visible", () => this.ChildrenOfType().Single() + .ChildrenOfType().Single().State.Value, () => Is.EqualTo(Visibility.Visible)); AddStep("allow request to complete", resetEvent.Set); - AddAssert("spinner hidden", () => this.ChildrenOfType().Single() - .ChildrenOfType().Single().State.Value, () => Is.EqualTo(Visibility.Hidden)); + AddUntilStep("spinner hidden", () => this.ChildrenOfType().Single() + .ChildrenOfType().Single().State.Value, () => Is.EqualTo(Visibility.Hidden)); } [TestCase(120, 125, null, "120-125 (mostly 120)")]