mirror of
https://github.com/ppy/osu
synced 2024-12-23 15:22:37 +00:00
Fix tests on CI
This commit is contained in:
parent
e66f9adb86
commit
8df2e359c4
@ -456,9 +456,9 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task<BeatmapSetInfo> LoadOszIntoOsu(OsuGameBase osu, string path = null)
|
||||
public static async Task<BeatmapSetInfo> LoadOszIntoOsu(OsuGameBase osu, string path = null, bool virtualTrack = false)
|
||||
{
|
||||
var temp = path ?? TestResources.GetTestBeatmapForImport();
|
||||
var temp = path ?? TestResources.GetTestBeatmapForImport(virtualTrack);
|
||||
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
|
@ -11,13 +11,13 @@ namespace osu.Game.Tests.Resources
|
||||
{
|
||||
public static Stream OpenResource(string name) => new DllResourceStore("osu.Game.Tests.dll").GetStream($"Resources/{name}");
|
||||
|
||||
public static Stream GetTestBeatmapStream() => new DllResourceStore("osu.Game.Resources.dll").GetStream("Beatmaps/241526 Soleily - Renatus.osz");
|
||||
public static Stream GetTestBeatmapStream(bool virtualTrack = false) => new DllResourceStore("osu.Game.Resources.dll").GetStream($"Beatmaps/241526 Soleily - Renatus{(virtualTrack ? "_virtual" : "")}.osz");
|
||||
|
||||
public static string GetTestBeatmapForImport()
|
||||
public static string GetTestBeatmapForImport(bool virtualTrack = false)
|
||||
{
|
||||
var temp = Path.GetTempFileName() + ".osz";
|
||||
|
||||
using (var stream = GetTestBeatmapStream())
|
||||
using (var stream = GetTestBeatmapStream(virtualTrack))
|
||||
using (var newFile = File.Create(temp))
|
||||
stream.CopyTo(newFile);
|
||||
|
||||
|
@ -102,9 +102,9 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
|
||||
pushAndConfirm(() => new TestSongSelect());
|
||||
|
||||
AddStep("import beatmap", () => ImportBeatmapTest.LoadOszIntoOsu(game).Wait());
|
||||
AddStep("import beatmap", () => ImportBeatmapTest.LoadOszIntoOsu(game, virtualTrack: true).Wait());
|
||||
|
||||
AddUntilStep("wait for selected", () => !(track() is TrackVirtual));
|
||||
AddUntilStep("wait for selected", () => !game.Beatmap.IsDefault);
|
||||
|
||||
AddStep("press enter", () => pressAndRelease(Key.Enter));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user