1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Use UntilStep instead of Assert to check button visibility

This commit is contained in:
Andrei Zavatski 2021-05-09 10:06:36 +03:00
parent f0c1784d05
commit 879c08e666

View File

@ -35,11 +35,10 @@ namespace osu.Game.Tests.Visual.Online
{
setUpNewsResponse(responseWithCursor, "Set up cursor response");
AddStep("Show", () => overlay.Show());
AddUntilStep("Show more button is ready", () => showMoreButton != null);
AddAssert("Show More button is visible", () => showMoreButton?.Alpha == 1);
AddUntilStep("Show More button is visible", () => showMoreButton?.Alpha == 1);
setUpNewsResponse(responseWithNoCursor, "Set up no cursor response");
AddStep("Click Show More", () => showMoreButton?.Click());
AddAssert("Show More button is hidden", () => showMoreButton?.Alpha == 0);
AddUntilStep("Show More button is hidden", () => showMoreButton?.Alpha == 0);
}
private ShowMoreButton showMoreButton => overlay.ChildrenOfType<ShowMoreButton>().FirstOrDefault();