-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix swells not being correctly treated in editor gameplay test #28995
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e2fe193
Add failing test case
bdach 157cc88
Fix swells not being correctly treated in editor gameplay test
bdach 636e965
Remove no-longer-valid test remark & adjust test
bdach f86ab1a
Fix filename
bdach a696e3c
Add reference to android project
smoogipoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
osu.Game.Rulesets.Taiko.Tests/Editor/TestSceneTaikoEditorTestGameplay.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Linq; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Extensions; | ||
using osu.Framework.Testing; | ||
using osu.Game.Beatmaps; | ||
using osu.Game.Rulesets.Taiko.Objects; | ||
using osu.Game.Screens.Edit; | ||
using osu.Game.Screens.Edit.Components.Timelines.Summary; | ||
using osu.Game.Screens.Edit.GameplayTest; | ||
using osu.Game.Storyboards; | ||
using osu.Game.Tests.Beatmaps.IO; | ||
using osu.Game.Tests.Visual; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Rulesets.Taiko.Tests.Editor | ||
{ | ||
public partial class TestSceneTaikoEditorTestGameplay : EditorTestScene | ||
{ | ||
protected override bool IsolateSavingFromDatabase => false; | ||
|
||
protected override Ruleset CreateEditorRuleset() => new TaikoRuleset(); | ||
|
||
[Resolved] | ||
private OsuGameBase game { get; set; } = null!; | ||
|
||
[Resolved] | ||
private BeatmapManager beatmaps { get; set; } = null!; | ||
|
||
private BeatmapSetInfo importedBeatmapSet = null!; | ||
|
||
public override void SetUpSteps() | ||
{ | ||
AddStep("import test beatmap", () => importedBeatmapSet = BeatmapImportHelper.LoadOszIntoOsu(game).GetResultSafely()); | ||
base.SetUpSteps(); | ||
} | ||
|
||
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard? storyboard = null) | ||
=> beatmaps.GetWorkingBeatmap(importedBeatmapSet.Beatmaps.First(b => b.Ruleset.OnlineID == 1)); | ||
|
||
[Test] | ||
public void TestBasicGameplayTest() | ||
{ | ||
AddStep("add objects", () => | ||
{ | ||
EditorBeatmap.Clear(); | ||
EditorBeatmap.Add(new Swell { StartTime = 500, EndTime = 1500 }); | ||
EditorBeatmap.Add(new Hit { StartTime = 3000 }); | ||
}); | ||
AddStep("seek to 250", () => EditorClock.Seek(250)); | ||
AddUntilStep("wait for seek", () => EditorClock.CurrentTime, () => Is.EqualTo(250)); | ||
|
||
AddStep("click test gameplay button", () => | ||
{ | ||
var button = Editor.ChildrenOfType<TestGameplayButton>().Single(); | ||
|
||
InputManager.MoveMouseTo(button); | ||
InputManager.Click(MouseButton.Left); | ||
}); | ||
AddUntilStep("save prompt shown", () => DialogOverlay.CurrentDialog is SaveRequiredPopupDialog); | ||
|
||
AddStep("save changes", () => DialogOverlay.CurrentDialog!.PerformOkAction()); | ||
AddUntilStep("player pushed", () => Stack.CurrentScreen is EditorPlayer); | ||
AddUntilStep("wait for return to editor", () => Stack.CurrentScreen is Screens.Edit.Editor); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional - the added reference allows using
BeatmapImportHelper.LoadOszIntoOsu()
in the test, which resides inosu.Game.Tests
.Yes I considered moving that class to
osu.Game
, but then I also have to move its dependencyTestResources
, and then I probably need to move all of the resources that references to the main game project, so not doing that.Yes I considered not relying on an import in the test, and tried making it work with an empty beatmap, and it doesn't work for unknown reasons that I don't want to waste an hour debugging. A non-empty beatmap that hasn't been imported via standard import flows dies on a realm assertion.
So if this is deemed unacceptable then I'll likely just force-push e2fe193 entirely out of this diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this FWIW