-
Notifications
You must be signed in to change notification settings - Fork 0
a #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a #177
Changes from 20 commits
b08a86f
9a56aed
dfeb9d8
db92681
809298d
0f40d61
ea0c04a
e80e5f3
a3a530c
c570db6
84cce2f
ed84dd4
97ddc8e
2058297
8c6818e
ca44d82
b838564
93b7c33
9c43739
4b8fa89
3e62330
6231e06
e36f9b2
bcc36b4
0e9664b
ac620ee
16a2a96
ca40749
daff79b
7c114cd
16882c6
4fd4544
bcf3712
8050ee3
e6a74fd
96513ce
c2ed2f7
9ac1ad2
964d3fb
cb843b1
9bea319
b36f8f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -662,7 +662,7 @@ public void TestLeaveNavigation() | |||||||||||||
|
|
||||||||||||||
| AddStep("invoke on back button", () => multiplayerComponents.OnBackButton()); | ||||||||||||||
|
|
||||||||||||||
| AddAssert("mod overlay is hidden", () => this.ChildrenOfType<MultiplayerUserModSelectOverlay>().Single().State.Value == Visibility.Hidden); | ||||||||||||||
| AddAssert("mod overlay is hidden", () => this.ChildrenOfType<MultiplayerUserModSelectOverlay>().All(o => o.State.Value == Visibility.Hidden)); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent vacuous pass in the mod overlay assertion. On Line 665, Suggested fix- AddAssert("mod overlay is hidden", () => this.ChildrenOfType<MultiplayerUserModSelectOverlay>().All(o => o.State.Value == Visibility.Hidden));
+ AddAssert("mod overlay is hidden", () =>
+ {
+ var overlays = this.ChildrenOfType<MultiplayerUserModSelectOverlay>().ToList();
+ return overlays.Count > 0 && overlays.All(o => o.State.Value == Visibility.Hidden);
+ });📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| AddAssert("dialog overlay is hidden", () => DialogOverlay.State.Value == Visibility.Hidden); | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| 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 osu.Framework.Allocation; | ||
| using osu.Framework.Bindables; | ||
| using osu.Framework.Graphics; | ||
| using osu.Framework.Graphics.Shapes; | ||
| using osu.Framework.Testing; | ||
| using osu.Game.Online.API.Requests.Responses; | ||
| using osu.Game.Overlays; | ||
| using osu.Game.Overlays.Profile; | ||
| using osu.Game.Overlays.Profile.Header.Components; | ||
| using osu.Game.Rulesets.Osu; | ||
| using osuTK; | ||
|
|
||
| namespace osu.Game.Tests.Visual.Online | ||
| { | ||
| public partial class TestSceneUserProfileMatchmakingStatsDisplay : OsuManualInputManagerTestScene | ||
| { | ||
| [Cached] | ||
| private readonly Bindable<UserProfileData?> userProfileData = new Bindable<UserProfileData?>(new UserProfileData(new APIUser(), new OsuRuleset().RulesetInfo)); | ||
|
|
||
| [Cached] | ||
| private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Pink); | ||
|
|
||
| [SetUpSteps] | ||
| public void SetUpSteps() | ||
| { | ||
| AddStep("create", () => | ||
| { | ||
| Clear(); | ||
| Add(new Box | ||
| { | ||
| RelativeSizeAxes = Axes.Both, | ||
| Colour = colourProvider.Background2, | ||
| }); | ||
| Add(new MatchmakingStatsDisplay | ||
| { | ||
| Anchor = Anchor.Centre, | ||
| Origin = Anchor.Centre, | ||
| Scale = new Vector2(1f), | ||
| User = { BindTarget = userProfileData }, | ||
| }); | ||
| }); | ||
|
|
||
| AddStep("set stats", () => userProfileData.Value = new UserProfileData(new APIUser | ||
| { | ||
| MatchmakingStatistics = | ||
| [ | ||
| new APIUserMatchmakingStatistics | ||
| { | ||
| Plays = 10, | ||
| FirstPlacements = 8, | ||
| Rank = 1000, | ||
| Rating = 2000, | ||
| TotalPoints = 500, | ||
| Pool = | ||
| { | ||
| Name = "Active Pool" | ||
| } | ||
| }, | ||
| new APIUserMatchmakingStatistics | ||
| { | ||
| Plays = 5, | ||
| FirstPlacements = 4, | ||
| Rank = 500, | ||
| Rating = 1000, | ||
| TotalPoints = 250, | ||
| Pool = | ||
| { | ||
| Name = "Inactive Pool" | ||
| } | ||
| }, | ||
| new APIUserMatchmakingStatistics | ||
| { | ||
| Rating = 1500, | ||
| IsRatingProvisional = true, | ||
| Pool = | ||
| { | ||
| Name = "Provisional" | ||
| } | ||
| } | ||
|
Comment on lines
+57
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test fixture doesn’t actually exercise pool-priority selection. Lines 57-82 only set 🧪 Suggested fixture hardening new APIUserMatchmakingStatistics
{
Plays = 10,
FirstPlacements = 8,
Rank = 1000,
Rating = 2000,
TotalPoints = 500,
Pool =
{
+ Id = 10,
+ Active = true,
Name = "Active Pool"
}
},
new APIUserMatchmakingStatistics
{
Plays = 5,
FirstPlacements = 4,
Rank = 500,
Rating = 1000,
TotalPoints = 250,
Pool =
{
+ Id = 1,
+ Active = false,
Name = "Inactive Pool"
}
},🤖 Prompt for AI Agents |
||
| ] | ||
| }, new OsuRuleset().RulesetInfo)); | ||
|
|
||
| AddStep("clear stats", () => userProfileData.Value = null); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // 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 NUnit.Framework; | ||
| using osu.Framework.Allocation; | ||
| using osu.Game.Overlays; | ||
| using osu.Game.Overlays.Dashboard.UserSearch; | ||
|
|
||
| namespace osu.Game.Tests.Visual.Online | ||
| { | ||
| public partial class TestSceneUserSearchDisplay : OsuTestScene | ||
| { | ||
| [Cached] | ||
| private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Purple); | ||
|
|
||
| protected override bool UseOnlineAPI => true; | ||
|
|
||
| [SetUp] | ||
| public void Setup() => Schedule(() => | ||
| { | ||
| Child = new UserSearchDisplay(); | ||
| }); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,17 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // 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 osu.Framework.Extensions; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Framework.Testing; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Graphics.UserInterface; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Online.API; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Online.Multiplayer; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Online.Multiplayer.MatchTypes.RankedPlay; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Online.Rooms; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using osuTK.Input; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace osu.Game.Tests.Visual.RankedPlay | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -46,6 +51,30 @@ public override void SetUpSteps() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }).WaitSafely(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (int i = 0; i < 3; i++) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| int i2 = i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AddStep($"click card {i2}", () => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InputManager.MoveMouseTo(this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().ElementAt(i2)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InputManager.Click(MouseButton.Left); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AddWaitStep("wait", 3); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AddStep("click play button", () => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var button = screen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .ChildrenOfType<PlayerHandOfCards.PlayerHandCard>() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .First(it => it.Selected) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .ChildrenOfType<ShearedButton>() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .First(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InputManager.MoveMouseTo(button); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InputManager.Click(MouseButton.Left); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add deterministic readiness checks before indexed/ Line 60 ( 🔧 Proposed stabilization+ AddUntilStep("at least 3 cards visible",
+ () => this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().Count() >= 3);
+
for (int i = 0; i < 3; i++)
{
int i2 = i;
AddStep($"click card {i2}", () =>
{
- InputManager.MoveMouseTo(this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().ElementAt(i2));
+ var card = this.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().ElementAt(i2);
+ InputManager.MoveMouseTo(card);
InputManager.Click(MouseButton.Left);
});
}
- AddWaitStep("wait", 3);
+ AddUntilStep("selected card has play button", () =>
+ screen.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>()
+ .Any(c => c.Selected && c.ChildrenOfType<ShearedButton>().Any()));
AddStep("click play button", () =>
{
- var button = screen
- .ChildrenOfType<PlayerHandOfCards.PlayerHandCard>()
- .First(it => it.Selected)
- .ChildrenOfType<ShearedButton>()
- .First();
+ var selectedCard = screen.ChildrenOfType<PlayerHandOfCards.PlayerHandCard>().First(c => c.Selected);
+ var button = selectedCard.ChildrenOfType<ShearedButton>().First();
InputManager.MoveMouseTo(button);
InputManager.Click(MouseButton.Left);
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid indefinitely disabling this regression test.
Line 23 fully skips this test, which drops coverage for a known seek/audio edge case. Please attach a concrete tracking issue + exit criteria (or keep it flaky/quarantined instead of ignored).
Suggested direction
📝 Committable suggestion
🤖 Prompt for AI Agents