mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 22:07:25 +08:00
Wait for track reset in tests
Add a wait step in tests for the "now playing" overlay to make sure the current track was restarted before trying to call PreviousTrack() again.
This commit is contained in:
parent
70feab8316
commit
963215ccbe
@ -4,6 +4,7 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
@ -55,6 +56,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep(@"Seek track to 6 second", () => musicController.SeekTo(6000));
|
AddStep(@"Seek track to 6 second", () => musicController.SeekTo(6000));
|
||||||
AddUntilStep(@"Wait for current time to update", () => currentBeatmap.Track.CurrentTime > 5000);
|
AddUntilStep(@"Wait for current time to update", () => currentBeatmap.Track.CurrentTime > 5000);
|
||||||
AddAssert(@"Check action is restart track", () => musicController.PreviousTrack() == PreviousTrackResult.Restart);
|
AddAssert(@"Check action is restart track", () => musicController.PreviousTrack() == PreviousTrackResult.Restart);
|
||||||
|
AddUntilStep("Wait for current time to update", () => Precision.AlmostEquals(currentBeatmap.Track.CurrentTime, 0));
|
||||||
AddAssert(@"Check track didn't change", () => currentBeatmap == Beatmap.Value);
|
AddAssert(@"Check track didn't change", () => currentBeatmap == Beatmap.Value);
|
||||||
AddAssert(@"Check action is not restart", () => musicController.PreviousTrack() != PreviousTrackResult.Restart);
|
AddAssert(@"Check action is not restart", () => musicController.PreviousTrack() != PreviousTrackResult.Restart);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user