mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Add test coverage of full account creation flow
This commit is contained in:
parent
a00cf87925
commit
091618db1a
@ -10,6 +10,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
@ -67,5 +68,34 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
});
|
});
|
||||||
AddUntilStep("overlay is hidden", () => accountCreation.State.Value == Visibility.Hidden);
|
AddUntilStep("overlay is hidden", () => accountCreation.State.Value == Visibility.Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestFullFlow()
|
||||||
|
{
|
||||||
|
AddStep("log out", () => API.Logout());
|
||||||
|
|
||||||
|
AddStep("show manually", () => accountCreation.Show());
|
||||||
|
AddUntilStep("overlay is visible", () => accountCreation.State.Value == Visibility.Visible);
|
||||||
|
|
||||||
|
AddStep("click button", () => accountCreation.ChildrenOfType<SettingsButton>().Single().TriggerClick());
|
||||||
|
AddUntilStep("warning screen is present", () => accountCreation.ChildrenOfType<ScreenWarning>().SingleOrDefault()?.IsPresent == true);
|
||||||
|
|
||||||
|
AddStep("proceed", () => accountCreation.ChildrenOfType<DangerousSettingsButton>().Single().TriggerClick());
|
||||||
|
AddUntilStep("entry screen is present", () => accountCreation.ChildrenOfType<ScreenEntry>().SingleOrDefault()?.IsPresent == true);
|
||||||
|
|
||||||
|
AddStep("input details", () =>
|
||||||
|
{
|
||||||
|
var entryScreen = accountCreation.ChildrenOfType<ScreenEntry>().Single();
|
||||||
|
entryScreen.ChildrenOfType<OsuTextBox>().ElementAt(0).Text = "new_user";
|
||||||
|
entryScreen.ChildrenOfType<OsuTextBox>().ElementAt(1).Text = "new.user@fake.mail";
|
||||||
|
entryScreen.ChildrenOfType<OsuTextBox>().ElementAt(2).Text = "password";
|
||||||
|
});
|
||||||
|
AddStep("click button", () => accountCreation.ChildrenOfType<ScreenEntry>().Single()
|
||||||
|
.ChildrenOfType<SettingsButton>().Single().TriggerClick());
|
||||||
|
AddUntilStep("verification screen is present", () => accountCreation.ChildrenOfType<ScreenEmailVerification>().SingleOrDefault()?.IsPresent == true);
|
||||||
|
|
||||||
|
AddStep("verify", () => ((DummyAPIAccess)API).AuthenticateSecondFactor("abcdefgh"));
|
||||||
|
AddUntilStep("overlay is hidden", () => accountCreation.State.Value == Visibility.Hidden);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user