mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Add failing play button by touch input test
This commit is contained in:
parent
f3142b308a
commit
d6b9f385c1
@ -13,12 +13,14 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Beatmaps.Drawables.Cards;
|
||||
using osu.Game.Beatmaps.Drawables.Cards.Buttons;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Beatmaps
|
||||
{
|
||||
@ -293,5 +295,22 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
|
||||
BeatmapCardNormal firstCard() => this.ChildrenOfType<BeatmapCardNormal>().First();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPlayButtonByTouchInput()
|
||||
{
|
||||
AddStep("create cards", () => Child = createContent(OverlayColourScheme.Blue, beatmapSetInfo => new BeatmapCardNormal(beatmapSetInfo)));
|
||||
|
||||
// mimics touch input
|
||||
AddStep("touch play button area on first card", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(firstCard().ChildrenOfType<PlayButton>().Single());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddAssert("first card is playing", () => firstCard().ChildrenOfType<PlayButton>().Single().Playing.Value);
|
||||
|
||||
BeatmapCardNormal firstCard() => this.ChildrenOfType<BeatmapCardNormal>().First();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user