Merge remote-tracking branch 'upstream/master' into fix-op-non-current-onexiting

This commit is contained in:
Joseph Madamba
2022-12-24 14:01:11 -08:00
3098 changed files with 41866 additions and 31216 deletions

View File

@ -19,6 +19,7 @@ using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Leaderboards;
using osu.Game.Overlays;
using osu.Game.Overlays.BeatmapListing;
using osu.Game.Overlays.Mods;
using osu.Game.Overlays.Toolbar;
using osu.Game.Rulesets.Mods;
@ -39,7 +40,7 @@ using osuTK.Input;
namespace osu.Game.Tests.Visual.Navigation
{
public class TestSceneScreenNavigation : OsuGameTestScene
public partial class TestSceneScreenNavigation : OsuGameTestScene
{
private const float click_padding = 25;
@ -455,6 +456,8 @@ namespace osu.Game.Tests.Visual.Navigation
{
AddUntilStep("Wait for toolbar to load", () => Game.Toolbar.IsLoaded);
AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).WaitSafely());
TestPlaySongSelect songSelect = null;
PushAndConfirm(() => songSelect = new TestPlaySongSelect());
@ -532,6 +535,62 @@ namespace osu.Game.Tests.Visual.Navigation
AddWaitStep("wait two frames", 2);
}
[Test]
public void TestFeaturedArtistDisclaimerDialog()
{
BeatmapListingOverlay getBeatmapListingOverlay() => Game.ChildrenOfType<BeatmapListingOverlay>().FirstOrDefault();
AddStep("Wait for notifications to load", () => Game.SearchBeatmapSet(string.Empty));
AddUntilStep("wait for dialog overlay", () => Game.ChildrenOfType<DialogOverlay>().SingleOrDefault() != null);
AddUntilStep("Wait for beatmap overlay to load", () => getBeatmapListingOverlay()?.State.Value == Visibility.Visible);
AddAssert("featured artist filter is on", () => getBeatmapListingOverlay().ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
AddStep("toggle featured artist filter",
() => getBeatmapListingOverlay().ChildrenOfType<FilterTabItem<SearchGeneral>>().First(i => i.Value == SearchGeneral.FeaturedArtists).TriggerClick());
AddAssert("disclaimer dialog is shown", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog != null);
AddAssert("featured artist filter is still on", () => getBeatmapListingOverlay().ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
AddStep("confirm", () => InputManager.Key(Key.Enter));
AddAssert("dialog dismissed", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog == null);
AddUntilStep("featured artist filter is off", () => !getBeatmapListingOverlay().ChildrenOfType<BeatmapSearchGeneralFilterRow>().First().Current.Contains(SearchGeneral.FeaturedArtists));
}
[Test]
public void TestMainOverlaysClosesNotificationOverlay()
{
ChangelogOverlay getChangelogOverlay() => Game.ChildrenOfType<ChangelogOverlay>().FirstOrDefault();
AddUntilStep("Wait for notifications to load", () => Game.Notifications.IsLoaded);
AddStep("Show notifications", () => Game.Notifications.Show());
AddUntilStep("wait for notifications shown", () => Game.Notifications.IsPresent && Game.Notifications.State.Value == Visibility.Visible);
AddStep("Show changelog listing", () => Game.ShowChangelogListing());
AddUntilStep("wait for changelog shown", () => getChangelogOverlay()?.IsPresent == true && getChangelogOverlay()?.State.Value == Visibility.Visible);
AddAssert("Notifications is hidden", () => Game.Notifications.State.Value == Visibility.Hidden);
AddStep("Show notifications", () => Game.Notifications.Show());
AddUntilStep("wait for notifications shown", () => Game.Notifications.State.Value == Visibility.Visible);
AddUntilStep("changelog still visible", () => getChangelogOverlay().State.Value == Visibility.Visible);
}
[Test]
public void TestMainOverlaysClosesSettingsOverlay()
{
ChangelogOverlay getChangelogOverlay() => Game.ChildrenOfType<ChangelogOverlay>().FirstOrDefault();
AddUntilStep("Wait for settings to load", () => Game.Settings.IsLoaded);
AddStep("Show settings", () => Game.Settings.Show());
AddUntilStep("wait for settings shown", () => Game.Settings.IsPresent && Game.Settings.State.Value == Visibility.Visible);
AddStep("Show changelog listing", () => Game.ShowChangelogListing());
AddUntilStep("wait for changelog shown", () => getChangelogOverlay()?.IsPresent == true && getChangelogOverlay()?.State.Value == Visibility.Visible);
AddAssert("Settings is hidden", () => Game.Settings.State.Value == Visibility.Hidden);
AddStep("Show settings", () => Game.Settings.Show());
AddUntilStep("wait for settings shown", () => Game.Settings.State.Value == Visibility.Visible);
AddUntilStep("changelog still visible", () => getChangelogOverlay().State.Value == Visibility.Visible);
}
[Test]
public void TestOverlayClosing()
{
@ -677,7 +736,7 @@ namespace osu.Game.Tests.Visual.Navigation
ConfirmAtMainMenu();
}
public class TestPlaySongSelect : PlaySongSelect
public partial class TestPlaySongSelect : PlaySongSelect
{
public ModSelectOverlay ModSelectOverlay => ModSelect;