mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Add visual and failing test cases
This commit is contained in:
parent
2778e43713
commit
2ccd0e3692
@ -26,8 +26,10 @@ using osu.Game.Scoring;
|
|||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
|
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||||
using osu.Game.Screens.Ranking.Expanded.Statistics;
|
using osu.Game.Screens.Ranking.Expanded.Statistics;
|
||||||
using osu.Game.Screens.Ranking.Statistics;
|
using osu.Game.Screens.Ranking.Statistics;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Tests.Resources;
|
using osu.Game.Tests.Resources;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -44,6 +46,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private RealmAccess realm { get; set; }
|
private RealmAccess realm { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private SkinManager skins { get; set; }
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
@ -59,6 +64,9 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp() => Schedule(() => skins.CurrentSkinInfo.SetDefault());
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestScaling()
|
public void TestScaling()
|
||||||
{
|
{
|
||||||
@ -132,6 +140,46 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestResultsWithFailingRank()
|
||||||
|
{
|
||||||
|
TestResultsScreen screen = null;
|
||||||
|
|
||||||
|
loadResultsScreen(() =>
|
||||||
|
{
|
||||||
|
var score = TestResources.CreateTestScoreInfo();
|
||||||
|
|
||||||
|
score.OnlineID = onlineScoreID++;
|
||||||
|
score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents();
|
||||||
|
score.Rank = ScoreRank.F;
|
||||||
|
return screen = createResultsScreen(score);
|
||||||
|
});
|
||||||
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
||||||
|
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
||||||
|
AddAssert("no badges displayed", () => this.ChildrenOfType<RankBadge>().All(b => !b.IsPresent));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestResultsWithFailingRankOnLegacySkin()
|
||||||
|
{
|
||||||
|
TestResultsScreen screen = null;
|
||||||
|
|
||||||
|
AddStep("set legacy skin", () => skins.CurrentSkinInfo.Value = skins.DefaultClassicSkin.SkinInfo);
|
||||||
|
|
||||||
|
loadResultsScreen(() =>
|
||||||
|
{
|
||||||
|
var score = TestResources.CreateTestScoreInfo();
|
||||||
|
|
||||||
|
score.OnlineID = onlineScoreID++;
|
||||||
|
score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents();
|
||||||
|
score.Rank = ScoreRank.F;
|
||||||
|
return screen = createResultsScreen(score);
|
||||||
|
});
|
||||||
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
||||||
|
AddAssert("retry overlay present", () => screen.RetryOverlay != null);
|
||||||
|
AddAssert("no badges displayed", () => this.ChildrenOfType<RankBadge>().All(b => !b.IsPresent));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestShowHideStatisticsViaOutsideClick()
|
public void TestShowHideStatisticsViaOutsideClick()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user