2023-12-27 22:07:17 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using NUnit.Framework;
|
2023-12-29 10:50:30 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2023-12-27 22:07:17 +00:00
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
|
|
|
using osu.Game.Screens.Menu;
|
2023-12-29 10:50:30 +00:00
|
|
|
using osuTK.Input;
|
2023-12-27 22:07:17 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Menus
|
|
|
|
{
|
|
|
|
public partial class TestSceneMainMenu : OsuGameTestScene
|
|
|
|
{
|
2024-03-23 08:41:40 +00:00
|
|
|
private OnlineMenuBanner onlineMenuBanner => Game.ChildrenOfType<OnlineMenuBanner>().Single();
|
2023-12-29 10:50:30 +00:00
|
|
|
|
2023-12-27 22:07:17 +00:00
|
|
|
[Test]
|
2024-03-23 08:41:40 +00:00
|
|
|
public void TestOnlineMenuBanner()
|
2023-12-27 22:07:17 +00:00
|
|
|
{
|
2024-03-23 08:41:40 +00:00
|
|
|
AddStep("set online content", () => onlineMenuBanner.Current.Value = new APIMenuContent
|
2023-12-27 22:07:17 +00:00
|
|
|
{
|
2024-03-23 08:41:40 +00:00
|
|
|
Images = new[]
|
|
|
|
{
|
|
|
|
new APIMenuImage
|
|
|
|
{
|
|
|
|
Image = @"https://assets.ppy.sh/main-menu/project-loved-2@2x.png",
|
|
|
|
Url = @"https://osu.ppy.sh/home/news/2023-12-21-project-loved-december-2023",
|
|
|
|
}
|
|
|
|
}
|
2023-12-27 22:07:17 +00:00
|
|
|
});
|
2024-03-23 08:41:40 +00:00
|
|
|
AddAssert("system title not visible", () => onlineMenuBanner.State.Value, () => Is.EqualTo(Visibility.Hidden));
|
2023-12-29 10:50:30 +00:00
|
|
|
AddStep("enter menu", () => InputManager.Key(Key.Enter));
|
2024-03-23 08:41:40 +00:00
|
|
|
AddUntilStep("system title visible", () => onlineMenuBanner.State.Value, () => Is.EqualTo(Visibility.Visible));
|
2023-12-27 22:07:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|