-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23331 from letsgoawaydev/ui-login-spacing-fix
Update login overlay appearance to match new designs
- Loading branch information
Showing
7 changed files
with
221 additions
and
250 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// 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; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Testing; | ||
using osu.Game.Graphics.UserInterface; | ||
using osu.Game.Online.API; | ||
using osu.Game.Overlays; | ||
using osu.Game.Users.Drawables; | ||
using osuTK.Input; | ||
|
||
namespace osu.Game.Tests.Visual.Menus | ||
{ | ||
[TestFixture] | ||
public partial class TestSceneLoginOverlay : OsuManualInputManagerTestScene | ||
{ | ||
private LoginOverlay loginOverlay = null!; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
Child = loginOverlay = new LoginOverlay | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
}; | ||
} | ||
|
||
[SetUpSteps] | ||
public void SetUpSteps() | ||
{ | ||
AddStep("show login overlay", () => loginOverlay.Show()); | ||
} | ||
|
||
[Test] | ||
public void TestLoginSuccess() | ||
{ | ||
AddStep("logout", () => API.Logout()); | ||
|
||
AddStep("enter password", () => loginOverlay.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password"); | ||
AddStep("submit", () => loginOverlay.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick()); | ||
} | ||
|
||
[Test] | ||
public void TestLoginFailure() | ||
{ | ||
AddStep("logout", () => | ||
{ | ||
API.Logout(); | ||
((DummyAPIAccess)API).FailNextLogin(); | ||
}); | ||
|
||
AddStep("enter password", () => loginOverlay.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password"); | ||
AddStep("submit", () => loginOverlay.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick()); | ||
} | ||
|
||
[Test] | ||
public void TestLoginConnecting() | ||
{ | ||
AddStep("logout", () => | ||
{ | ||
API.Logout(); | ||
((DummyAPIAccess)API).PauseOnConnectingNextLogin(); | ||
}); | ||
|
||
AddStep("enter password", () => loginOverlay.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password"); | ||
AddStep("submit", () => loginOverlay.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick()); | ||
} | ||
|
||
[Test] | ||
public void TestClickingOnFlagClosesOverlay() | ||
{ | ||
AddStep("logout", () => API.Logout()); | ||
AddStep("enter password", () => loginOverlay.ChildrenOfType<OsuPasswordTextBox>().First().Text = "password"); | ||
AddStep("submit", () => loginOverlay.ChildrenOfType<OsuButton>().First(b => b.Text.ToString() == "Sign in").TriggerClick()); | ||
|
||
AddStep("click on flag", () => | ||
{ | ||
InputManager.MoveMouseTo(loginOverlay.ChildrenOfType<UpdateableFlag>().First()); | ||
InputManager.Click(MouseButton.Left); | ||
}); | ||
AddAssert("login overlay is hidden", () => loginOverlay.State.Value == Visibility.Hidden); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.